`;return h[h.length-1]=" "+h[h.length-1]+"]"+(r?"":m),h}function gp(e){const t=[];for(let s=0;s<e.length;s+=2)t.push([e[s],e[s+1]]);return t}class cn{constructor(e,t,s){if(this.dtype=t,this.shape=e.slice(),this.size=We(e),s!=null){const n=s.length;I(n===this.size,()=>`Lengthofvalues'${n}'doesnotmatchthesizeinferredbytheshape'${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=s||ty(t,this.size),this.strides=ni(e)}set(e,...t){t.length===0&&(t=[0]),I(t.length===this.rank,()=>`Thenumberofprovidedcoordinates(${t.length})mustmatchtherank(${this.rank})`);const s=this.locToIndex(t);this.values[s]=e}get(...e){e.length===0&&(e=[0]);let t=0;for(const n of e){if(n<0||n>=this.shape[t]){const i=`Requestedoutofrangeelementat${e}.Buffershape=${this.shape}`;throw new Error(i)}t++}let s=e[e.length-1];for(let n=0;n<e.length-1;++n)s+=this.strides[n]*e[n];return this.values[s]}locToIndex(e){if(this.rank===0)return 0;if(this.rank===1)return e[0];let t=e[e.length-1];for(let s=0;s<e.length-1;++s)t+=this.strides[s]*e[s];return t}indexToLoc(e){if(this.rank===0)return[];if(this.rank===1)return[e];const t=new Array(this.shape.length);for(let s=0;s<t.length-1;++s)t[s]=Math.floor(e/this.strides[s]),e-=t[s]*this.strides[s];return t[t.length-1]=e,t}get rank(){return this.shape.length}toTensor(){return ri().makeTensor(this.values,this.shape,this.dtype)}}let ri=null,Ba=null,e_=null;function jL(e){ri=e}function VL(e){Ba=e}function GL(e){e_=e}class me{constructor(e,t,s,n){this.kept=!1,this.isDisposedInternal=!1,this.shape=e.slice(),this.dtype=t||"float32",this.size=We(e),this.strides=ni(e),this.dataId=s,this.id=n,this.rankType=this.rank<5?this.rank.toString():"higher"}get rank(){return this.shape.length}async buffer(){const e=await this.data();return Ba.buffer(this.shape,this.dtype,e)}bufferSync(){return Ba.buffer(this.shape,this.dtype,this.dataSync())}async array(){const e=await this.data();return Do(this.shape,e)}arraySync(){return Do(this.shape,this.dataSync())}async data(){this.throwIfDisposed();const e=ri().read(this.dataId);if(this.dtype==="string"){const t=await e;try{return t.map(s=>Yu(s))}catch(s){throw new Error("Failed to decode the string bytes into utf-8. To get the original bytes, call tensor.bytes().")}}return e}dataSync(){this.throwIfDisposed();const e=ri().readSync(this.dataId);if(this.dtype==="string")try{return e.map(t=>Yu(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();const e=await ri().read(this.dataId);return this.dtype==="string"?e:new Uint8Array(e.buffer)}dispose(){if(this.isDisposed)return;ri().disposeTensor(this),this.isDisposedInternal=!0}get isDisposed(){return this.isDisposedInternal}throwIfDisposed(){if(this.isDisposed)throw new Error("Tensor is disposed.")}print(e=!1){return Ba.print(this,e)}clone(){return this.throwIfDisposed(),Ba.clone(this)}toString(e=!1){const t=this.dataSync();return PL(t,this.shape,this.dtype,e)}cast(e){return this.throwIfDisposed(),Ba.cast(this,e)}variable(e=!0,t,s){return this.throwIfDisposed(),ri().makeVariable(this,e,t,s)}}Object.defineProperty(me,Symbol.hasInstance,{value:e=>!!e&&e.data!=null&&e.dataSync!=null&&e.throwIfDisposed!=null});class oi extends me{constructor(e,t,s,n){super(e.shape,e.dtype,e.dataId,n);this.trainable=t,this.name=s}assign(e){if(e.dtype!==this.dtype)throw new Error(`dtypeofthenewvalue(${e.dtype})andpreviousvalue(${this.dtype})mustmatch`);if(!Nt(e.shape,this.shape))throw new Error(`shapeofthenewvalue(${e.shape})andpreviousvalue(${this.shape})mustmatch`);ri().disposeTensor(this),this.dataId=e.dataId,ri().incRef(this,null)}dispose(){ri().disposeVariable(this),this.isDisposedInternal=!0}}Object.defineProperty(oi,Symbol.hasInstance,{value:e=>e instanceof me&&e.assign!=null&&e.assign instanceof Function});var ay;(function(e){e.R0="R0",e
ManifestJSONhasweightswithnames:${a.join(", ")}.`)}const l=i.reduce((d,m,f)=>(m&&d.push(f),d),[]),c=[];l.forEach(d=>{t[d].paths.forEach(m=>{const f=s+(s.endsWith("/")?"":"/")+m;c.push(f)})});const p=await e(c),u={};let h=0;return l.forEach(d=>{const m=t[d].paths.length;let f=0;for(let T=0;T<m;T++)f+=p[h+T].byteLength;const g=new ArrayBuffer(f),y=new Uint8Array(g);let w=0;for(let T=0;T<m;T++){const A=new Uint8Array(p[h+T]);y.set(A,w),w+=A.byteLength}const x=r[d];x.forEach(T=>{const A=g.slice(T.groupOffset,T.groupOffset+T.sizeBytes),_=gy(A,[T.manifestEntry]);for(const E in _)u[E]=_[E]}),h+=m}),u}}const E_="application/octet-stream",__="application/json";class xy{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?(I(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=W().platform.fetch,I(e!=null&&e.length>0,()=>"URL path for http must not be null, undefined or empty."),Array.isArray(e)&&I(e.length===2,()=>`URLpathsforhttpmusthavealengthof2,(actuallengthis${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.");const t=Object.assign({method:this.DEFAULT_METHOD},this.requestInit);t.body=new FormData;const s=[{paths:["./model.weights.bin"],weights:e.weightSpecs}],n={modelTopology:e.modelTopology,format:e.format,generatedBy:e.generatedBy,convertedBy:e.convertedBy,userDefinedMetadata:e.userDefinedMetadata,weightsManifest:s};t.body.append("model.json",new Blob([JSON.stringify(n)],{type:__}),"model.json"),e.weightData!=null&&t.body.append("model.weights.bin",new Blob([e.weightData],{type:E_}),"model.weights.bin");const i=await this.fetch(this.path,t);if(i.ok)return{modelArtifactsInfo:Sp(e),responses:[i]};throw new Error(`BrowserHTTPRequest.save()failedduetoHTTPresponsestatus${i.status}.`)}async load(){const e=await this.fetch(this.path,this.requestInit);if(!e.ok)throw new Error(`Requestto${this.path}failedwithstatuscode${e.status}.PleaseverifythisURLpointstothemodelJSONofthemodeltoload.`);let t;try{t=await e.json()}catch(h){let d=`FailedtoparsemodelJSONofresponsefrom${this.path}.`;throw this.path.endsWith(".pb")?d+=" 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.":d+=" Please make sure the server is serving valid JSON for this request.",new Error(d)}const s=t.modelTopology,n=t.weightsManifest,i=t.generatedBy,r=t.convertedBy,o=t.format,a=t.userDefinedMetadata;if(s==null&&n==null)throw new Error(`TheJSONfromHTTPpath${this.path}containsneithermodeltopologyormanifestforweights.`);let l,c;if(n!=null){const h=await this.loadWeights(n);[l,c]=h}const p={modelTopology:s,weightSpecs:l,weightData:c,userDefinedMetadata:a,generatedBy:i,convertedBy:r,format:o},u=t.modelInitializer;return u&&(p.modelInitializer=u),p}async loadWeights(e){const t=Array.isArray(this.path)?this.path[1]:this.path,[s,n]=k_(t),i=this.weightPathPrefix||s,r=[];for(const c of e)r.push(...c.weights);const o=[],a=[];for(const c of e)for(const p of c.paths)this.weightUrlConverter!=null?a.push(this.weightUrlConverter(p)):o.push(i+p+n);this.weightUrlConverter&&o.push(...await Promise.all(a));const l=await wy(o,{requestInit:this.requestInit,fetchFunc:this.fetch,onProgress:this.onProgress});return[r,Lp(l)]}}xy.URL_SCHEME_REGEX=/^https?:\/\//;function k
Actual:${i}.
Expected:${r}.`);for(let o=0;o<r.length;++o){const a=i[o],l=r[o];if(!s(a,l))throw new Error(`Arraysdiffer:actual[${o}]=${a},expected[${o}]=${l}.
Actual:${i}.
Expected:${r}.`)}}function J_(e,t){e().then(()=>t.fail(),()=>t())}function Z_(e,t){const s=typeof t=="string"||typeof t=="number"||typeof t=="boolean"?[t]:t;return kn(e)||kn(e[0])||kn(t)||kn(t[0])?Oy(e,s,(n,i)=>n==i):Oy(e,t,(n,i)=>Ey(n,i,0))}function Q_(e,t,s){if(s==null&&(s=Ry()),!Ey(e,t,s))throw new Error(`Numbersdiffer:actual===${e},expected===${t}`)}function Ey(e,t,s){return!isFinite(e)&&!isFinite(t)?!0:!(isNaN(e)||isNaN(t)||Math.abs(e-t)>s)}function ek(e,t,s){for(let n=0;n<e.length;n++)if(e[n]<t||e[n]>s)throw new Error(`Valueoutofrange:${e[n]}low:${t},high:${s}`)}function tk(e,t){expect(new Float32Array(e)).toEqual(new Float32Array(t))}const _y="2.6.0";function sk(){W().set("PROD",!0)}function nk(){W().set("DEBUG",!0)}function ik(){W().set("DEPRECATION_WARNINGS_ENABLED",!1),console.warn("TensorFlow.js deprecation warnings have been disabled.")}function It(e){W().getBool("DEPRECATION_WARNINGS_ENABLED")&&console.warn(e+" You can disable deprecation warnings with tf.disableDeprecationWarnings().")}GL(It);function rk(){v.disposeVariables()}function Ms(){return v}function Ya(){return v.memory()}function ok(e){return v.profile(e)}function C(e,t){return v.tidy(e,t)}function ce(e){const t=bp(e);t.forEach(s=>s.dispose())}function pt(e){return v.keep(e)}function ak(e){return v.time(e)}function xS(e){return v.setBackend(e)}function lk(){return v.ready()}function ck(){return v.backendName}function pk(e){v.removeBackend(e)}function uk(e){return v.findBackend(e)}function hk(e){return v.findBackendFactory(e)}function Tp(e,t,s=1){return v.registerBackend(e,t,s)}function ky(){return v.backend}function dk(e,t){W().setPlatform(e,t)}function mk(e,t){let s=b(e,"a","add"),n=b(t,"b","add");[s,n]=Ce(s,n);const i=(o,a)=>{const l=o.add(s,n);return a([s,n]),l},r={a:s,b:n};return v.runKernelFunc(i,r,null,Kn)}const $=S({add_:mk});function fk(e,t){let s=b(e,"a","floorDiv"),n=b(t,"b","floorDiv");[s,n]=Ce(s,n);const i=(o,a)=>{const l=o.floorDiv(s,n);return a([s,n]),l},r={a:s,b:n};return v.runKernelFunc(i,r,null,Ec)}const Ka=S({floorDiv_:fk});function gk(e,t){let s=b(e,"a","div"),n=b(t,"b","div");if([s,n]=Ce(s,n),s.dtype==="int32"&&n.dtype==="int32")return Ka(s,n);const i=(a,l)=>{const c=a.realDivide(s,n);return l([s,n]),c},r={a:s,b:n},o={};return v.runKernelFunc(i,r,null,Jn,o)}const Z=S({div_:gk});function yk(e,t){let s=b(e,"a","mul"),n=b(t,"b","mul");[s,n]=Ce(s,n);const i=(o,a)=>{const l=o.multiply(s,n);return a([s,n]),l},r={a:s,b:n};return v.runKernelFunc(i,r,null,Sr)}const R=S({mul_:yk});function bk(e){const t=b(e,"x","abs"),s={x:t};return v.runKernelFunc((n,i)=>(i([t]),t.dtype==="complex64"?n.complexAbs(t):n.abs(t)),s,null,yo)}const et=S({abs_:bk});function wk(e){const t=b(e,"x","acos"),s={x:t};return v.runKernelFunc((n,i)=>{const r=n.acos(t);return i([t]),r},s,null,nr)}const eh=S({acos_:wk});function xk(e){const t=b(e,"x","acosh"),s={x:t};return v.runKernelFunc((n,i)=>{const r=n.acosh(t);return i([t]),r},s,null,ir)}const th=S({acosh_:xk});function Lk(e){I(Array.isArray(e),()=>"The argument passed to tf.addN() must be a list of tensors"),I(e.length>=1,()=>`Mustpassatleastonetensortotf.addN(),butgot${e.length}`);const t=e.map((r,o)=>b(r,`tensors${o}`,"addN")),s=t[0];t.forEach(r=>{if(r.dtype!==s.dtype)throw new Error("All tensors passed to tf.addN() must have the same dtype")}),t.forEach(r=>{if(!Nt(r.shape,s.shape))throw new Error("All tensors passed to tf.addN() must have the same shape")});const n=(r,o)=>{const a=r.addN(t);return o(t),a},i=t;return v.runKernelFunc(n,i,null,yc)}const sh=S({addN_:Lk});function Dy(e,t){for(let s=0;s<e.length;++s)if(e[e.length-s-1]!==t-1-s)return!1;return!0}function LS(e,t,s){const n=e.length+t.length,i=[];let r=0,o=0;for(let a=0;a<n;a++)s.indexOf(a)===-1?i.push(e[r++]):i.push(t[o++]);return i}function Fy(e,t){const s=[],n=e.length;for(let r=0;r<n;r++)t.indexOf(r)===-1&&s.push(e[r]);const i=t.map(r=>e[r]);return[s,i]}function bt(e,t){const s=t.map(n=>1);return LS(e,s,t)}function Sk(e,t,s){I(Dy(t,s),()=>`${e}supportsonlyinner-mostaxesfornow.Gotaxes${t}andrank-${s}input.`)}funct
withdtype${o.dtype}.`)});const n=(o,a)=>{const l=Ne(t,s[0].shape)[0],c=Wy(s.map(h=>h.shape),l);if(We(c)===0)return ze([],c);if(s=s.filter(h=>h.size>0),s.length===1)return s[0];const p=s.map(h=>h.shape);$y(p,l);const u=o.concat(s,l);return a(s),u},i=s,r={axis:t};return v.runKernelFunc(n,i,null,xo,r)}const be=S({concat_:Wk});function zk(e){const t=b(e,"x","sigmoid"),s={x:t};return v.runKernelFunc((n,i)=>{const r=n.sigmoid(t);return i([r]),r},s,null,Rr)}const rs=S({sigmoid_:zk});function Pk(e,t,s){const n=b(e,"x","slice");if(n.rank===0)throw new Error("Slicing scalar is not possible");const i=(a,l)=>{const[c,p]=vp(n,t,s);return Ty(n,c,p),l([n]),a.slice(n,c,p)},r={x:n},o={begin:t,size:s};return v.runKernelFunc(i,r,null,Co,o)}const he=S({slice_:Pk});function Bk(e){const t=b(e,"x","tanh"),s={x:t};return v.runKernelFunc((n,i)=>{const r=n.tanh(t);return i([r]),r},s,null,kr)}const ki=S({tanh_:Bk});function jk(e,t,s,n,i,r){const o=b(e,"forgetBias","basicLSTMCell"),a=b(t,"lstmKernel","basicLSTMCell"),l=b(s,"lstmBias","basicLSTMCell"),c=b(n,"data","basicLSTMCell"),p=b(i,"c","basicLSTMCell"),u=b(r,"h","basicLSTMCell"),h=be([c,u],1),d=Te(h,a),m=$(d,l),f=m.shape[0],g=m.shape[1]/4,y=[f,g],w=he(m,[0,0],y),x=he(m,[0,g],y),T=he(m,[0,g*2],y),A=he(m,[0,g*3],y),_=$(R(rs(w),ki(x)),R(p,rs($(o,T)))),E=R(ki(_),rs(A));return[_,E]}const SS=S({basicLSTMCell_:jk});function Vk(e,t,s){const n=b(e,"x","batchToSpaceND"),i=t.reduce((l,c)=>l*c);I(n.rank>=1+t.length,()=>`inputrankis${n.rank}butshouldbe>thanblockShape.length${t.length}`),I(s.length===t.length,()=>`crops.lengthis${s.length}butshouldbeequaltoblockShape.length${t.length}`),I(n.shape[0]%i===0,()=>`inputtensorbatchis${n.shape[0]}butisnotdivisiblebytheproductoftheelementsofblockShape${t.join(" * ")}===${i}`);const r=l=>l.batchToSpaceND(n,t,s),o={x:n},a={blockShape:t,crops:s};return v.runKernelFunc(r,o,null,Sc,a)}const $r=S({batchToSpaceND_:Vk});function IS(e){let t;return e.rank===0||e.rank===1?t=O(e,[1,1,1,e.size]):e.rank===2?t=O(e,[1,1,e.shape[0],e.shape[1]]):e.rank===3?t=O(e,[1,e.shape[0],e.shape[1],e.shape[2]]):t=e,t}function Gk(e,t,s,n,i,r){r==null&&(r=.001);const o=b(e,"x","batchNorm"),a=b(t,"mean","batchNorm"),l=b(s,"variance","batchNorm");let c;i!=null&&(c=b(i,"scale","batchNorm"));let p;n!=null&&(p=b(n,"offset","batchNorm")),I(a.rank===l.rank,()=>"Batch normalization gradient requires mean and variance to have equal ranks."),I(p==null||a.rank===p.rank,()=>"Batch normalization gradient requires mean and offset to have equal ranks."),I(c==null||a.rank===c.rank,()=>"Batch normalization gradient requires mean and scale to have equal ranks.");const u=IS(o),h=(g,y)=>(y([u,a,l,c]),g.batchNorm(u,ph(a),ph(l),ph(p),ph(c),r)),d={x:u,scale:c,offset:p,mean:a,variance:l},m={varianceEpsilon:r},f=v.runKernelFunc(h,d,null,vi,m);return O(f,o.shape)}function ph(e){return e==null?null:e.rank===0?O(e,[e.size]):e.rank===1?e:e.rank===2?O(e,[1,1,e.shape[0],e.shape[1]]):e.rank===3?O(e,[1,e.shape[0],e.shape[1],e.shape[2]]):e}const Ys=S({batchNorm_:Gk});function qk(e,t,s,n,i,r){const o=b(e,"x","batchNorm"),a=b(t,"mean","batchNorm"),l=b(s,"variance","batchNorm");let c;i!=null&&(c=b(i,"scale","batchNorm"));let p;return n!=null&&(p=b(n,"offset","batchNorm")),I(o.rank===2,()=>`ErrorinbatchNorm2D:xmustberank2butgotrank${o.rank}.`),I(a.rank===2||a.rank===1,()=>`ErrorinbatchNorm2D:meanmustberank2orrank1butgotrank${a.rank}.`),I(l.rank===2||l.rank===1,()=>`ErrorinbatchNorm2D:variancemustberank2orrank1butgotrank${l.rank}.`),c!=null&&I(c.rank===2||c.rank===1,()=>`ErrorinbatchNorm2D:scalemustberank2orrank1butgotrank${c.rank}.`),p!=null&&I(p.rank===2||p.rank===1,()=>`ErrorinbatchNorm2D:offsetmustberank2orrank1butgotrank${p.rank}.`),Ys(o,a,l,p,c,r)}const uh=S({batchNorm2d_:qk});function Hk(e,t,s,n,i,r){const o=b(e,"x","batchNorm"),a=b(t,"mean","batchNorm"),l=b(s,"variance","batchNorm");let c;i!=null&&(c=b(i,"scale","batchNorm"));let p;return n!=null&&(p=b(n,"offset","batchNorm")),I(o.rank===3,()=>`Errorinbatc
rank${r.rank}.`),I(ke(t),()=>`ErrorinlocalResponseNormalization:depthRadiusmustbeanintegerbutgotdepthRadius${t}.`);let o=r,a=!1;r.rank===3&&(a=!0,o=O(r,[1,r.shape[0],r.shape[1],r.shape[2]]));const l=(h,d)=>{const m=h.localResponseNormalization4D(o,t,s,n,i);return d([o,m]),m},c={x:o},p={depthRadius:t,bias:s,alpha:n,beta:i},u=v.runKernelFunc(l,c,null,Uc,p);return a?O(u,[u.shape[1],u.shape[2],u.shape[3]]):u}const Nh=S({localResponseNormalization_:VD});function GD(e){const t=b(e,"x","log"),s={x:t};return v.runKernelFunc((n,i)=>{const r=n.log(t);return i([t]),r},s,null,xr)}const zt=S({log_:GD});function qD(e){const t=b(e,"x","log1p"),s={x:t};return v.runKernelFunc((n,i)=>{const r=n.log1p(t);return i([t]),r},s,null,Lr)}const ol=S({log1p_:qD});function HD(e){return I(si(e),()=>"The f passed in grad(f) must be a function"),(t,s)=>{const n=b(t,"x","tf.grad",null),i=s!=null?b(s,"dy","tf.grad"):null;return v.tidy(()=>{const{value:r,grads:o}=v.gradients(()=>e(n),[n],i);return i!=null&&Se(r.shape,i.shape,"The shape of dy passed in grad(f)(x, dy) must match the shape returned by f(x)"),Ch(o),o[0]})}}function YD(e){return I(si(e),()=>"The f passed in grads(f) must be a function"),(t,s)=>{I(Array.isArray(t),()=>"The args passed in grads(f)(args) must be an array of `Tensor`s or `TensorLike`s");const n=Ei(t,"args","tf.grads",null),i=s!=null?b(s,"dy","tf.grads"):null;return v.tidy(()=>{const{value:r,grads:o}=v.gradients(()=>e(...n),n,i);return i!=null&&Se(r.shape,i.shape,"The shape of dy passed in grads(f)([x1,...], dy) must match the shape returned by f([x1,...])"),Ch(o),o})}}function KD(e){return I(si(e),()=>"The f passed in valueAndGrad(f) must be a function"),(t,s)=>{I(t instanceof me,()=>"The x passed in valueAndGrad(f)(x) must be a tensor"),I(s==null||s instanceof me,()=>"The dy passed in valueAndGrad(f)(x, dy) must be a tensor");const{grads:n,value:i}=v.gradients(()=>e(t),[t],s);return Ch(n),{grad:n[0],value:i}}}function XD(e){return I(si(e),()=>"The f passed in valueAndGrads(f) must be a function"),(t,s)=>{I(Array.isArray(t)&&t.every(i=>i instanceof me),()=>"The args passed in valueAndGrads(f)(args) must be array of tensors"),I(s==null||s instanceof me,()=>"The dy passed in valueAndGrads(f)(args, dy) must be a tensor");const n=v.gradients(()=>e(...t),t,s);return s!=null&&Se(n.value.shape,s.shape,"The shape of dy passed in valueAndGrads(f)([x1,...], dy) must match the shape returned by f([x1,...])"),Ch(n.grads),n}}function Rh(e,t){I(si(e),()=>"The f passed in variableGrads(f) must be a function"),I(t==null||Array.isArray(t)&&t.every(c=>c instanceof oi),()=>"The varList passed in variableGrads(f, varList) must be an array of variables");const s=t!=null;if(!s){t=[];for(const c in v.registeredVariables)t.push(v.registeredVariables[c])}const n=s?t.filter(c=>!c.trainable):null,i=t.length;t=t.filter(c=>c.trainable),I(t.length>0,()=>`variableGrads()expectsatleastoneoftheinputvariablestobetrainable,butnoneofthe${i}variablesistrainable.`);const r=!0,{value:o,grads:a}=v.gradients(e,t,null,r);I(a.some(c=>c!=null),()=>"Cannot find a connection between any variable and the result of the loss function y=f(x). Please make sure the operations that use variables are inside the function f passed to minimize()."),I(o.rank===0,()=>`ThefpassedinvariableGrads(f)mustreturnascalar,butitreturnedarank-${o.rank}tensor`);const l={};return t.forEach((c,p)=>{a[p]!=null&&(l[c.name]=a[p])}),n!=null&&n.forEach(c=>l[c.name]=null),{value:o,grads:l}}function ms(e){return v.customGrad(e)}function Ch(e){const t=e.filter(s=>s==null).length;if(t>0)throw new Error(`Cannotcomputegradientofy=f(x)withrespecttox.Makesurethat
2.Thecustom${n}isdefinedinJavaScript,butisnotregisteredproperlywithtf.serialization.registerClass().`);return o}else{const r=e;if(r.className==null||r.config==null)throw new k(`${n}:Improperconfigformat:${JSON.stringify(r)}.
'className'and'config'mustset.`);const o=r.className;let a,l;if(o in s?[a,l]=s[o]:o in Ln?[a,l]=Ln.className:o in t&&([a,l]=t[o]),a==null)throw new k(`Unknown${n}:${o}.Thismaybeduetooneofthefollowingreasons:
2.Thecustom${n}isdefinedinJavaScript,butisnotregisteredproperlywithtf.serialization.registerClass().`);if(l!=null){const c={};for(const d of Object.keys(Ln))c[d]=Ln[d];for(const d of Object.keys(s))c[d]=s[d];const p=r.config;p.customObjects=c;const u=Object.assign({},Ln);for(const d of Object.keys(s))Ln[d]=s[d];nb(r.config);const h=l(a,r.config,s,i);return Ln=Object.assign({},u),h}else{const c=Object.assign({},Ln);for(const u of Object.keys(s))Ln[u]=s[u];const p=new a(r.config);return Ln=Object.assign({},c),p}}}function W$(e,t){return e<t?-1:e>t?1:0}function Dp(e,t){return-1*W$(e,t)}function Sn(e){if(e==null)return e;const t=[];for(const s of e)t.indexOf(s)===-1&&t.push(s);return t}function wT(e){if(e==null)throw new k(`Invalidvalueinobj:${JSON.stringify(e)}`);for(const t in e)if(e.hasOwnProperty(t))return!1;return!0}function Wi(e,t,s){if(s==null)return;if(e.indexOf(s)<0)throw new k(`${s}isnotavalid${t}.Validvaluesare${e}ornull/undefined.`)}function Qh(e,t,s=0,n=Infinity){return Qs(s>=0),Qs(n>=s),Array.isArray(e)&&e.length>=s&&e.length<=n&&e.every(i=>typeof i===t)}function gt(e,t){Array.isArray(e)?(N.assert(e.length>0,()=>`${t}isunexpectedlyanemptyarray.`),e.forEach((s,n)=>gt(s,`element${n+1}of${t}`))):N.assert(Number.isInteger(e)&&e>0,()=>`Expected${t}tobeapositiveinteger,butgot${xT(e)}.`)}function xT(e){return e===null?"null":Array.isArray(e)?"["+e.map(t=>xT(t)).join(",")+"]":typeof e=="string"?`"${e}"`:`${e}`}function LT(e,t){let s=N.now(),n;const i=(...r)=>{const o=N.now();return o-s<t||(s=o,n=e(...r)),n};return i}function ed(e){return e==="relu"?"relu":e==="linear"?"linear":e==="elu"?"elu":null}function ib(e,t){return C(()=>Xe(te(R(e,e),t,!0)))}class Fp extends V.Serializable{getConfig(){return{}}}class td extends Fp{constructor(e){super();this.defaultMaxValue=2,this.defaultAxis=0,this.maxValue=e.maxValue!=null?e.maxValue:this.defaultMaxValue,this.axis=e.axis!=null?e.axis:this.defaultAxis}apply(e){return C(()=>{const t=ib(e,this.axis),s=wt(t,0,this.maxValue);return R(e,Z(s,$(Tt(),t)))})}getConfig(){return{maxValue:this.maxValue,axis:this.axis}}}td.className="MaxNorm";V.registerClass(td);class sd extends Fp{constructor(e){super();this.defaultAxis=0,this.axis=e.axis!=null?e.axis:this.defaultAxis}apply(e){return C(()=>Z(e,$(Tt(),ib(e,this.axis))))}getConfig(){return{axis:this.axis}}}sd.className="UnitNorm";V.registerClass(sd);class nd extends Fp{apply(e){return De(e)}}nd.className="NonNeg";V.registerClass(nd);class id extends Fp{constructor(e){super();this.defaultMinValue=0,this.defaultMaxValue=1,this.defaultRate=1,this.defaultAxis=0,this.minValue=e.minValue!=null?e.minValue:this.defaultMinValue,this.maxValue=e.maxValue!=null?e.maxValue:this.defaultMaxValue,this.rate=e.rate!=null?e.rate:this.defaultRate,this.axis=e.axis!=null?e.axis:this.defaultAxis}apply(e){return C(()=>{const t=ib(e,this.axis),s=$(R(this.rate,wt(t,this.minValue,this.maxValue)),R(1-this.rate,t));return R(e,Z(s,$(Tt(),t)))})}getConfig(){return{minValue:this.minValue,maxValue:this.maxValue,rate:this.rate,axis:this.axis}}}id.className="MinMaxNorm";V.registerClass(id);const ST={maxNorm:"MaxNorm",minMaxNorm:"MinMaxNorm",nonNeg:"NonNeg",unitNorm:"UnitNorm"};function it(e){return xl(e)}function IT(e,t={}){return hi(e,V.SerializationMap.getMap().classNameMap,t,"constraint")}function rt(e){if(e==null)return null;if(typeof e=="string"){const t=e in ST?ST[e]:e,s={className:t,config:{}};return IT(s)}else return e instanceof Fp?e:IT(e)}const rb={};Ee(rb,{maxNorm:()=>z$,minMaxNorm:()=>j$,nonNeg:()=>B$,unitNorm:()=>P$});function z$(e){return new td(e)}function P$(e){return new sd(e)}function B$(){return new nd}function j$(e){return new id(e)}const vT=["channelsFirst","channelsLast"],TT=["valid","same","causal"],AT=["max","avg"],NT=["sum","mul","concat","ave"];const Ll=new Map;function ot(e){Wi(vT,"DataFormat",e)}function ys(e){Wi(TT,"PaddingMode",e)}function ob(e){Wi(AT,"PoolMode",e)}const Mp=[],CT="/";function Mn(e,t){Mp.push(e);try{const s=t();return Mp.pop(),s}catch(s){throw Mp.pop(),s}}function V$(){return Mp.lengt
becausethevaluedtypeis${t.dtype},butTensorArraydtypeis${this.dtype}.`);if(this.size()===0&&(this.elementShape==null||this.elementShape.length===0)&&(this.elementShape=t.shape),Ps(this.elementShape,t.shape,`TensorArray${this.name}:CouldnotwritetoTensorArrayindex${e}.`),s.read)throw new Error(`TensorArray${this.name}:CouldnotwritetoTensorArrayindex${e},becauseithasalreadybeenread.`);if(s.written)throw new Error(`TensorArray${this.name}:CouldnotwritetoTensorArrayindex${e},becauseithasalreadybeenwritten.`);s.tensor=t,pt(t),s.written=!0,this.tensors[e]=s}writeMany(e,t){if(e.length!==t.length)throw new Error(`TensorArray${this.name}:couldnotwritemultipletensors,becausetheindexsize:${e.length}isnotthesameastensorssize:${t.length}.`);e.forEach((s,n)=>this.write(s,t[n]))}gather(e,t){if(!!t&&t!==this.dtype)throw new Error(`TensorArraydtypeis${this.dtype}butgatherrequesteddtype${t}`);if(e)e=e.slice(0,this.size());else{e=[];for(let n=0;n<this.size();n++)e.push(n)}if(e.length===0)return ze([],[0].concat(this.elementShape));const s=this.readMany(e);return Ps(this.elementShape,s[0].shape,"TensorArray shape mismatch: "),Ve(s,0)}concat(e){if(!!e&&e!==this.dtype)throw new Error(`TensorArraydtypeis${this.dtype}butconcatrequesteddtype${e}`);if(this.size()===0)return ze([],[0].concat(this.elementShape));const t=[];for(let n=0;n<this.size();n++)t.push(n);const s=this.readMany(t);return Ps(this.elementShape,s[0].shape,`TensorArrayshapemismatch:tensorarrayshape(${this.elementShape})vsfirsttensorshape(${s[0].shape})`),be(s,0)}scatter(e,t){if(t.dtype!==this.dtype)throw new Error(`TensorArraydtypeis${this.dtype}buttensorhasdtype${t.dtype}`);if(e.length!==t.shape[0])throw new Error(`Expectedlen(indices)==tensor.shape[0],butsaw:${e.length}vs.${t.shape[0]}`);const s=Math.max(...e);if(!this.dynamicSize&&s>=this.maxSize)throw new Error(`Maxindexmustbe<arraysize(${s}vs.${this.maxSize})`);this.writeMany(e,Ge(t,0))}split(e,t){if(t.dtype!==this.dtype)throw new Error(`TensorArraydtypeis${this.dtype}buttensorhasdtype${t.dtype}`);let s=0;const n=e.map(a=>(s+=a,s));if(s!==t.shape[0])throw new Error(`Expectedsumoflengthstobeequalto
tensor.shape[0],butsumoflengthsis
${s},andtensor's shape is: ${t.shape}`);if(!this.dynamicSize&&e.length!==this.maxSize)throw new Error(`TensorArray'ssizeisnotequaltothesizeoflengths(${this.maxSize}vs.${e.length}),andtheTensorArrayisnotmarkedasdynamicallyresizeable`);const i=s===0?0:t.size/s,r=[];C(()=>{t=O(t,[1,s,i]);for(let a=0;a<e.length;++a){const l=a===0?0:n[a-1],c=[0,l,0],p=[1,e[a],i];r[a]=O(he(t,c,p),this.elementShape)}return r});const o=[];for(let a=0;a<e.length;a++)o[a]=a;this.writeMany(o,r)}}class uu{constructor(e,t,s,n=-1){this.tensors=e,this.elementShape=t,this.elementDtype=s,e!=null&&e.forEach(i=>{if(s!==i.dtype)throw new Error(`Invaliddatatypes;opelements${s},butlistelements${i.dtype}`);Ps(t,i.shape,"TensorList shape mismatch: "),pt(i)}),this.idTensor=j(0),this.maxNumElements=n,pt(this.idTensor)}get id(){return this.idTensor.id}copy(){return new uu([...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,s=-1){if(t!==this.elementDtype)throw new Error(`Invaliddatatypes;opelements${t},butlistelements${this.elementDtype}`);if(s!==-1&&this.tensors.length!==s)throw new Error(`Operationexpectedalistwith${s}elementsbutgotalistwith${this.tensors.length}elements.`);return Ps(e,this.elementShape,"TensorList shape mismatch: "),C(()=>{const n=this.tensors.map(i=>O(i,e));return Ve(n,0)})}popBack(e,t){if(t!==this.elementDtype)throw new Error(`Invaliddatatypes;opelements${t},butlistelements${this.elementDtype}`);if(this.size()===0)throw new Error("Trying to pop from an empty list.");const s=this.tensors.pop();return Ps(s.shape,e,"TensorList shape mismatch: "),O(s,e)}pushBack(e){if(e.dtype!==this.elementDtype)throw new Error(`Invaliddatatypes;opelements${e.dtype},butlistelements${this.elementDtype}`);if(Ps(e.shape,this.elementShape,"TensorList shape mismatch: "),this.maxNumElements===this.size())throw new Error("Trying to push element into a full list.");pt(e),this.tensors.push(e)}resize(e){if(e<0)throw new Error(`TensorListResizeexpectssizetobenon-negative.Got:${e}`);if(this.maxNumElements!==-1&&e>this.maxNumElements)throw new Error(`TensorListResizeinputsize${e}isgreatermaxNumElement${this.maxNumElements}.`);this.tensors.length=e}getItem(e,t,s){if(s!==this.elementDtype)throw new Error(`Invaliddatatypes;opelements${s},butlistelements${this.elementDtype}`);if(e<0||e>this.tensors.length)throw new Error(`Tryingtoaccesselement${e}inalistwith${this.tensors.length}elements.`);if(this.tensors[e]==null)throw new Error(`elementatindex${e}isnull.`);return Ps(this.tensors[e].shape,t,"TensorList shape mismatch: "),this.tensors[e]}setItem(e,t){if(t.dtype!==this.elementDtype)throw new Error(`Invaliddatatypes;opelements${t.dtype},butlistelements${this.elementDtype}`);if(e<0||this.maxNumElements!==-1&&e>=this.maxNumElements)throw new Error(`Tryingtosetelement${e}inalistwithmax${this.maxNumElements}elements.`);Ps(this.elementShape,t.shape,"TensorList shape mismatch: "),pt(t),this.tensors[e]=t}gather(e,t,s){if(t!==this.elementDtype)throw new Error(`Invaliddatatypes;opelements${t},butlistelements${this.elementDtype}`);return Ps(this.elementShape,s,"TensorList shape mismatch: "),e=e.slice(0,this.size()),e.length===0?ze([],[0].concat(this.elementShape)):C(()=>{const n=e.map(i=>O(this.tensors[i],s));return Ve(n,0)})}concat(e,t){if(!!e&&e!==this.elementDtype)throw new Error(`TensorListdtypeis${this.elementDtype}butconcatrequesteddtype${e}`);return Ps(this.elementShape,t,"TensorList shape mismatch: "),this.size()===0?ze([],[0].concat(this.elementShape)):C(()=>{const s=this.tensors.map(n=>O(n,t));return be(s,0)})}}function oN(e,t,s){const n=e.dtype;if(e.shape.length<1)throw new Error(`Tensormustbeatleastavector,butsawshape:${e.shape}`);if(e.dtype!==s)throw new Error(`Invaliddatatypes;opelements${e.dtype},butlistelements${s}`);const i=e.shape.
${e}`);let n;return this.size===Infinity||this.size==null?n=this.size:t?n=Math.ceil(this.size/e):n=Math.floor(this.size/e),Cs(async()=>(await s.iterator()).columnMajorBatch(e,t,vB),n)}concatenate(e){const t=this;let s;return this.size===Infinity||e.size===Infinity?s=Infinity:this.size!=null&&e.size!=null?s=this.size+e.size:s=null,Cs(async()=>(await t.iterator()).concatenate(await e.iterator()),s)}filter(e){const t=this;let s;return this.size===Infinity?s=Infinity:s=null,Cs(async()=>(await t.iterator()).filter(n=>C(()=>e(n))),s)}async forEachAsync(e){return(await this.iterator()).forEachAsync(e)}map(e){const t=this;return Cs(async()=>(await t.iterator()).map(s=>C(()=>e(s))),this.size)}mapAsync(e){const t=this;return Cs(async()=>(await t.iterator()).mapAsync(e),this.size)}prefetch(e){if(e==null)throw new RangeError("`Dataset.prefetch()` requires bufferSize to be specified.");const t=this;return Cs(async()=>(await t.iterator()).prefetch(e),this.size)}repeat(e){const t=this;let s;return this.size!=null&&e>0?s=this.size*e:e===0?s=0:this.size!=null&&(e===void 0||e<0)?s=Infinity:s=null,Cs(async()=>{const n=hu(async()=>({value:await t.iterator(),done:!1}));return DN(n.take(e))},s)}skip(e){const t=this;let s;return this.size!=null&&e>=0&&this.size>=e?s=this.size-e:this.size!=null&&(this.size<e||e===void 0||e<0)?s=0:s=null,Cs(async()=>(await t.iterator()).skip(e),s)}shuffle(e,t,s=!0){if(e==null||e<0)throw this.size==null?new RangeError("`Dataset.shuffle()` requires bufferSize to be specified."):new RangeError(`\`Dataset.shuffle()\` requires bufferSize to be specified. If your data fits in main memory (for regular JS objects), and/or GPU memory (for \`tf.Tensor\`s), consider setting bufferSize to the dataset size (${this.size} elements)`);constn=this,i=$N.alea(t||N.now().toString());returnCs(async()=>{letr=i.int32();returns&&(r+=i.int32()),(awaitn.iterator()).shuffle(e,r.toString())},this.size)}take(e){constt=this;lets;returnthis.size!=null&&this.size>e?s=e:this.size!=null&&this.size<=e?s=this.size:s=null,Cs(async()=>(awaitt.iterator()).take(e),s)}asynctoArray(){if(this.size===Infinity)thrownewError("Can not convert infinite data stream to array.");return(awaitthis.iterator()).toArray()}asynctoArrayForTest(){if(this.size===Infinity)thrownewError("Can not convert infinite data stream to array.");return(awaitthis.iterator()).toArrayForTest()}}Hi.MAX_BUFFER_SIZE=1e4;functionCs(e,t=null){returnnewclassextendsHi{constructor(){super(...arguments);this.size=t}asynciterator(){returne()}}}functionWN(e){returnCs(async()=>lw(e),e.length)}functionzN(e){if(!oo(e))thrownewError("The argument to zip() must be an object or array.");lett;if(Array.isArray(e))for(lets=0;s<e.length;s++)t=t==null?e[s].size:Math.min(t,e[s].size);elseif(einstanceofObject)for(constsine)t=t==null?e[s].size:Math.min(t,e[s].size);returnCs(async()=>{consts=awaitJm(e,n=>{if(ninstanceofHi)return{value:n.iterator(),recurse:!1};if(oo(n))return{value:null,recurse:!0};thrownewError("Leaves of the structure passed to zip() must be Datasets, not primitives.")});returnFN(s,qi.SHORTEST)},t)}functionvB(e){if(e===null)returnnull;constt=e[0];if(ON(t)){consts=TB(e);return{value:s,recurse:!1}}return{value:null,recurse:!0}}functionTB(e){if(e.length===0)thrownewError("Can't make a batch of zero elements.");returne[0]instanceofme?Ve(e):ze(e)}classefextendsHi{constructor(e){super();this.input=e}asynciterator(){conste=awaitthis.input.iterator(),t=e.decodeUTF8(),s=t.split(`
`).map(n=>(n.endsWith("\r")&&(n=n.slice(0,-1)),n));return s}}const tf='"',mu=Symbol("out"),PN=Symbol("field"),sf=Symbol("quote"),cw=Symbol("quoteafterquote"),BN=Symbol("quoteinquote");class nf extends Hi{constructor(e,t){super();this.input=e,this.hasHeader=!0,this.fullColumnNames=null,this.columnNamesValidated=!1,this.columnConfigs=null,this.configuredColumnsOnly=!1,this.delimiter=",",this.delimWhitespace=!1,this.base=new ef(e),t||(t={}),this.hasHeader=!(t.hasHeader===!1),this.fullColumnNames=t.columnNames,this.columnConfigs=t.columnConfigs,this.configuredColumnsOnly=t.configuredColumnsOnly,t.delimWhitespace?(N.assert(t.delimiter==null,()=>"Delimiter should not be provided when delimWhitespace is true."),this.delimWhitespace=!0,this.delimiter=" "):this.delimiter=t.delimiter?t.delimiter:","}async columnNames(){return this.columnNamesValidated||await this.setColumnNames(),this.configuredColumnsOnly?Object.keys(this.columnConfigs):this.fullColumnNames}async setColumnNames(){const e=await this.maybeReadHeaderLine();if(!this.fullColumnNames&&!e)throw new Error("Column names must be provided if there is no header line.");this.fullColumnNames&&e&&N.assert(e.length===this.fullColumnNames.length,()=>"The length of provided columnNames ("+this.fullColumnNames.length.toString()+") does not match the length of the header line read from file ("+e.length.toString()+")."),this.fullColumnNames||(this.fullColumnNames=e);const t=this.fullColumnNames.reduce((n,i)=>(n[i]=n[i]+1||1,n),{}),s=Object.keys(t).filter(n=>t[n]>1);if(N.assert(s.length===0,()=>"Duplicate column names found: "+s.toString()),this.columnConfigs)for(const n of Object.keys(this.columnConfigs)){const i=this.fullColumnNames.indexOf(n);if(i===-1)throw new Error('The key "'+n+'" provided in columnConfigs does not match any of the column names ('+this.fullColumnNames.toString()+").")}this.columnNamesValidated=!0}async maybeReadHeaderLine(){if(this.hasHeader){const e=await this.base.iterator(),t=await e.next();if(t.done)throw new Error("No data was found for CSV parsing.");const s=t.value,n=this.parseRow(s,!1);return n}else return null}async iterator(){this.columnNamesValidated||await this.setColumnNames();let e=await this.base.iterator();return this.hasHeader&&(e=e.skip(1)),e.map(t=>this.makeDataElement(t))}makeDataElement(e){const t=this.parseRow(e),s={},n={};for(let i=0;i<this.fullColumnNames.length;i++){const r=this.fullColumnNames[i],o=this.columnConfigs?this.columnConfigs[r]:null;if(this.configuredColumnsOnly&&!o)continue;{const a=t[i];let l=null;if(a==="")if(o&&o.default!==void 0)l=o.default;else{if(o&&(o.required||o.isLabel))throw new Error(`Requiredcolumn${r}isemptyinthisline:${e}`);l=void 0}else{const c=Number(a);if(isNaN(c))o&&o.dtype==="bool"?l=this.getBoolean(a):l=a;else if(!o||!o.dtype)l=c;else switch(o.dtype){case"float32":l=c;break;case"int32":l=Math.floor(c);break;case"bool":l=this.getBoolean(a);break;default:l=c}}o&&o.isLabel?n[r]=l:s[r]=l}}return Object.keys(n).length===0?s:{xs:s,ys:n}}getBoolean(e){return e==="1"||e.toLowerCase()==="true"?1:0}parseRow(e,t=!0){const s=[];let n=0;const i=e.length;let r=mu;for(let o=0;o<i;o++)switch(r){case mu:switch(e.charAt(o)){case tf:n=o+1,r=sf;break;case this.delimiter:if(n=o+1,this.delimiter===" "&&this.delimWhitespace)break;s.push(""),r=mu;break;default:r=PN,n=o;break}break;case PN:switch(e.charAt(o)){case this.delimiter:s.push(e.substring(n,o)),r=mu,n=o+1;break;default:}break;case sf:switch(e.charAt(o)){case tf:r=cw;break;default:}break;case cw:switch(e.charAt(o)){case this.delimiter:s.push(e.substring(n,o-1)),r=mu,n=o+1;break;case tf:r=sf;break;default:r=BN;break}break;case BN:switch(e.charAt(o)){case tf:r=sf;break;default:}break;default:}if(r===cw?s.push(e.substring(n,i-1)):s.push(e.substring(n)),t&&s.length!==this.fullColumnNames.length)throw new Error(`Invalidrowincsvfile.Shouldhave${this.fullColumnNames.length}elementsinarow,butgot${s}`);return s}}class pw extends At{constructor(e){super();this.microphoneConfig=e,this.isClosed=!1,this.fftSize=e.fftSize||1024;const t=Math.log2(this.fftSize);if
============================
Hithere👋.LookslikeyouarerunningTensorFlow.jsinNode.js.Tospeedthingsupdramatically,installournodebackend,whichbindstoTensorFlowC++,byrunningnpmi@tensorflow/tfjs-node,ornpmi@tensorflow/tfjs-node-gpuifyouhaveCUDA.Thencallrequire('@tensorflow/tfjs-node');(-gpusuffixforCUDA)atthestartofyourprogram.Visithttps://github.com/tensorflow/tfjs-node for more details.
============================`));const n={};return this.data.set(n,{values:e,dtype:s,refCount:1}),n}makeTensorInfo(e,t,s){const n=this.write(s,e,t);return{dataId:n,shape:e,dtype:t}}incRef(e){const t=this.data.get(e);t.refCount++}decRef(e){if(this.data.has(e)){const t=this.data.get(e);t.refCount--}}move(e,t,s,n){this.data.set(e,{values:t,dtype:n,refCount:1})}numDataIds(){return this.data.numDataIds()}async read(e){return this.readSync(e)}readSync(e){const{dtype:t,complexTensorInfos:s}=this.data.get(e);if(t==="complex64"){const n=this.readSync(s.real.dataId),i=this.readSync(s.imag.dataId);return U.mergeRealAndImagArrays(n,i)}return this.data.get(e).values}bufferSync(e){const t=this.readSync(e.dataId);let s=t;if(e.dtype==="string")try{s=t.map(n=>N.decodeString(n))}catch(n){throw new Error("Failed to decode encoded string bytes into utf-8")}return ge(e.shape,e.dtype,s)}makeOutput(e,t,s){const n=this.write(e,t,s);return Ms().makeTensorFromDataId(n,t,s,this)}disposeData(e){if(this.data.has(e)){const{complexTensorInfos:t}=this.data.get(e);t!=null&&(this.disposeData(t.real.dataId),this.disposeData(t.imag.dataId)),this.data.delete(e)}}disposeIntermediateTensorInfo(e){const t=e.dataId;if(this.data.has(t)){const s=this.data.get(t);s.refCount--,s.refCount<1&&this.disposeData(t)}}async time(e){const t=N.now();e();const s=N.now()-t;return{kernelMs:s}}memory(){return{unreliable:!0,reasons:["The reported memory is an upper bound. Due to automatic garbage collection, the true allocated memory may be less."]}}stridedSlice(e,t,s,n){ee(e,"stridedSlice");const i=Fs.computeOutShape(t,s,n);if(i.some(a=>a===0))return ze([],i);const r=ge(i,e.dtype),o=this.bufferSync(e);for(let a=0;a<r.size;a++){const l=r.indexToLoc(a),c=new Array(l.length);for(let p=0;p<c.length;p++)c[p]=l[p]*n[p]+t[p];r.set(o.get(...c),...l)}return r.toTensor()}diag(e){const t=this.readSync(e.dataId),s=ge([e.size,e.size],e.dtype),n=s.values;for(let i=0;i<t.length;i++)n[i*e.size+i]=t[i];return s.toTensor()}unstack(e,t){const s=e.shape[t],n=new Array(e.rank-1);let i=0;for(let l=0;l<e.rank;l++)l!==t&&(n[i++]=e.shape[l]);const r=new Array(e.rank).fill(0),o=e.shape.slice();o[t]=1;const a=new Array(s);for(let l=0;l<a.length;l++)r[t]=l,a[l]=he(e,r,o).reshape(n);return a}reverse(e,t){ee(e,"reverse");const s=ge(e.shape,e.dtype),n=this.bufferSync(e);for(let i=0;i<s.size;i++){const r=s.indexToLoc(i),o=r.slice();t.forEach(a=>o[a]=e.shape[a]-1-o[a]),s.set(n.get(...o),...r)}return s.toTensor()}neg(e){return ee(e,"neg"),R(j(-1),e)}addN(e){ee(e,"addN");const t=e.map(i=>this.readSync(i.dataId)),s=ge(e[0].shape,e[0].dtype),n=s.values;for(let i=0;i<e.length;i++){const r=t[i];for(let o=0;o<n.length;o++)n[o]+=r[o]}return s.toTensor()}softmax(e,t){const s=N.parseAxisParam([t],e.shape),n=xt(e,s),i=U.expandShapeToKeepDim(n.shape,s),r=X(e,n.reshape(i)),o=ut(r),a=this.sum(o,s).reshape(i);return Z(o,a)}pow(e,t){return ee([e,t],"pow"),this.broadcastedBinaryOp(e,t,e.dtype,(s,n)=>Math.pow(s,n))}batchMatMul(e,t,s,n){ee([e,t],"matMul");const i=s?e.shape[1]:e.shape[2],r=s?e.shape[2]:e.shape[1],o=n?t.shape[1]:t.shape[2],a=e.shape[0],l=this.readSync(e.dataId),c=this.readSync(t.dataId),[p,u,h]=s?[e.strides[0],1,e.strides[1]]:[e.strides[0],e.strides[1],1],[d,m,f]=n?[1,t.strides[1],t.strides[0]]:[t.strides[1],1,t.strides[0]],g=r*o,y=ge([a,r,o],e.dtype),w=y.values,x=this.blockSize;for(let T=0;T<a;T++)for(let A=0;A<r;A+=x)for(let _=0;_<o;_+=x)for(let E=0;E<i;E+=x){const F=Math.min(A+x,r),D=Math.min(_+x,o),M=Math.min(E+x,i);for(let P=A;P<F;P++)for(let B=_;B<D;B++){let Y=0;for(let q=E;q<M;q++)Y+=l[T*p+P*u+q*h]*c[q*d+B*m+T*f];w[T*g+(P*o+B)]+=Y}}return y.toTensor()}fusedBatchMatMul({a:e,b:t,transposeA:s,transposeB:n,bias:i,activation:r,preluActivationWeights:o}){let a=this.batchMatMul(e,t,s,n);return i&&(a=$(a,i)),r&&(a=mw(this,a,r,o)),a}floorDiv(e,t){ee([e,t],"floorDiv");const s=(i,r)=>Math.floor(i/r),n="int32";return this.broadcastedBinaryOp(e,t,n,s)}sum(e,t){ee(e,"sum"),U.assertAxesAreInnerMostDims("sum",t,e.rank);const[s,n]=U.computeOutAndReduceShapes(e.shape,t),i=Ft(e.dtype,"int32"),r=ye(s,i),o=N.sizeFromShape(n),a=
returnmod(a,b);`,wR="return (b >= 1.0) ? a : a * (b + 1.0);",qw="return (a < 0.) ? b * a : a;";class kt{constructor(e,t,s){this.variableNames=["A","B"],this.outputShape=U.assertAndGetBroadcastShape(t,s),this.userCode=`
`}}class Ki{constructor(e,t,s,n=!1,i=!1){if(this.variableNames=["x"],t==="avg"&&s)throw new Error("Cannot compute positions for average pool.");const r=e.filterWidth,o=e.strideHeight,a=e.strideWidth,l=e.dilationHeight,c=e.dilationWidth,p=e.effectiveFilterHeight,u=e.effectiveFilterWidth,h=e.padInfo.top,d=e.padInfo.left;this.outputShape=e.outShape;const m=t==="avg",f=`((batch*${e.inHeight}+xR)*${e.inWidth}+xC)*${e.inChannels}+d`,g=`(xR*${e.inWidth}+xC)*${e.inChannels}+d`;let y="0.0";if(m||(y="-1.0 / 1e-20"),s){const E=">=";this.userCode=`
constivec2strides=ivec2(${o},${a});
constivec2pads=ivec2(${h},${d});
voidmain(){
ivec4coords=getOutputCoords();
intbatch=coords[0];
intd=coords[3];
ivec2xRCCorner=coords.yz*strides-pads;
intxRCorner=xRCCorner.x;
intxCCorner=xRCCorner.y;
// max/min x(?, ?, d) to get y(yR, yC, d).
// ? = to be determined
floatminMaxValue=0.0;
floatminMaxValueFound=0.0;
intminMaxPosition=0;
floatavgValue=0.0;
for(intwR=0;wR<${p};
wR+=${l}){
intxR=xRCorner+wR;
if(xR<0||xR>=${e.inHeight}){
continue;
}
for(intwC=0;wC<${u};
wC+=${c}){
intxC=xCCorner+wC;
if(xC<0||xC>=${e.inWidth}){
continue;
}
floatvalue=getX(batch,xR,xC,d);
// If a min / max value has already been found, use it. If not,
`}}class Cf{constructor(e,t,s,n=!1,i=!1){if(this.variableNames=["x"],t==="avg"&&s)throw new Error("Cannot compute positions for average pool.");const r=e.filterWidth,o=e.strideDepth,a=e.strideHeight,l=e.strideWidth,c=e.dilationDepth,p=e.dilationHeight,u=e.dilationWidth,h=e.effectiveFilterDepth,d=e.effectiveFilterHeight,m=e.effectiveFilterWidth,f=e.padInfo.front,g=e.padInfo.top,y=e.padInfo.left;this.outputShape=e.outShape;const w=t==="avg";let x="0.0";if(w||(x="-1.0 / 1e-20"),s){const D=">=";this.userCode=`
`}}class B2{constructor(e,t){this.variableNames=["x"];const s=e.length;if(s>4)throw new Error(`WebGLbackend:Reverseofrank-${s}tensorisnotyetsupported`);if(this.outputShape=e,s===1){this.userCode=`
`}}class Z2{constructor(e){this.gpgpu=e,this.numUsedTextures=0,this.numFreeTextures=0,this._numBytesAllocated=0,this._numBytesFree=0,this.freeTextures={},this.logEnabled=!1,this.usedTextures={}}acquireTexture(e,t,s){const n=X2(t,s),i=J2(e,n,s);i in this.freeTextures||(this.freeTextures[i]=[]),i in this.usedTextures||(this.usedTextures[i]=[]);const r=K2(e,n,this.gpgpu.gl,this.gpgpu.textureConfig,s);if(this.freeTextures[i].length>0){this.numFreeTextures--,this.numUsedTextures++,this._numBytesFree-=r,this.log();const a=this.freeTextures[i].shift();return this.usedTextures[i].push(a),a}let o;return n===Xt.PACKED_2X2_FLOAT32?o=this.gpgpu.createPackedMatrixTexture(e[0],e[1]):n===Xt.PACKED_2X2_FLOAT16?o=this.gpgpu.createFloat16PackedMatrixTexture(e[0],e[1]):n===Xt.UNPACKED_FLOAT32?o=this.gpgpu.createFloat32MatrixTexture(e[0],e[1]):n===Xt.UNPACKED_FLOAT16?o=this.gpgpu.createFloat16MatrixTexture(e[0],e[1]):n===Xt.PACKED_4X1_UNSIGNED_BYTE&&(o=this.gpgpu.createUnsignedBytesMatrixTexture(e[0],e[1])),this.usedTextures[i].push(o),this.numUsedTextures++,this._numBytesAllocated+=r,this.log(),o}releaseTexture(e,t,s,n){if(this.freeTextures==null)return;const i=X2(s,n),r=J2(t,i,n);r in this.freeTextures||(this.freeTextures[r]=[]);const o=K2(t,i,this.gpgpu.gl,this.gpgpu.textureConfig,n),a=W().get("WEBGL_DELETE_TEXTURE_THRESHOLD");a!==-1&&this._numBytesAllocated>a?(this.gpgpu.deleteMatrixTexture(e),this._numBytesAllocated-=o):(this.freeTextures[r].push(e),this.numFreeTextures++,this._numBytesFree+=o),this.numUsedTextures--;const l=this.usedTextures[r],c=l.indexOf(e);if(c<0)throw new Error("Cannot release a texture that was never provided by this texture manager");l.splice(c,1),this.log()}log(){if(!this.logEnabled)return;const e=this.numFreeTextures+this.numUsedTextures;console.log("Free/Used",`${this.numFreeTextures}/${this.numUsedTextures}`,`(${e})`);const t=this._numBytesFree/this._numBytesAllocated;console.log(`Bytesallocated:${this._numBytesAllocated}`),console.log(`Bytesunused:${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)return;for(const e in this.freeTextures)this.freeTextures[e].forEach(t=>{this.gpgpu.deleteMatrixTexture(t)});for(const e in this.usedTextures)this.usedTextures[e].forEach(t=>{this.gpgpu.deleteMatrixTexture(t)});this.freeTextures=null,this.usedTextures=null,this.numUsedTextures=0,this.numFreeTextures=0,this._numBytesAllocated=0,this._numBytesFree=0}}function Z3(e,t){const s=e;if(t===s.R32F)return 4;if(t===s.R16F)return 2;if(t===s.RGBA32F)return 16;if(t===e.RGBA)return 16;if(t===s.RGBA16F)return 8;throw new Error(`Unknowninternalformat${t}`)}function K2(e,t,s,n,i){const r=Q3(t,n);let o;if(i){const[l,c]=gi(e[0],e[1]);o=l*c}else{const[l,c]=pa(e[0],e[1]);o=l*c}const a=Z3(s,r);return o*a}function Q3(e,t){switch(e){case Xt.PACKED_2X2_FLOAT32:return nx(t);case Xt.PACKED_2X2_FLOAT16:return ix(t);case Xt.UNPACKED_FLOAT32:return ex(t);case Xt.UNPACKED_FLOAT16:return tx(t);case Xt.PACKED_4X1_UNSIGNED_BYTE:return sx(t);default:throw new Error(`Unknownphysicaltexturetype${e}`)}}function eV(e){return W().getBool("WEBGL_RENDER_FLOAT32_ENABLED")?e?Xt.PACKED_2X2_FLOAT32:Xt.UNPACKED_FLOAT32:e?Xt.PACKED_2X2_FLOAT16:Xt.UNPACKED_FLOAT16}function X2(e,t){if(e===ns.UPLOAD)return Xt.PACKED_2X2_FLOAT32;if(e===ns.RENDER||e==null)return eV(t);if(e===ns.DOWNLOAD||e===ns.PIXELS)return Xt.PACKED_4X1_UNSIGNED_BYTE;throw new Error(`Unknownlogicaltexturetype${e}`)}function J2(e,t,s){return`${e[0]}_${e[1]}_${t}_${s}`}class Q2{constructor(e,t){this.variableNames=["A"];const s=new Array(e.length);for(let r=0;r<s.length;r++)s[r]=e[r]*t[r];this.outputShape=s,this.rank=s.length;const n=Re(this.rank),i=tV(e);this.userCode=`
`}}const{segment_util:OO}=U,sV=vt.split,nV=vt.tile,iV=vt.topkImpl,rV=vt.whereImpl,oV=1e-7,aV=1e-4,Ef={};function lV(e){return e in Ef||(Ef[e]={}),Ef[e]}function _f(e,t=!1){if(e==="linear")return t?NO:eO;if(e==="relu")return t?yx:cx;if(e==="elu")return t?wx:ux;if(e==="relu6")return t?bx:px;if(e==="prelu")return t?Hw:qw;throw new Error(`Activation${e}hasnotbeenimplementedfortheWebGLbackend.`)}const cV=128,pV=600;function uV(){return W().global.screen==null?1024:W().global.screen.height*W().global.screen.width*window.devicePixelRatio*pV/1024/1024}const EO=1e3;class xx extends go{constructor(e){super();if(this.pendingRead=new WeakMap,this.pendingDisposal=new WeakSet,this.dataRefCount=new WeakMap,this.numBytesInGPU=0,this.uploadWaitMs=0,this.downloadWaitMs=0,this.warnedAboutMemory=!1,this.warnedAboutCPUBackend=!1,this.pendingDeletes=0,this.disposed=!1,!W().getBool("HAS_WEBGL"))throw new Error("WebGL is not supported on this device");if(e==null){const t=nn(W().getNumber("WEBGL_VERSION"));this.binaryCache=lV(W().getNumber("WEBGL_VERSION")),this.gpgpu=new rx(t),this.canvas=t.canvas,this.gpgpuCreatedLocally=!0}else this.gpgpu=e,this.binaryCache={},this.gpgpuCreatedLocally=!1,this.canvas=e.gl.canvas;this.textureManager=new Z2(this.gpgpu),this.numMBBeforeWarning=uV(),this.texData=new gc(this,Ms())}numDataIds(){return this.texData.numDataIds()+(this.cpuBackend?this.cpuBackend.numDataIds():0)-this.pendingDeletes}write(e,t,s){if((W().getBool("WEBGL_CHECK_NUMERICAL_PROBLEMS")||W().getBool("DEBUG"))&&this.checkNumericalProblems(e),s==="complex64"&&e!=null)throw new Error("Cannot write to a complex64 dtype. Please use tf.complex(real, imag).");const n={};return this.texData.set(n,{shape:t,dtype:s,values:e,usage:ns.UPLOAD,refCount:1}),n}incRef(e){const t=this.texData.get(e);t.refCount++}decRef(e){if(this.texData.has(e)){const t=this.texData.get(e);t.refCount--}}move(e,t,s,n){if(W().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:s,dtype:n,values:t,usage:ns.UPLOAD,refCount:1})}disposeIntermediateTensorInfo(e){const t=e.dataId;if(this.texData.has(t)){const s=this.texData.get(t);s.refCount--,s.refCount<1&&this.disposeData(t)}}readSync(e){const t=this.texData.get(e),{values:s,dtype:n,complexTensors:i,slice:r,shape:o,isPacked:a}=t;if(r!=null){let u;a?u=new ql(o,xu):u=new $e(o,xu);const h=this.runWebGLProgram(u,[{dataId:e,shape:o,dtype:n}],n),d=this.readSync(h.dataId);return this.disposeIntermediateTensorInfo(h),d}if(s!=null)return this.convertAndCacheOnCPU(e);if(n==="string")return s;const l=this.activeTimers!=null;let c;l&&(c=N.now());let p;if(n==="complex64"){const u=i.real.dataSync(),h=i.imag.dataSync();p=U.mergeRealAndImagArrays(u,h)}else p=this.getValuesFromTexture(e);return l&&(this.downloadWaitMs+=N.now()-c),this.convertAndCacheOnCPU(e,p)}async read(e){if(this.pendingRead.has(e)){const d=this.pendingRead.get(e);return new Promise(m=>d.push(m))}const t=this.texData.get(e),{values:s,shape:n,slice:i,dtype:r,complexTensors:o,isPacked:a}=t;if(i!=null){let d;a?d=new ql(n,xu):d=new $e(n,xu);const m=this.runWebGLProgram(d,[{dataId:e,shape:n,dtype:r}],r),f=this.read(m.dataId);return this.disposeIntermediateTensorInfo(m),f}if(s!=null)return this.convertAndCacheOnCPU(e);if(!W().getBool("WEBGL_DOWNLOAD_FLOAT_ENABLED")&&W().getNumber("WEBGL_VERSION")===2)throw new Error("tensor.data() with WEBGL_DOWNLOAD_FLOAT_ENABLED=false and WEBGL_VERSION=2 not yet supported.");let l=null,c;if(r!=="complex64"&&W().get("WEBGL_BUFFER_SUPPORTED")){c=this.decode(e);const d=this.texData.get(c.dataId);l=this.gpgpu.createBufferFromTexture(d.texture,...co(n))}this.pendingRead.set(e,[]),r!=="complex64"&&await this.gpgpu.createAndWaitForFence();let p;if(r==="complex64"){const d=await Promise.all([o.real.data(),o.imag.data()]),m=d[0],f=d[1];p=U.mergeRealAndImagArrays(m,f)}else if(l==null)p=this.getValuesFromTexture(e);else{const d=N.sizeFromShape(n);p=this.gpgpu.downloadFloat32MatrixFromBuffer(l,d)}c!=null&&this.disposeIntermediat
`}}const bV=({inputs:e,backend:t,attrs:s})=>{const{x:n,mean:i,variance:r,offset:o,scale:a}=e;N.assert(i.shape.length===r.shape.length,()=>"Batch normalization gradient requires mean and variance to have equal ranks."),N.assert(o==null||i.shape.length===o.shape.length,()=>"Batch normalization gradient requires mean and offset to have equal ranks."),N.assert(a==null||i.shape.length===a.shape.length,()=>"Batch normalization gradient requires mean and scale to have equal ranks.");let{varianceEpsilon:l}=s;l==null&&(l=.001);const c=[n,i,r];let p=null;o!=null&&(p=o.shape,c.push(o));let u=null;a!=null&&(u=a.shape,c.push(a));const h=W().getBool("WEBGL_PACK_NORMALIZATION")?new zO(n.shape,i.shape,r.shape,p,u,l):new WO(n.shape,i.shape,r.shape,p,u,l),d=t.runWebGLProgram(h,c,c[0].dtype);return d},PO={kernelName:vi,backendName:"webgl",kernelFunc:bV};const wV=kf+`
`,_V=ho(EV),u1={kernelName:Zn,backendName:"webgl",kernelFunc:_V};const kV="return x * x;",DV=ho(kV),h1={kernelName:Oo,backendName:"webgl",kernelFunc:DV};const d1="return (a - b) * (a - b);",FV=Hl(d1,d1),m1={kernelName:Qn,backendName:"webgl",kernelFunc:FV};const MV="return tan(x);",UV=ho(MV),f1={kernelName:ei,backendName:"webgl",kernelFunc:UV};const g1={kernelName:Ri,backendName:"webgl",kernelFunc:({inputs:e,attrs:t,backend:s})=>{const{x:n}=e,{perm:i}=t,r=s,o=n.shape.length,a=new Array(o);for(let c=0;c<a.length;c++)a[c]=n.shape[i[c]];let l;if(r.shouldExecuteOnCPU([n])){const c=r.texData.get(n.dataId),p=c.values,u=Lf(p,n.shape,n.dtype,i,a);l=r.makeTensorInfo(a,n.dtype);const h=r.texData.get(l.dataId);h.values=u}else l=Ff(n,i,r);return l}};function $V(e){const{inputs:t,attrs:s,backend:n}=e,{axis:i}=s,{x:r}=t;yi(r,"unique"),console.warn("WARNING: ","UI might be locked temporarily as data is being downloaded");const o=n.readSync(r.dataId),{outputValues:a,outputShape:l,indices:c}=H0(o,i,r.shape,r.dtype);return[n.makeTensorInfo(l,r.dtype,a),n.makeTensorInfo([c.length],"int32",c)]}const y1={kernelName:Eo,backendName:"webgl",kernelFunc:$V};const WV=[FO,UO,$O,PO,BO,jO,GO,YO,MO,t1,s1,n1,r1,o1,a1,l1,JO,p1,u1,h1,m1,f1,g1,y1];for(const e of WV)Ma(e);const b1="2.6.0";const Sx={};Ee(Sx,{Abs:()=>yo,Acos:()=>nr,Acosh:()=>ir,AdadeltaOptimizer:()=>Yo,AdagradOptimizer:()=>Ko,AdamOptimizer:()=>Xo,AdamaxOptimizer:()=>Jo,Add:()=>Kn,AddN:()=>yc,All:()=>xg,Any:()=>Lg,ArgMax:()=>bc,ArgMin:()=>wc,Asin:()=>rr,Asinh:()=>or,Atan:()=>ar,Atan2:()=>bo,Atanh:()=>lr,AvgPool:()=>Si,AvgPool3D:()=>xc,AvgPool3DBackprop:()=>Sg,AvgPoolBackprop:()=>wo,BatchMatMul:()=>Lc,BatchToSpaceND:()=>Sc,BroadcastTo:()=>Ic,Callback:()=>Db,CallbackList:()=>hb,Cast:()=>Ii,Ceil:()=>cr,ClipByValue:()=>pr,Complex:()=>vc,Concat:()=>xo,Conv2D:()=>Tc,Conv2DBackpropFilter:()=>Ig,Conv2DBackpropInput:()=>Ac,Conv3D:()=>Nc,Conv3DBackpropFilterV2:()=>vg,Conv3DBackpropInputV2:()=>Tg,Cos:()=>Xn,Cosh:()=>ur,CropAndResize:()=>Ag,Cumsum:()=>Cc,CustomCallback:()=>mb,DataStorage:()=>gc,DepthToSpace:()=>Ng,DepthwiseConv2dNative:()=>Rc,DepthwiseConv2dNativeBackpropFilter:()=>Cg,DepthwiseConv2dNativeBackpropInput:()=>Rg,Diag:()=>Og,Dilation2D:()=>Lo,Dilation2DBackpropFilter:()=>Ea,Dilation2DBackpropInput:()=>Oa,Div:()=>Jn,ENV:()=>gg,EarlyStopping:()=>Fb,Elu:()=>hr,EluGrad:()=>Eg,Environment:()=>fg,Equal:()=>_g,Erf:()=>dr,Exp:()=>mr,Expm1:()=>fr,FFT:()=>Oc,Fill:()=>kg,FlipLeftRight:()=>So,Floor:()=>gr,FloorDiv:()=>Ec,FromPixels:()=>Da,FusedBatchNorm:()=>vi,FusedConv2D:()=>ju,FusedDepthwiseConv2D:()=>Vu,GatherNd:()=>Dg,GatherV2:()=>_c,GraphModel:()=>ow,Greater:()=>Fg,GreaterEqual:()=>kc,History:()=>db,IFFT:()=>Dc,Identity:()=>Ti,Imag:()=>Fc,InputSpec:()=>st,IsFinite:()=>yr,IsInf:()=>br,IsNan:()=>wr,KernelBackend:()=>go,LRN:()=>Uc,LRNBackprop:()=>Pg,LayerVariable:()=>xd,LayersModel:()=>tn,Less:()=>Mg,LessEqual:()=>Ug,LinSpace:()=>$g,Log:()=>xr,Log1p:()=>Lr,LogSoftmax:()=>Mc,LogicalAnd:()=>Wg,LogicalNot:()=>_a,LogicalOr:()=>zg,Max:()=>Ai,MaxPool:()=>Ni,MaxPool3D:()=>Wc,MaxPool3DBackprop:()=>Bg,MaxPoolBackprop:()=>Io,MaxPoolWithArgmax:()=>vo,Maximum:()=>$c,Mean:()=>EE,Min:()=>zc,Minimum:()=>Pc,Mod:()=>Bc,MomentumOptimizer:()=>Zo,Multiply:()=>Sr,Negate:()=>jc,NonMaxSuppressionV3:()=>Vc,NonMaxSuppressionV4:()=>To,NonMaxSuppressionV5:()=>Ao,NotEqual:()=>ka,OP_SCOPE_SUFFIX:()=>fy,OneHot:()=>qc,OnesLike:()=>Gc,Optimizer:()=>fs,PadV2:()=>No,Pool:()=>_E,Pow:()=>Hc,Prelu:()=>Yc,Prod:()=>jg,RMSPropOptimizer:()=>Qo,RNN:()=>sn,Range:()=>Vg,Rank:()=>ay,Real:()=>Kc,Reciprocal:()=>Ir,Reduction:()=>ft,Relu:()=>Xc,Relu6:()=>Qc,Reshape:()=>Ci,ResizeBilinear:()=>Zc,ResizeBilinearGrad:()=>qg,ResizeNearestNeighbor:()=>Jc,ResizeNearestNeighborGrad:()=>Gg,Reverse:()=>ep,RotateWithOffset:()=>_o,Round:()=>vr,Rsqrt:()=>Tr,SGDOptimizer:()=>Ui,ScatterNd:()=>Hg,SelectV2:()=>tp,Selu:()=>Ar,Sequential:()=>no,Sigmoid:()=>Rr,Sign:()=>Cr,Sin:()=>Zn,Sinh:()=>Nr,Slice:()=>Co,Softmax:()=>ip,Softplus:()=>Or,SpaceToBatchND:()=>Ro,SparseToDense:()=>Yg,SplitV:()=>np,Sqrt:()=>Er,Square:()=>Oo,SquaredDifference:()=>Qn,Step:()=>Dr,StridedSlice:(