diff --git a/docs/compiled/artplayer-plugin-danmuku-mask.js b/docs/compiled/artplayer-plugin-danmuku-mask.js new file mode 100644 index 000000000..6c2bef935 --- /dev/null +++ b/docs/compiled/artplayer-plugin-danmuku-mask.js @@ -0,0 +1,8 @@ + +/*! + * artplayer-plugin-danmuku-mask.js v1.0.0 + * Github: https://github.com/zhw2590582/ArtPlayer + * (c) 2017-2024 Harvey Zack + * Released under the MIT License. + */ +!function(e,t,r,n,s){var a="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:"undefined"!=typeof window?window:"undefined"!=typeof global?global:{},o="function"==typeof a[n]&&a[n],l=o.cache||{},i="undefined"!=typeof module&&"function"==typeof module.require&&module.require.bind(module);function u(t,r){if(!l[t]){if(!e[t]){var s="function"==typeof a[n]&&a[n];if(!r&&s)return s(t,!0);if(o)return o(t,!0);if(i&&"string"==typeof t)return i(t);var p=Error("Cannot find module '"+t+"'");throw p.code="MODULE_NOT_FOUND",p}d.resolve=function(r){var n=e[t][1][r];return null!=n?n:r},d.cache={};var c=l[t]=new u.Module(t);e[t][0].call(c.exports,d,c,c.exports,this)}return l[t].exports;function d(e){var t=d.resolve(e);return!1===t?{}:u(t)}}u.isParcelRequire=!0,u.Module=function(e){this.id=e,this.bundle=u,this.exports={}},u.modules=e,u.cache=l,u.parent=o,u.register=function(t,r){e[t]=[function(e,t){t.exports=r},{}]},Object.defineProperty(u,"root",{get:function(){return a[n]}}),a[n]=u;for(var p=0;po);var s=e("@tensorflow/tfjs-core");e("@tensorflow/tfjs-backend-webgl"),e("@tensorflow/tfjs-backend-cpu");var a=e("@tensorflow-models/body-segmentation");function o(e={}){return t=>{let{template:{$player:r,$video:n,$danmuku:o}}=t,l=null,i=null,u=null,p=null,c=!1,d={solutionPath:e.solutionPath||"https://cdn.jsdelivr.net/npm/@mediapipe/selfie_segmentation",modelSelection:e.modelSelection||1,smoothSegmentation:void 0===e.smoothSegmentation||e.smoothSegmentation,minDetectionConfidence:e.minDetectionConfidence||.5,minTrackingConfidence:e.minTrackingConfidence||.5,selfieMode:e.selfieMode||!1,drawContour:e.drawContour||!1,foregroundThreshold:e.foregroundThreshold||.5,opacity:e.opacity||1,maskBlurAmount:e.maskBlurAmount||3};async function f(){try{await s.setBackend("webgl"),console.log("Using WebGL backend")}catch(e){console.warn("WebGL backend not available, falling back to CPU"),await s.setBackend("cpu")}}async function h(){await f();let e=a.SupportedModels.MediaPipeSelfieSegmentation,t={runtime:"mediapipe",modelType:"general",solutionPath:d.solutionPath,modelSelection:d.modelSelection,smoothSegmentation:d.smoothSegmentation,minDetectionConfidence:d.minDetectionConfidence,minTrackingConfidence:d.minTrackingConfidence,selfieMode:d.selfieMode};try{l=await a.createSegmenter(e,t),c=!0,console.log("Segmenter initialized successfully")}catch(e){console.error("Error initializing segmenter:",e),c=!1}}async function m(){if(!c||n.paused||n.ended){p=requestAnimationFrame(m);return}try{i.width=n.videoWidth,i.height=n.videoHeight;let e=await l.segmentPeople(n);if(!e||0===e.length){p=requestAnimationFrame(m);return}let t=await a.toBinaryMask(e,{r:255,g:255,b:255,a:255},{r:0,g:0,b:0,a:255},d.drawContour,d.foregroundThreshold);await a.drawMask(i,n,t,d.opacity,d.maskBlurAmount);let r=u.getImageData(0,0,i.width,i.height);u.putImageData(function(e){let t=e.data;for(let e=0;e250&&t[e+1]>250&&t[e+2]>250&&(t[e+3]=0);return e}(r),0,0),o.style.maskImage=`url(${i.toDataURL()})`}catch(e){console.error("Error in segmentBody:",e)}p=requestAnimationFrame(m)}async function g(){c||await h(),i||(u=(i=document.createElement("canvas")).getContext("2d"),Object.assign(i.style,{position:"absolute",top:"0",left:"0",width:"100%",height:"100%",pointerEvents:"none",opacity:"0"}),r.appendChild(i)),Object.assign(o.style,{maskMode:"alpha",maskSize:"contain",maskRepeat:"no-repeat",backgroundSize:"contain",backgroundRepeat:"no-repeat"}),m()}function x(){o.style.maskImage="none",p&&(cancelAnimationFrame(p),p=null)}return t.on("ready",g),t.on("destroy",x),{name:"artplayerPluginDanmukuMask",start:g,stop:x}}}"undefined"!=typeof window&&(window.artplayerPluginDanmukuMask=o)},{"@tensorflow/tfjs-core":"2nuhV","@tensorflow/tfjs-backend-webgl":"2cOos","@tensorflow/tfjs-backend-cpu":"61SaF","@tensorflow-models/body-segmentation":"79Ppz","@parcel/transformer-js/src/esmodule-helpers.js":"9pCYc"}],"2nuhV":[function(e,t,r){/** * @license * Copyright 2017 Google LLC. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. * ============================================================================= */var n=e("@parcel/transformer-js/src/esmodule-helpers.js");n.defineInteropFlag(r),e("./base_side_effects");var s=e("./optimizers/register_optimizers"),a=e("./base");n.exportAll(a,r),(0,s.registerOptimizers)()},{"./base_side_effects":"aVu87","./optimizers/register_optimizers":"k0GPL","./base":"gbLpv","@parcel/transformer-js/src/esmodule-helpers.js":"9pCYc"}],aVu87:[function(e,t,r){/** * @license * Copyright 2020 Google Inc. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. * ============================================================================= */var n=e("./engine");e("./flags"),e("./platforms/platform_browser"),e("./platforms/platform_node");var s=e("./ops/buffer"),a=e("./ops/cast"),o=e("./ops/clone"),l=e("./ops/print"),i=e("./tensor");(0,n.getOrMakeEngine)();let u={buffer:s.buffer,cast:a.cast,clone:o.clone,print:l.print};(0,i.setOpHandler)(u)},{"./engine":"6eJyD","./flags":"dT8ve","./platforms/platform_browser":"f0ioM","./platforms/platform_node":"hYiSu","./ops/buffer":"3SrXS","./ops/cast":"ekSnT","./ops/clone":"gI2Tp","./ops/print":"4ToBR","./tensor":"cZ8UW"}],"6eJyD":[function(e,t,r){/** * @license * Copyright 2018 Google LLC. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. * ============================================================================= */var n=e("@parcel/transformer-js/src/esmodule-helpers.js");n.defineInteropFlag(r),n.export(r,"Engine",()=>x),n.export(r,"getOrMakeEngine",()=>v),n.export(r,"ENGINE",()=>y),n.export(r,"add",()=>b);var s=e("./backends/backend"),a=e("./environment"),o=e("./global_util"),l=e("./kernel_names"),i=e("./kernel_registry"),u=e("./log"),p=e("./profiler"),c=e("./tape"),d=e("./tensor"),f=e("./tensor_util"),h=e("./util");function m(e){return null!=e.kernelName}class g{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()}}class x{constructor(e){this.ENV=e,this.registry={},this.registryFactory={},this.pendingBackendInitId=0,this.state=new g}async ready(){if(null!=this.pendingBackendInit)return this.pendingBackendInit.then(()=>{});if(null!=this.backendInstance)return;let e=this.getSortedBackends();for(let t=0;t{null!=e.setupFunc&&e.setupFunc(this.backendInstance)})}disposeRegisteredKernels(e){(0,i.getKernelsForBackend)(e).forEach(t=>{null!=t.disposeFunc&&t.disposeFunc(this.registry[e])})}initializeBackend(e){let t=this.registryFactory[e];if(null==t)throw Error(`Cannot initialize backend ${e}, no registration found.`);try{let r=t.factory();if(!r||r instanceof s.KernelBackend||"function"!=typeof r.then)return this.registry[e]=r,{success:!0,asyncInit:!1};{let t=++this.pendingBackendInitId,n=r.then(r=>!(t!(tthis.registryFactory[t].priority-this.registryFactory[e].priority)}initializeBackendsAndReturnBest(){let e=this.getSortedBackends();for(let t=0;tthis.startScope(n),()=>this.endScope(r),()=>((r=t())instanceof Promise&&console.error("Cannot return a Promise inside of tidy."),r))}scopedRun(e,t,r){e();try{let e=r();return t(),e}catch(e){throw t(),e}}nextTensorId(){return x.nextTensorId++}nextVariableId(){return x.nextVariableId++}clone(e){let t=y.runKernel(l.Identity,{x:e});return this.addTapeNode(this.state.activeScope.name,{x:e},[t],e=>({x:()=>y.runKernel(l.Cast,{x:e},{dtype:"float32"})}),[],{}),t}runKernel(e,t,r){if(null==this.backendName&&this.backend,!(null!=(0,i.getKernel)(e,this.backendName)))throw Error(`Kernel '${e}' not registered for backend '${this.backendName}'`);return this.runKernelFunc({kernelName:e,inputs:t,attrs:r})}shouldCheckForMemLeaks(){return this.ENV.getBool("IS_TEST")}checkKernelForMemLeak(e,t,r){let n=this.backend.numDataIds(),s=0;r.forEach(e=>{s+="complex64"===e.dtype?3:1});let a=this.state.numDataMovesStack[this.state.numDataMovesStack.length-1],o=n-t-s-a;if(o>0)throw Error(`Backend '${this.backendName}' has an internal memory leak (${o} data ids) after running '${e}'`)}runKernelFunc(e){let t,r,n,s;let a=[],o=this.isTapeOn(),l=this.state.numBytes,u=this.state.numTensors;this.shouldCheckForMemLeaks()&&this.state.numDataMovesStack.push(0),null==this.backendName&&this.backend;let p=m(e)?e.kernelName:null!=this.state.activeScope?this.state.activeScope.name:"";if(m(e)){let{kernelName:t,inputs:s,attrs:l}=e;null==this.backendName&&this.backend;let u=(0,i.getKernel)(t,this.backendName);h.assert(null!=u,()=>`Cannot find registered kernel '${t}' for backend '${this.backendName}'`),r=()=>{let e=this.backend.numDataIds(),r=Array.isArray(n=u.kernelFunc({inputs:s,attrs:l,backend:this.backend}))?n:[n];this.shouldCheckForMemLeaks()&&this.checkKernelForMemLeak(t,e,r);let i=r.map(e=>null!=e.rank?e:this.makeTensorFromTensorInfo(e));if(o){let e=this.getTensorsForGradient(t,s,i);a=this.saveTensorsForBackwardMode(e)}return i}}else{let{forwardFunc:t}=e,s=e=>{o&&(a=e.map(e=>this.keep(this.clone(e))))};r=()=>{let e=this.backend.numDataIds(),r=Array.isArray(n=this.tidy(()=>t(this.backend,s)))?n:[n];return this.shouldCheckForMemLeaks()&&this.checkKernelForMemLeak(p,e,r),r}}let{inputs:c,attrs:d}=e,f=m(e)?null:e.backwardsFunc;return this.scopedRun(()=>this.state.kernelDepth++,()=>this.state.kernelDepth--,()=>{this.ENV.getBool("DEBUG")||this.state.profiling?(s=this.profiler.profileKernel(p,c,()=>r()),this.ENV.getBool("DEBUG")&&this.profiler.logKernelProfile(s),t=s.outputs):t=r()}),o&&this.addTapeNode(p,c,t,f,a,d),this.state.profiling&&this.state.activeProfile.kernels.push({name:p,bytesAdded:this.state.numBytes-l,totalBytesSnapshot:this.state.numBytes,tensorsAdded:this.state.numTensors-u,totalTensorsSnapshot:this.state.numTensors,inputShapes:Object.keys(c).map(e=>null!=c[e]?c[e].shape:null),outputShapes:t.map(e=>e.shape),kernelTimeMs:s.timeMs,extraInfo:s.extraInfo}),Array.isArray(n)?t:t[0]}saveTensorsForBackwardMode(e){return e.map(e=>this.keep(this.clone(e)))}getTensorsForGradient(e,t,r){let n=(0,i.getGradient)(e);if(null!=n){let e;let s=n.inputsToSave||[],a=n.outputsToSave||[];n.saveAllInputs?(h.assert(Array.isArray(t),()=>"saveAllInputs is true, expected inputs to be an array."),e=Object.keys(t).map(e=>t[e])):e=s.map(e=>t[e]);let o=r.filter((e,t)=>a[t]);return e.concat(o)}return[]}makeTensor(e,t,r,n){if(null==e)throw Error("Values passed to engine.makeTensor() are null");r=r||"float32",n=n||this.backend;let s=e;"string"===r&&h.isString(e[0])&&(s=e.map(e=>h.encodeString(e)));let a=n.write(s,t,r),o=new d.Tensor(t,r,a,this.nextTensorId());if(this.trackTensor(o,n),"string"===r){let e=this.state.tensorInfo.get(a),t=(0,h.bytesFromStringArray)(s);this.state.numBytes+=t-e.bytes,e.bytes=t}return o}makeTensorFromDataId(e,t,r,n){let s={dataId:e,shape:t,dtype:r=r||"float32"};return this.makeTensorFromTensorInfo(s,n)}makeTensorFromTensorInfo(e,t){let{dataId:r,shape:n,dtype:s}=e,a=new d.Tensor(n,s,r,this.nextTensorId());return this.trackTensor(a,t),a}makeVariable(e,t=!0,r,n){r=r||this.nextVariableId().toString(),null!=n&&n!==e.dtype&&(e=e.cast(n));let s=new d.Variable(e,t,r,this.nextTensorId());if(null!=this.state.registeredVariables[s.name])throw 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++,"string"===e.dtype&&this.state.numStringTensors++;let r=0;"complex64"!==e.dtype&&"string"!==e.dtype&&(r=e.size*h.bytesPerElement(e.dtype)),this.state.numBytes+=r,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:r})),e instanceof d.Variable||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--,"string"===e.dtype&&(this.state.numStringTensors--,this.state.numBytes-=t.bytes),"complex64"!==e.dtype&&"string"!==e.dtype){let t=e.size*h.bytesPerElement(e.dtype);this.state.numBytes-=t}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),null!=this.state.registeredVariables[e.name]&&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,null==e.reasons&&(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,r=this.state.numTensors;for(let n of(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(e=>e.totalBytesSnapshot)),this.state.activeProfile.newBytes=this.state.numBytes-t,this.state.activeProfile.newTensors=this.state.numTensors-r,this.state.activeProfile.kernels))n.kernelTimeMs=await n.kernelTimeMs,n.extraInfo=await n.extraInfo;return this.state.activeProfile}isTapeOn(){return this.state.gradientDepth>0&&0===this.state.kernelDepth}addTapeNode(e,t,r,n,s,a){let o={id:this.state.nextTapeNodeId++,kernelName:e,inputs:t,outputs:r,saved:s},l=(0,i.getGradient)(e);null!=l&&(n=l.gradFunc),null!=n&&(o.gradient=e=>(e=e.map((e,t)=>{if(null==e){let e=r[t],n=h.makeZerosTypedArray(e.size,e.dtype);return this.makeTensor(n,e.shape,e.dtype)}return e}),n(e.length>1?e:e[0],s,a))),this.state.activeTape.push(o)}keep(e){return e.kept=!0,e}startTape(){0===this.state.gradientDepth&&(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=(0,f.getTensorsInContainer)(e),r=new Set(t.map(e=>e.id));for(let e=0;e{e.kept||e.scopeId!==n.id||this.track(e)})}gradients(e,t,r,n=!1){if(h.assert(t.length>0,()=>"gradients() received an empty list of xs."),null!=r&&"float32"!==r.dtype)throw Error(`dy must have 'float32' dtype, but has '${r.dtype}'`);let s=this.scopedRun(()=>this.startTape(),()=>this.endTape(),()=>this.tidy("forward",e));h.assert(s instanceof d.Tensor,()=>"The result y returned by f() must be a tensor.");let a=(0,c.getFilteredNodesXToY)(this.state.activeTape,t,s);if(!n&&0===a.length&&t.length>0)throw 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 e={};e[s.id]=null==r?function(e){let t=(0,h.makeOnesTypedArray)((0,h.sizeFromShape)(e),"float32");return y.makeTensor(t,e,"float32")}(s.shape):r,(0,c.backpropagateGradients)(e,a,e=>this.tidy(e),b);let n=t.map(t=>e[t.id]);return 0===this.state.gradientDepth&&(this.state.activeTape.forEach(e=>{for(let t of e.saved)t.dispose()}),this.state.activeTape=null),{value:s,grads:n}})}customGrad(e){return h.assert(h.isFunction(e),()=>"The f passed in customGrad(f) must be a function."),(...t)=>{let r;h.assert(t.every(e=>e instanceof d.Tensor),()=>"The args passed in customGrad(f)(x1, x2,...) must all be tensors");let n={};return t.forEach((e,t)=>{n[t]=e}),this.runKernelFunc({forwardFunc:(n,s)=>(r=e(...t,s),h.assert(r.value instanceof d.Tensor,()=>"The function f passed in customGrad(f) must return an object where `obj.value` is a tensor"),h.assert(h.isFunction(r.gradFunc),()=>"The function f passed in customGrad(f) must return an object where `obj.gradFunc` is a function."),r.value),backwardsFunc:(e,n)=>{let s=r.gradFunc(e,n),a=Array.isArray(s)?s:[s];h.assert(a.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(...)."),h.assert(a.every(e=>e instanceof d.Tensor),()=>"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 o={};return a.forEach((e,t)=>{o[t]=()=>e}),o},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=(0,h.now)(),r=await this.backend.time(e);return r.wallMs=(0,h.now)()-t,r}track(e){return null!=this.state.activeScope&&(e.scopeId=this.state.activeScope.id,this.state.activeScope.track.push(e)),e}get registeredVariables(){return this.state.registeredVariables}reset(){for(let e in this.pendingBackendInitId++,this.state.dispose(),this.ENV.reset(),this.state=new g,this.registry)this.disposeRegisteredKernels(e),this.registry[e].dispose(),delete this.registry[e];this.backendName=null,this.backendInstance=null,this.pendingBackendInit=null}}function v(){let e=(0,o.getGlobalNamespace)();if(null==e._tfengine){let t=new a.Environment(e);e._tfengine=new x(t)}return(0,a.setEnvironmentGlobal)(e._tfengine.ENV),(0,d.setTensorTracker)(()=>e._tfengine),e._tfengine}x.nextTensorId=0,x.nextVariableId=0;let y=v();function b(e,t){return y.runKernel(l.Add,{a:e,b:t})}},{"./backends/backend":"dsi8D","./environment":"i6ZjF","./global_util":"bMbrs","./kernel_names":"aqvy4","./kernel_registry":"kQKsU","./log":"dmXQF","./profiler":"8scmz","./tape":"lK0gj","./tensor":"cZ8UW","./tensor_util":"jgr40","./util":"gBRMK","@parcel/transformer-js/src/esmodule-helpers.js":"9pCYc"}],dsi8D:[function(e,t,r){/** * @license * Copyright 2020 Google LLC. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. * ============================================================================= */var n=e("@parcel/transformer-js/src/esmodule-helpers.js");n.defineInteropFlag(r),n.export(r,"EPSILON_FLOAT32",()=>s),n.export(r,"EPSILON_FLOAT16",()=>a),n.export(r,"DataStorage",()=>o),n.export(r,"KernelBackend",()=>l);let s=1e-7,a=1e-4;class o{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}}class l{refCount(e){return i("refCount")}incRef(e){return i("incRef")}timerAvailable(){return!0}time(e){return i("time")}read(e){return i("read")}readSync(e){return i("readSync")}readToGPU(e,t){return i("readToGPU")}numDataIds(){return i("numDataIds")}disposeData(e,t){return i("disposeData")}write(e,t,r){return i("write")}move(e,t,r,n,s){return i("move")}createTensorFromGPUData(e,t,r){return i("createTensorFromGPUData")}memory(){return i("memory")}floatPrecision(){return i("floatPrecision")}epsilon(){return 32===this.floatPrecision()?s:a}dispose(){return i("dispose")}}function i(e){throw Error(`'${e}' not yet implemented or not found in the registry. This kernel may not be supported by the tfjs backend you have chosen`)}},{"@parcel/transformer-js/src/esmodule-helpers.js":"9pCYc"}],"9pCYc":[function(e,t,r){r.interopDefault=function(e){return e&&e.__esModule?e:{default:e}},r.defineInteropFlag=function(e){Object.defineProperty(e,"__esModule",{value:!0})},r.exportAll=function(e,t){return Object.keys(e).forEach(function(r){"default"===r||"__esModule"===r||Object.prototype.hasOwnProperty.call(t,r)||Object.defineProperty(t,r,{enumerable:!0,get:function(){return e[r]}})}),t},r.export=function(e,t,r){Object.defineProperty(e,t,{enumerable:!0,get:r})}},{}],i6ZjF:[function(e,t,r){/** * @license * Copyright 2017 Google LLC. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. * ============================================================================= */var n=e("@parcel/transformer-js/src/esmodule-helpers.js");n.defineInteropFlag(r),n.export(r,"Environment",()=>o),n.export(r,"getQueryParams",()=>l),n.export(r,"env",()=>i),n.export(r,"ENV",()=>u),n.export(r,"setEnvironmentGlobal",()=>p);var s=e("./util_base");let a="tfjsflags";class o{constructor(e){this.global=e,this.flags={},this.flagRegistry={},this.urlFlags={},this.getQueryParams=l,this.populateURLFlags()}setPlatform(e,t){null==this.platform||u.getBool("IS_TEST")||u.getBool("PROD")||console.warn(`Platform ${this.platformName} has already been set. Overwriting the platform with ${e}.`),this.platformName=e,this.platform=t}registerFlag(e,t,r){if(this.flagRegistry[e]={evaluationFn:t,setHook:r},null!=this.urlFlags[e]){let t=this.urlFlags[e];u.getBool("IS_TEST")||u.getBool("PROD")||console.warn(`Setting feature override from URL ${e}: ${t}.`),this.set(e,t)}}async getAsync(e){return e in this.flags||(this.flags[e]=await this.evaluateFlag(e)),this.flags[e]}get(e){if(e in this.flags)return this.flags[e];let t=this.evaluateFlag(e);if((0,s.isPromise)(t))throw Error(`Flag ${e} cannot be synchronously evaluated. Please use getAsync() instead.`);return this.flags[e]=t,this.flags[e]}getNumber(e){return this.get(e)}getBool(e){return this.get(e)}getString(e){return this.get(e)}getFlags(){return this.flags}get features(){return this.flags}set(e,t){if(null==this.flagRegistry[e])throw Error(`Cannot set flag ${e} as it has not been registered.`);this.flags[e]=t,null!=this.flagRegistry[e].setHook&&this.flagRegistry[e].setHook(t)}evaluateFlag(e){if(null==this.flagRegistry[e])throw Error(`Cannot evaluate flag '${e}': no evaluation function found.`);return this.flagRegistry[e].evaluationFn()}setFlags(e){this.flags=Object.assign({},e)}reset(){this.flags={},this.urlFlags={},this.populateURLFlags()}populateURLFlags(){if(void 0===this.global||void 0===this.global.location||void 0===this.global.location.search)return;let e=this.getQueryParams(this.global.location.search);a in e&&e[a].split(",").forEach(e=>{let[t,r]=e.split(":");this.urlFlags[t]=function(e,t){let r=t.toLowerCase();return"true"===r||"false"===r?"true"===r:`${+r}`===r?+r:t}(0,r)})}}function l(e){let t={};return e.replace(/[?&]([^=?&]+)(?:=([^&]*))?/g,(e,...r)=>{var n,s;return n=r[0],s=r[1],t[decodeURIComponent(n)]=decodeURIComponent(s||""),r.join("=")}),t}function i(){return u}let u=null;function p(e){u=e}},{"./util_base":"8U7kO","@parcel/transformer-js/src/esmodule-helpers.js":"9pCYc"}],"8U7kO":[function(e,t,r){/** * @license * Copyright 2020 Google LLC. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. * ============================================================================= */var n=e("@parcel/transformer-js/src/esmodule-helpers.js");function s(e){let t=e.length,r=0;for(;t>0;)r=Math.random()*t|0,i(e,--t,r)}function a(e,t){if(e.length!==t.length)throw Error(`Array sizes must match to be shuffled together First array length was ${e.length}Second array length was ${t.length}`);let r=e.length,n=0;for(;r>0;)n=Math.random()*r|0,i(e,--r,n),i(t,r,n)}function o(e,t,r){return Math.max(e,Math.min(t,r))}function l(e){return e%2==0?e:e+1}function i(e,t,r){let n=e[t];e[t]=e[r],e[r]=n}function u(e){let t=0;for(let r=0;rr+` Shapes ${e} and ${t} must match`)}function h(e){d(null!=e,()=>"The input to the tensor constructor must be a non-null value.")}function m(e){if(0===e.length)return 1;let t=e[0];for(let r=1;r0,r,n){return new Promise((s,a)=>{let o=0,l=()=>{if(e()){s();return}let i=t(++o);if(null!=r&&o>=r){a();return}null!=n?n(l,i):setTimeout(l,i)};l()})}function C(e,t){let r=1,n=-1;for(let t=0;t=0)r*=e[t];else if(-1===e[t]){if(-1!==n)throw Error(`Shapes can only have 1 implicit size. Found -1 at dim ${n} and dim ${t}`);n=t}else if(e[t]<0)throw Error(`Shapes can not be < 0. Found ${e[t]} at dim ${t}`);if(-1===n){if(t>0&&t!==r)throw Error(`Size(${t}) must match the product of shape ${e}`);return e}if(0===r)throw Error(`Cannot infer the missing size in [${e}] when there are 0 elements`);if(t%r!=0)throw Error(`The implicit shape can't be a fractional number. Got ${t} / ${r}`);let s=e.slice();return s[n]=t/r,s}function w(e,t){let r=t.length;return d((e=null==e?t.map((e,t)=>t):[].concat(e)).every(e=>e>=-r&&e`All values in axis param must be in range [-${r}, ${r}) but got axis ${e}`),d(e.every(e=>y(e)),()=>`All values in axis param must be integers but got axis ${e}`),e.map(e=>e<0?r+e:e)}function T(e,t){let r=[],n=[],s=null!=t&&Array.isArray(t)&&0===t.length,a=null==t||s?null:w(t,e).sort(),o=0;for(let t=0;tt)&&1===e[t]&&(r.push(e[t]),n.push(t)),a[o]<=t&&o++}1!==e[t]&&(r.push(e[t]),n.push(t))}return{newShape:r,keptDims:n}}function S(e,t){return N(e,t)}function N(e,t){let r=null;if(null==e||"float32"===e)r=new Float32Array(t);else if("int32"===e)r=new Int32Array(t);else if("bool"===e)r=new Uint8Array(t);else if("string"===e)r=Array(t);else throw Error(`Unknown data type ${e}`);return r}function E(e,t){for(let r=0;rt+=e.length),t}function D(e){return"string"==typeof e||e instanceof String}function $(e){return"boolean"==typeof e}function M(e){return"number"==typeof e}function O(e){return!!(e&&e.constructor&&e.call&&e.apply)}function V(e,t){for(let r=t;r=0;--n)r[n]=r[n+1]*e[n+1];return r}function L(e,t,r=!1){if(0===e.length)return t[0];let n=e.reduce((e,t)=>e*t)*(r?2:1);if(0===n)return[];if(n!==t.length)throw Error(`[${e}] does not match the input size ${t.length}${r?" for a complex tensor":""}.`);return function e(t,r,n,s=!1){let a=[];if(1===r.length){let e=r[0]*(s?2:1);for(let r=0;re*t)*(s?2:1);for(let r=0;re*t,1);if(null==t||"float32"===t)return L(e,new Float32Array(r));if("int32"===t)return L(e,new Int32Array(r));if("bool"===t)return L(e,new Uint8Array(r));throw Error(`Unknown data type ${t}`)}function W(e){e.forEach(t=>{d(Number.isInteger(t)&&t>=0,()=>`Tensor must have a shape comprised of positive integers but got shape [${e}].`)})}function q(e,t,r){if(0===t)return 0;if(1===t)return e[0];let n=e[e.length-1];for(let t=0;ts),n.export(r,"shuffleCombo",()=>a),n.export(r,"clamp",()=>o),n.export(r,"nearestLargerEven",()=>l),n.export(r,"swap",()=>i),n.export(r,"sum",()=>u),n.export(r,"randUniform",()=>p),n.export(r,"distSquared",()=>c),n.export(r,"assert",()=>d),n.export(r,"assertShapesMatch",()=>f),n.export(r,"assertNonNull",()=>h),n.export(r,"sizeFromShape",()=>m),n.export(r,"isScalarShape",()=>g),n.export(r,"arraysEqualWithNull",()=>x),n.export(r,"arraysEqual",()=>v),n.export(r,"isInt",()=>y),n.export(r,"tanh",()=>b),n.export(r,"sizeToSquarishShape",()=>_),n.export(r,"createShuffledIndices",()=>k),n.export(r,"rightPad",()=>j),n.export(r,"repeatedTry",()=>I),n.export(r,"inferFromImplicitShape",()=>C),n.export(r,"parseAxisParam",()=>w),n.export(r,"squeezeShape",()=>T),n.export(r,"getTypedArrayFromDType",()=>S),n.export(r,"getArrayFromDType",()=>N),n.export(r,"checkConversionForErrors",()=>E),n.export(r,"isValidDtype",()=>F),n.export(r,"hasEncodingLoss",()=>R),n.export(r,"bytesPerElement",()=>A),n.export(r,"bytesFromStringArray",()=>P),n.export(r,"isString",()=>D),n.export(r,"isBoolean",()=>$),n.export(r,"isNumber",()=>M),n.export(r,"inferDtype",()=>function e(t){if(Array.isArray(t))return e(t[0]);if(t instanceof Float32Array);else if(t instanceof Int32Array||t instanceof Uint8Array||t instanceof Uint8ClampedArray)return"int32";else if(M(t));else if(D(t))return"string";else if($(t))return"bool";return"float32"}),n.export(r,"isFunction",()=>O),n.export(r,"nearestDivisor",()=>V),n.export(r,"computeStrides",()=>B),n.export(r,"toNestedArray",()=>L),n.export(r,"convertBackendValuesAndArrayBuffer",()=>G),n.export(r,"makeOnesTypedArray",()=>z),n.export(r,"makeZerosTypedArray",()=>U),n.export(r,"makeZerosNestedTypedArray",()=>Y),n.export(r,"assertNonNegativeIntegerDimensions",()=>W),n.export(r,"locToIndex",()=>q),n.export(r,"indexToLoc",()=>K),n.export(r,"isPromise",()=>H)},{"@parcel/transformer-js/src/esmodule-helpers.js":"9pCYc"}],bMbrs:[function(e,t,r){let n;/** * @license * Copyright 2020 Google LLC. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. * ============================================================================= */var s=e("@parcel/transformer-js/src/esmodule-helpers.js");s.defineInteropFlag(r),s.export(r,"getGlobalNamespace",()=>l),s.export(r,"getGlobal",()=>i);var a=arguments[3],o=e("585141946453e563");function l(){if(null==n){let e;if("undefined"!=typeof window)e=window;else if(void 0!==a)e=a;else if(void 0!==o)e=o;else if("undefined"!=typeof self)e=self;else throw Error("Could not find a global object");n=e}return n}function i(e,t){let r=function(){let e=l();return null==e._tfGlobals&&(e._tfGlobals=new Map),e._tfGlobals}();if(r.has(e))return r.get(e);{let n=t();return r.set(e,n),r.get(e)}}},{"585141946453e563":"lTIIq","@parcel/transformer-js/src/esmodule-helpers.js":"9pCYc"}],lTIIq:[function(e,t,r){var n,s,a,o=t.exports={};function l(){throw Error("setTimeout has not been defined")}function i(){throw Error("clearTimeout has not been defined")}function u(e){if(n===setTimeout)return setTimeout(e,0);if((n===l||!n)&&setTimeout)return n=setTimeout,setTimeout(e,0);try{return n(e,0)}catch(t){try{return n.call(null,e,0)}catch(t){return n.call(this,e,0)}}}!function(){try{n="function"==typeof setTimeout?setTimeout:l}catch(e){n=l}try{s="function"==typeof clearTimeout?clearTimeout:i}catch(e){s=i}}();var p=[],c=!1,d=-1;function f(){c&&a&&(c=!1,a.length?p=a.concat(p):d=-1,p.length&&h())}function h(){if(!c){var e=u(f);c=!0;for(var t=p.length;t;){for(a=p,p=[];++d1)for(var r=1;rs),n.export(r,"Acos",()=>a),n.export(r,"Acosh",()=>o),n.export(r,"Add",()=>l),n.export(r,"AddN",()=>i),n.export(r,"All",()=>u),n.export(r,"Any",()=>p),n.export(r,"ArgMax",()=>c),n.export(r,"ArgMin",()=>d),n.export(r,"Asin",()=>f),n.export(r,"Asinh",()=>h),n.export(r,"Atan",()=>m),n.export(r,"Atanh",()=>g),n.export(r,"Atan2",()=>x),n.export(r,"AvgPool",()=>v),n.export(r,"AvgPoolGrad",()=>y),n.export(r,"AvgPool3D",()=>b),n.export(r,"AvgPool3DGrad",()=>_),n.export(r,"BatchMatMul",()=>k),n.export(r,"BatchToSpaceND",()=>j),n.export(r,"Bincount",()=>I),n.export(r,"BitwiseAnd",()=>C),n.export(r,"BroadcastTo",()=>w),n.export(r,"BroadcastArgs",()=>T),n.export(r,"Cast",()=>S),n.export(r,"Ceil",()=>N),n.export(r,"ClipByValue",()=>E),n.export(r,"Complex",()=>F),n.export(r,"ComplexAbs",()=>R),n.export(r,"Concat",()=>A),n.export(r,"Conv2D",()=>P),n.export(r,"Conv2DBackpropFilter",()=>D),n.export(r,"Conv2DBackpropInput",()=>$),n.export(r,"Conv3D",()=>M),n.export(r,"Conv3DBackpropFilterV2",()=>O),n.export(r,"Conv3DBackpropInputV2",()=>V),n.export(r,"Cos",()=>B),n.export(r,"Cosh",()=>L),n.export(r,"Cumprod",()=>G),n.export(r,"Cumsum",()=>z),n.export(r,"CropAndResize",()=>U),n.export(r,"DenseBincount",()=>Y),n.export(r,"DepthToSpace",()=>W),n.export(r,"DepthwiseConv2dNative",()=>q),n.export(r,"DepthwiseConv2dNativeBackpropFilter",()=>K),n.export(r,"DepthwiseConv2dNativeBackpropInput",()=>H),n.export(r,"Diag",()=>X),n.export(r,"Dilation2D",()=>Q),n.export(r,"Dilation2DBackpropInput",()=>J),n.export(r,"Dilation2DBackpropFilter",()=>Z),n.export(r,"Draw",()=>ee),n.export(r,"RealDiv",()=>et),n.export(r,"Einsum",()=>er),n.export(r,"Elu",()=>en),n.export(r,"EluGrad",()=>es),n.export(r,"Erf",()=>ea),n.export(r,"Equal",()=>eo),n.export(r,"Exp",()=>el),n.export(r,"ExpandDims",()=>ei),n.export(r,"Expm1",()=>eu),n.export(r,"FFT",()=>ep),n.export(r,"Fill",()=>ec),n.export(r,"FlipLeftRight",()=>ed),n.export(r,"Floor",()=>ef),n.export(r,"FloorDiv",()=>eh),n.export(r,"FusedBatchNorm",()=>em),n.export(r,"GatherV2",()=>eg),n.export(r,"GatherNd",()=>ex),n.export(r,"Greater",()=>ev),n.export(r,"GreaterEqual",()=>ey),n.export(r,"Identity",()=>eb),n.export(r,"IFFT",()=>e_),n.export(r,"Imag",()=>ek),n.export(r,"IsFinite",()=>ej),n.export(r,"IsInf",()=>eI),n.export(r,"IsNan",()=>eC),n.export(r,"LeakyRelu",()=>ew),n.export(r,"Less",()=>eT),n.export(r,"LessEqual",()=>eS),n.export(r,"LinSpace",()=>eN),n.export(r,"Log",()=>eE),n.export(r,"Log1p",()=>eF),n.export(r,"LogicalAnd",()=>eR),n.export(r,"LogicalNot",()=>eA),n.export(r,"LogicalOr",()=>eP),n.export(r,"LogicalXor",()=>eD),n.export(r,"LogSoftmax",()=>e$),n.export(r,"LowerBound",()=>eM),n.export(r,"LRN",()=>eO),n.export(r,"LRNGrad",()=>eV),n.export(r,"MatrixBandPart",()=>eB),n.export(r,"Max",()=>eL),n.export(r,"Maximum",()=>eG),n.export(r,"MaxPool",()=>ez),n.export(r,"MaxPoolGrad",()=>eU),n.export(r,"MaxPool3D",()=>eY),n.export(r,"MaxPool3DGrad",()=>eW),n.export(r,"MaxPoolWithArgmax",()=>eq),n.export(r,"Mean",()=>eK),n.export(r,"Min",()=>eH),n.export(r,"Minimum",()=>eX),n.export(r,"MirrorPad",()=>eQ),n.export(r,"Mod",()=>eJ),n.export(r,"Multinomial",()=>eZ),n.export(r,"Multiply",()=>e0),n.export(r,"Neg",()=>e1),n.export(r,"NotEqual",()=>e2),n.export(r,"NonMaxSuppressionV3",()=>e3),n.export(r,"NonMaxSuppressionV4",()=>e4),n.export(r,"NonMaxSuppressionV5",()=>e9),n.export(r,"OnesLike",()=>e6),n.export(r,"OneHot",()=>e5),n.export(r,"Pack",()=>e8),n.export(r,"PadV2",()=>e7),n.export(r,"Pool",()=>te),n.export(r,"Pow",()=>tt),n.export(r,"Prelu",()=>tr),n.export(r,"Prod",()=>tn),n.export(r,"RaggedGather",()=>ts),n.export(r,"RaggedRange",()=>ta),n.export(r,"RaggedTensorToTensor",()=>to),n.export(r,"Range",()=>tl),n.export(r,"Real",()=>ti),n.export(r,"Reciprocal",()=>tu),n.export(r,"Relu",()=>tp),n.export(r,"Reshape",()=>tc),n.export(r,"ResizeNearestNeighbor",()=>td),n.export(r,"ResizeNearestNeighborGrad",()=>tf),n.export(r,"ResizeBilinear",()=>th),n.export(r,"ResizeBilinearGrad",()=>tm),n.export(r,"Relu6",()=>tg),n.export(r,"Reverse",()=>tx),n.export(r,"Round",()=>tv),n.export(r,"Rsqrt",()=>ty),n.export(r,"ScatterNd",()=>tb),n.export(r,"TensorScatterUpdate",()=>t_),n.export(r,"SearchSorted",()=>tk),n.export(r,"Select",()=>tj),n.export(r,"Selu",()=>tI),n.export(r,"Slice",()=>tC),n.export(r,"Sin",()=>tw),n.export(r,"Sinh",()=>tT),n.export(r,"Sign",()=>tS),n.export(r,"Sigmoid",()=>tN),n.export(r,"Softplus",()=>tE),n.export(r,"Sqrt",()=>tF),n.export(r,"Sum",()=>tR),n.export(r,"SpaceToBatchND",()=>tA),n.export(r,"SplitV",()=>tP),n.export(r,"Softmax",()=>tD),n.export(r,"SparseFillEmptyRows",()=>t$),n.export(r,"SparseReshape",()=>tM),n.export(r,"SparseSegmentMean",()=>tO),n.export(r,"SparseSegmentSum",()=>tV),n.export(r,"SparseToDense",()=>tB),n.export(r,"SquaredDifference",()=>tL),n.export(r,"Square",()=>tG),n.export(r,"StaticRegexReplace",()=>tz),n.export(r,"StridedSlice",()=>tU),n.export(r,"StringNGrams",()=>tY),n.export(r,"StringSplit",()=>tW),n.export(r,"StringToHashBucketFast",()=>tq),n.export(r,"Sub",()=>tK),n.export(r,"Tan",()=>tH),n.export(r,"Tanh",()=>tX),n.export(r,"Tile",()=>tQ),n.export(r,"TopK",()=>tJ),n.export(r,"Transform",()=>tZ),n.export(r,"Transpose",()=>t0),n.export(r,"Unique",()=>t1),n.export(r,"Unpack",()=>t2),n.export(r,"UnsortedSegmentSum",()=>t3),n.export(r,"UpperBound",()=>t4),n.export(r,"ZerosLike",()=>t9),n.export(r,"Step",()=>t6),n.export(r,"FromPixels",()=>t5),n.export(r,"RotateWithOffset",()=>t8),n.export(r,"_FusedMatMul",()=>t7),n.export(r,"FusedConv2D",()=>re),n.export(r,"FusedDepthwiseConv2D",()=>rt);let s="Abs",a="Acos",o="Acosh",l="Add",i="AddN",u="All",p="Any",c="ArgMax",d="ArgMin",f="Asin",h="Asinh",m="Atan",g="Atanh",x="Atan2",v="AvgPool",y="AvgPoolGrad",b="AvgPool3D",_="AvgPool3DGrad",k="BatchMatMul",j="BatchToSpaceND",I="Bincount",C="BitwiseAnd",w="BroadcastTo",T="BroadcastArgs",S="Cast",N="Ceil",E="ClipByValue",F="Complex",R="ComplexAbs",A="Concat",P="Conv2D",D="Conv2DBackpropFilter",$="Conv2DBackpropInput",M="Conv3D",O="Conv3DBackpropFilterV2",V="Conv3DBackpropInputV2",B="Cos",L="Cosh",G="Cumprod",z="Cumsum",U="CropAndResize",Y="DenseBincount",W="DepthToSpace",q="DepthwiseConv2dNative",K="DepthwiseConv2dNativeBackpropFilter",H="DepthwiseConv2dNativeBackpropInput",X="Diag",Q="Dilation2D",J="Dilation2DBackpropInput",Z="Dilation2DBackpropFilter",ee="Draw",et="RealDiv",er="Einsum",en="Elu",es="EluGrad",ea="Erf",eo="Equal",el="Exp",ei="ExpandDims",eu="Expm1",ep="FFT",ec="Fill",ed="FlipLeftRight",ef="Floor",eh="FloorDiv",em="FusedBatchNorm",eg="GatherV2",ex="GatherNd",ev="Greater",ey="GreaterEqual",eb="Identity",e_="IFFT",ek="Imag",ej="IsFinite",eI="IsInf",eC="IsNan",ew="LeakyRelu",eT="Less",eS="LessEqual",eN="LinSpace",eE="Log",eF="Log1p",eR="LogicalAnd",eA="LogicalNot",eP="LogicalOr",eD="LogicalXor",e$="LogSoftmax",eM="LowerBound",eO="LRN",eV="LRNGrad",eB="MatrixBandPart",eL="Max",eG="Maximum",ez="MaxPool",eU="MaxPoolGrad",eY="MaxPool3D",eW="MaxPool3DGrad",eq="MaxPoolWithArgmax",eK="Mean",eH="Min",eX="Minimum",eQ="MirrorPad",eJ="Mod",eZ="Multinomial",e0="Multiply",e1="Neg",e2="NotEqual",e3="NonMaxSuppressionV3",e4="NonMaxSuppressionV4",e9="NonMaxSuppressionV5",e6="OnesLike",e5="OneHot",e8="Pack",e7="PadV2",te="Pool",tt="Pow",tr="Prelu",tn="Prod",ts="RaggedGather",ta="RaggedRange",to="RaggedTensorToTensor",tl="Range",ti="Real",tu="Reciprocal",tp="Relu",tc="Reshape",td="ResizeNearestNeighbor",tf="ResizeNearestNeighborGrad",th="ResizeBilinear",tm="ResizeBilinearGrad",tg="Relu6",tx="Reverse",tv="Round",ty="Rsqrt",tb="ScatterNd",t_="TensorScatterUpdate",tk="SearchSorted",tj="Select",tI="Selu",tC="Slice",tw="Sin",tT="Sinh",tS="Sign",tN="Sigmoid",tE="Softplus",tF="Sqrt",tR="Sum",tA="SpaceToBatchND",tP="SplitV",tD="Softmax",t$="SparseFillEmptyRows",tM="SparseReshape",tO="SparseSegmentMean",tV="SparseSegmentSum",tB="SparseToDense",tL="SquaredDifference",tG="Square",tz="StaticRegexReplace",tU="StridedSlice",tY="StringNGrams",tW="StringSplit",tq="StringToHashBucketFast",tK="Sub",tH="Tan",tX="Tanh",tQ="Tile",tJ="TopK",tZ="Transform",t0="Transpose",t1="Unique",t2="Unpack",t3="UnsortedSegmentSum",t4="UpperBound",t9="ZerosLike",t6="Step",t5="FromPixels",t8="RotateWithOffset",t7="_FusedMatMul",re="FusedConv2D",rt="FusedDepthwiseConv2D"},{"@parcel/transformer-js/src/esmodule-helpers.js":"9pCYc"}],kQKsU:[function(e,t,r){/** * @license * Copyright 2019 Google LLC. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. * ============================================================================= */var n=e("@parcel/transformer-js/src/esmodule-helpers.js");n.defineInteropFlag(r),n.export(r,"getKernel",()=>u),n.export(r,"getGradient",()=>p),n.export(r,"getKernelsForBackend",()=>c),n.export(r,"registerKernel",()=>d),n.export(r,"registerGradient",()=>f),n.export(r,"unregisterKernel",()=>h),n.export(r,"unregisterGradient",()=>m),n.export(r,"copyRegisteredKernels",()=>g);var s=e("./environment"),a=e("./global_util"),o=e("./log");let l=(0,a.getGlobal)("kernelRegistry",()=>new Map),i=(0,a.getGlobal)("gradRegistry",()=>new Map);function u(e,t){let r=x(e,t);return l.get(r)}function p(e){return i.get(e)}function c(e){let t=l.entries(),r=[];for(;;){let{done:n,value:s}=t.next();if(n)break;let[a,o]=s,[l]=a.split("_");l===e&&r.push(o)}return r}function d(e){let{kernelName:t,backendName:r}=e,n=x(t,r);l.has(n)&&o.warn(`The kernel '${t}' for backend '${r}' is already registered`),l.set(n,e)}function f(e){let{kernelName:t}=e;i.has(t)&&(0,s.env)().getBool("DEBUG")&&o.warn(`Overriding the gradient for '${t}'`),i.set(t,e)}function h(e,t){let r=x(e,t);if(!l.has(r))throw Error(`The kernel '${e}' for backend '${t}' is not registered`);l.delete(r)}function m(e){if(!i.has(e))throw Error(`The gradient '${e}' for backend is not registered`);i.delete(e)}function g(e,t){c(e).forEach(e=>{d(Object.assign({},e,{backendName:t}))})}function x(e,t){return`${t}_${e}`}},{"./environment":"i6ZjF","./global_util":"bMbrs","./log":"dmXQF","@parcel/transformer-js/src/esmodule-helpers.js":"9pCYc"}],dmXQF:[function(e,t,r){/** * @license * Copyright 2018 Google LLC. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. * ============================================================================= */var n=e("@parcel/transformer-js/src/esmodule-helpers.js");n.defineInteropFlag(r),n.export(r,"warn",()=>a),n.export(r,"log",()=>o);var s=e("./environment");function a(...e){(0,s.env)().getBool("IS_TEST")||(0,s.env)().getBool("PROD")||console.warn(...e)}function o(...e){(0,s.env)().getBool("IS_TEST")||(0,s.env)().getBool("PROD")||console.log(...e)}},{"./environment":"i6ZjF","@parcel/transformer-js/src/esmodule-helpers.js":"9pCYc"}],"8scmz":[function(e,t,r){/** * @license * Copyright 2018 Google LLC. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. * ============================================================================= */var n=e("@parcel/transformer-js/src/esmodule-helpers.js");n.defineInteropFlag(r),n.export(r,"Profiler",()=>o),n.export(r,"checkComputationForErrors",()=>l),n.export(r,"Logger",()=>i);var s=e("./environment"),a=e("./util");class o{constructor(e,t){this.backendTimer=e,this.logger=t,null==t&&(this.logger=new i)}profileKernel(e,t,r){let n,o;let i=()=>{n=r()},u=a.now();if(this.backendTimer.timerAvailable())o=this.backendTimer.time(i);else{for(let e of(i(),n))e.dataSync();o=Promise.resolve({kernelMs:a.now()-u})}if((0,s.env)().getBool("CHECK_COMPUTATION_FOR_ERRORS"))for(let t=0;t{l(t,r.dtype,e)})}return{kernelName:e,outputs:n,inputs:t,timeMs:o.then(e=>e.kernelMs),extraInfo:o.then(e=>null!=e.getExtraProfileInfo?e.getExtraProfileInfo():"")}}logKernelProfile(e){let{kernelName:t,outputs:r,timeMs:n,inputs:s,extraInfo:a}=e;r.forEach(e=>{Promise.all([e.data(),n,a]).then(r=>{this.logger.logKernelProfile(t,e,r[0],r[1],s,r[2])})})}}function l(e,t,r){if("float32"!==t)return!1;for(let t=0;t0?n:""} `}}console.log(`%c${i} %c${l} %c${u}D ${c} %c${p} %c${d} %c${o}`,"font-weight:bold","color:red","color:blue","color: orange","color: green","color: steelblue")}}},{"./environment":"i6ZjF","./util":"gBRMK","@parcel/transformer-js/src/esmodule-helpers.js":"9pCYc"}],gBRMK:[function(e,t,r){/** * @license * Copyright 2017 Google LLC. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. * ============================================================================= */var n=e("@parcel/transformer-js/src/esmodule-helpers.js");n.defineInteropFlag(r),n.export(r,"createScalarValue",()=>i),n.export(r,"toTypedArray",()=>u),n.export(r,"now",()=>p),n.export(r,"fetch",()=>c),n.export(r,"encodeString",()=>d),n.export(r,"decodeString",()=>f),n.export(r,"isTypedArray",()=>h),n.export(r,"flatten",()=>m);var s=e("./environment"),a=e("./platforms/is_typed_array_browser"),o=e("./util_base");n.exportAll(o,r);var l=e("./hash_util");function i(e,t){return"string"===t?d(e):u([e],t)}function u(e,t){var r;if("string"===t)throw Error("Cannot convert a string[] to a TypedArray");if(Array.isArray(e)&&(e=m(e)),(0,s.env)().getBool("DEBUG")&&o.checkConversionForErrors(e,t),(r=e)instanceof Float32Array&&"float32"===t||r instanceof Int32Array&&"int32"===t||r instanceof Uint8Array&&"bool"===t)return e;if(null==t||"float32"===t||"complex64"===t)return new Float32Array(e);if("int32"===t)return new Int32Array(e);if("bool"===t){let t=new Uint8Array(e.length);for(let r=0;rs)},{"@parcel/transformer-js/src/esmodule-helpers.js":"9pCYc"}],jAKeQ:[function(e,t,r){/** * @license * Copyright 2021 Google LLC. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. * ============================================================================= */var n=e("@parcel/transformer-js/src/esmodule-helpers.js");n.defineInteropFlag(r),n.export(r,"hexToLong",()=>o),n.export(r,"fingerPrint64",()=>g);var s=e("long");let a=s.default||s;function o(e){return a.fromString(e,!0,16)}let l=o("c3a5c85c97cb3127"),i=o("b492b66fbe98f273"),u=o("9ae16a3b2f90404f");function p(e){return e.xor(e.shru(47))}function c(e,t,r){let n=e.slice(t,t+r);return a.fromBytes(Array.from(n),!0,!0)}function d(e,t){return c(e,t,8)}function f(e,t){return 0===t?e:e.shru(t).or(e.shl(64-t))}function h(e,t,r=o("9ddfea08eb382d69")){let n=e.xor(t).mul(r);n=n.xor(n.shru(47));let s=t.xor(n).mul(r);return(s=s.xor(s.shru(47))).mul(r)}function m(e,t,r,n){return function(e,t,r,n,s,a){s=s.add(e),a=f(a.add(s).add(n),21);let o=s;return s=(s=s.add(t)).add(r),a=a.add(f(s,44)),[s.add(n),a.add(o)]}(d(e,t),d(e,t+8),d(e,t+16),d(e,t+24),r,n)}function g(e,t=e.length){let r=a.fromNumber(81,!0);if(t<=32)return t<=16?function(e,t=e.length){if(t>=8){let r=u.add(2*t),n=d(e,0).add(u),s=d(e,t-8);return h(f(s,37).mul(r).add(n),f(n,25).add(s).mul(r),r)}if(t>=4){let r=u.add(2*t);return h(c(e,0,4).shl(3).add(t),c(e,t-4,4),r)}if(t>0){let r=e[0],n=e[t>>1],s=e[t-1];return p(u.mul(r+(n<<8)).xor(l.mul(t+(s<<2)))).mul(u)}return u}(e,t):function(e,t=e.length){let r=u.add(2*t),n=d(e,0).mul(i),s=d(e,8),a=d(e,t-8).mul(r),o=d(e,t-16).mul(u);return h(f(n.add(s),43).add(f(a,30)).add(o),n.add(f(s.add(u),18)).add(a),r)}(e,t);if(t<=64)return function(e,t=e.length){let r=u.add(2*t),n=d(e,0).mul(u),s=d(e,8),a=d(e,t-8).mul(r),o=d(e,t-16).mul(u),l=f(n.add(s),43).add(f(a,30)).add(o),i=h(l,n.add(f(s.add(u),18)).add(a),r),p=d(e,16).mul(r),c=d(e,24),m=l.add(d(e,t-32)).mul(r),g=i.add(d(e,t-24)).mul(r);return h(f(p.add(c),43).add(f(m,30)).add(g),p.add(f(c.add(n),18)).add(m),r)}(e,t);let n=r,s=r.mul(i).add(113),o=p(s.mul(u).add(113)).mul(u),x=[a.UZERO,a.UZERO],v=[a.UZERO,a.UZERO];n=n.mul(u).add(d(e,0));let y=0,b=(t-1>>6)*64,_=b+(t-1&63)-63;do n=f(n.add(s).add(x[0]).add(d(e,y+8)),37).mul(i),s=f(s.add(x[1]).add(d(e,y+48)),42).mul(i),n=n.xor(v[1]),s=s.add(x[0]).add(d(e,y+40)),o=f(o.add(v[0]),33).mul(i),x=m(e,y,x[1].mul(i),n.add(v[0])),v=m(e,y+32,o.add(v[1]),s.add(d(e,y+16))),[o,n]=[n,o],y+=64;while(y!==b)let k=i.add(o.and(255).shl(1));return y=_,v[0]=v[0].add(t-1&63),x[0]=x[0].add(v[0]),v[0]=v[0].add(x[0]),n=f(n.add(s).add(x[0]).add(d(e,y+8)),37).mul(k),s=f(s.add(x[1]).add(d(e,y+48)),42).mul(k),n=n.xor(v[1].mul(9)),s=s.add(x[0].mul(9).add(d(e,y+40))),o=f(o.add(v[0]),33).mul(k),x=m(e,y,x[1].mul(k),n.add(v[0])),v=m(e,y+32,o.add(v[1]),s.add(d(e,y+16))),[o,n]=[n,o],h(h(x[0],v[0],k).add(p(s).mul(l)).add(o),h(x[1],v[1],k).add(n),k)}},{long:"37Qnw","@parcel/transformer-js/src/esmodule-helpers.js":"9pCYc"}],"37Qnw":[function(e,t,r){t.exports=s;var n=null;try{n=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(e){}function s(e,t,r){this.low=0|e,this.high=0|t,this.unsigned=!!r}function a(e){return!0===(e&&e.__isLong__)}s.prototype.__isLong__,Object.defineProperty(s.prototype,"__isLong__",{value:!0}),s.isLong=a;var o={},l={};function i(e,t){var r,n,s;return t?(e>>>=0,(s=0<=e&&e<256)&&(n=l[e]))?n:(r=p(e,(0|e)<0?-1:0,!0),s&&(l[e]=r),r):(e|=0,(s=-128<=e&&e<128)&&(n=o[e]))?n:(r=p(e,e<0?-1:0,!1),s&&(o[e]=r),r)}function u(e,t){if(isNaN(e))return t?y:v;if(t){if(e<0)return y;if(e>=m)return I}else{if(e<=-g)return C;if(e+1>=g)return j}return e<0?u(-e,t).neg():p(e%h|0,e/h|0,t)}function p(e,t,r){return new s(e,t,r)}s.fromInt=i,s.fromNumber=u,s.fromBits=p;var c=Math.pow;function d(e,t,r){if(0===e.length)throw Error("empty string");if("NaN"===e||"Infinity"===e||"+Infinity"===e||"-Infinity"===e)return v;if("number"==typeof t?(r=t,t=!1):t=!!t,(r=r||10)<2||360)throw Error("interior hyphen");if(0===n)return d(e.substring(1),t,r).neg();for(var n,s=u(c(r,8)),a=v,o=0;o>>0:this.low},w.toNumber=function(){return this.unsigned?(this.high>>>0)*h+(this.low>>>0):this.high*h+(this.low>>>0)},w.toString=function(e){if((e=e||10)<2||36>>0).toString(e);if((a=l).isZero())return i+o;for(;i.length<6;)i="0"+i;o=""+i+o}},w.getHighBits=function(){return this.high},w.getHighBitsUnsigned=function(){return this.high>>>0},w.getLowBits=function(){return this.low},w.getLowBitsUnsigned=function(){return this.low>>>0},w.getNumBitsAbs=function(){if(this.isNegative())return this.eq(C)?64:this.neg().getNumBitsAbs();for(var e=0!=this.high?this.high:this.low,t=31;t>0&&(e&1<=0},w.isOdd=function(){return(1&this.low)==1},w.isEven=function(){return(1&this.low)==0},w.equals=function(e){return a(e)||(e=f(e)),(this.unsigned===e.unsigned||this.high>>>31!=1||e.high>>>31!=1)&&this.high===e.high&&this.low===e.low},w.eq=w.equals,w.notEquals=function(e){return!this.eq(e)},w.neq=w.notEquals,w.ne=w.notEquals,w.lessThan=function(e){return 0>this.comp(e)},w.lt=w.lessThan,w.lessThanOrEqual=function(e){return 0>=this.comp(e)},w.lte=w.lessThanOrEqual,w.le=w.lessThanOrEqual,w.greaterThan=function(e){return this.comp(e)>0},w.gt=w.greaterThan,w.greaterThanOrEqual=function(e){return this.comp(e)>=0},w.gte=w.greaterThanOrEqual,w.ge=w.greaterThanOrEqual,w.compare=function(e){if(a(e)||(e=f(e)),this.eq(e))return 0;var t=this.isNegative(),r=e.isNegative();return t&&!r?-1:!t&&r?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},w.comp=w.compare,w.negate=function(){return!this.unsigned&&this.eq(C)?C:this.not().add(b)},w.neg=w.negate,w.add=function(e){a(e)||(e=f(e));var t,r,n=this.high>>>16,s=65535&this.high,o=this.low>>>16,l=65535&this.low,i=e.high>>>16,u=65535&e.high,c=e.low>>>16,d=65535&e.low,h=0,m=0;return t=0+((r=0+(l+d))>>>16),r&=65535,t+=o+c,m+=t>>>16,t&=65535,m+=s+u,h+=m>>>16,m&=65535,h+=n+i,p(t<<16|r,(h&=65535)<<16|m,this.unsigned)},w.subtract=function(e){return a(e)||(e=f(e)),this.add(e.neg())},w.sub=w.subtract,w.multiply=function(e){if(this.isZero())return v;if(a(e)||(e=f(e)),n)return p(n.mul(this.low,this.high,e.low,e.high),n.get_high(),this.unsigned);if(e.isZero())return v;if(this.eq(C))return e.isOdd()?C:v;if(e.eq(C))return this.isOdd()?C:v;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(x)&&e.lt(x))return u(this.toNumber()*e.toNumber(),this.unsigned);var t,r,s=this.high>>>16,o=65535&this.high,l=this.low>>>16,i=65535&this.low,c=e.high>>>16,d=65535&e.high,h=e.low>>>16,m=65535&e.low,g=0,y=0;return t=0+((r=0+i*m)>>>16),r&=65535,t+=l*m,y+=t>>>16,t&=65535,t+=i*h,y+=t>>>16,t&=65535,y+=o*m,g+=y>>>16,y&=65535,y+=l*h,g+=y>>>16,y&=65535,y+=i*d,g+=y>>>16,y&=65535,g+=s*m+o*h+l*d+i*c,p(t<<16|r,(g&=65535)<<16|y,this.unsigned)},w.mul=w.multiply,w.divide=function(e){if(a(e)||(e=f(e)),e.isZero())throw Error("division by zero");if(n){var t,r,s;return this.unsigned||-0x80000000!==this.high||-1!==e.low||-1!==e.high?p((this.unsigned?n.div_u:n.div_s)(this.low,this.high,e.low,e.high),n.get_high(),this.unsigned):this}if(this.isZero())return this.unsigned?y:v;if(this.unsigned){if(e.unsigned||(e=e.toUnsigned()),e.gt(this))return y;if(e.gt(this.shru(1)))return _;s=y}else{if(this.eq(C))return e.eq(b)||e.eq(k)?C:e.eq(C)?b:(t=this.shr(1).div(e).shl(1)).eq(v)?e.isNegative()?b:k:(r=this.sub(e.mul(t)),s=t.add(r.div(e)));if(e.eq(C))return this.unsigned?y:v;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=v}for(r=this;r.gte(e);){for(var o=Math.ceil(Math.log(t=Math.max(1,Math.floor(r.toNumber()/e.toNumber())))/Math.LN2),l=o<=48?1:c(2,o-48),i=u(t),d=i.mul(e);d.isNegative()||d.gt(r);)t-=l,d=(i=u(t,this.unsigned)).mul(e);i.isZero()&&(i=b),s=s.add(i),r=r.sub(d)}return s},w.div=w.divide,w.modulo=function(e){return(a(e)||(e=f(e)),n)?p((this.unsigned?n.rem_u:n.rem_s)(this.low,this.high,e.low,e.high),n.get_high(),this.unsigned):this.sub(this.div(e).mul(e))},w.mod=w.modulo,w.rem=w.modulo,w.not=function(){return p(~this.low,~this.high,this.unsigned)},w.and=function(e){return a(e)||(e=f(e)),p(this.low&e.low,this.high&e.high,this.unsigned)},w.or=function(e){return a(e)||(e=f(e)),p(this.low|e.low,this.high|e.high,this.unsigned)},w.xor=function(e){return a(e)||(e=f(e)),p(this.low^e.low,this.high^e.high,this.unsigned)},w.shiftLeft=function(e){return(a(e)&&(e=e.toInt()),0==(e&=63))?this:e<32?p(this.low<>>32-e,this.unsigned):p(0,this.low<>>e|this.high<<32-e,this.high>>e,this.unsigned):p(this.high>>e-32,this.high>=0?0:-1,this.unsigned)},w.shr=w.shiftRight,w.shiftRightUnsigned=function(e){if(a(e)&&(e=e.toInt()),0==(e&=63))return this;var t=this.high;return e<32?p(this.low>>>e|t<<32-e,t>>>e,this.unsigned):32===e?p(t,0,this.unsigned):p(t>>>e-32,0,this.unsigned)},w.shru=w.shiftRightUnsigned,w.shr_u=w.shiftRightUnsigned,w.toSigned=function(){return this.unsigned?p(this.low,this.high,!1):this},w.toUnsigned=function(){return this.unsigned?this:p(this.low,this.high,!0)},w.toBytes=function(e){return e?this.toBytesLE():this.toBytesBE()},w.toBytesLE=function(){var e=this.high,t=this.low;return[255&t,t>>>8&255,t>>>16&255,t>>>24,255&e,e>>>8&255,e>>>16&255,e>>>24]},w.toBytesBE=function(){var e=this.high,t=this.low;return[e>>>24,e>>>16&255,e>>>8&255,255&e,t>>>24,t>>>16&255,t>>>8&255,255&t]},s.fromBytes=function(e,t,r){return r?s.fromBytesLE(e,t):s.fromBytesBE(e,t)},s.fromBytesLE=function(e,t){return new s(e[0]|e[1]<<8|e[2]<<16|e[3]<<24,e[4]|e[5]<<8|e[6]<<16|e[7]<<24,t)},s.fromBytesBE=function(e,t){return new s(e[4]<<24|e[5]<<16|e[6]<<8|e[7],e[0]<<24|e[1]<<16|e[2]<<8|e[3],t)}},{}],lK0gj:[function(e,t,r){/** * @license * Copyright 2017 Google LLC. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. * ============================================================================= */var n=e("@parcel/transformer-js/src/esmodule-helpers.js");n.defineInteropFlag(r),n.export(r,"getFilteredNodesXToY",()=>a),n.export(r,"backpropagateGradients",()=>o);var s=e("./util");function a(e,t,r){let n={},s={};for(let e=0;en[e.id]=!0),l=!0,s[a.id]=!0;break}if(l)break}}let a={};a[r.id]=!0;let o={};for(let t=e.length-1;t>=0;t--){let r=e[t],n=r.inputs;for(let e=0;e=0;a--){let o=t[a],l=[];if(o.outputs.forEach(t=>{let r=e[t.id];null!=r?l.push(r):l.push(null)}),null==o.gradient)throw Error(`Cannot compute gradient: gradient function not found for ${o.kernelName}.`);let i=o.gradient(l);for(let t in o.inputs){if(!(t in i))throw Error(`Cannot backprop through input ${t}. Available gradients found: ${Object.keys(i)}.`);let a=r(()=>i[t]());if("float32"!==a.dtype)throw Error(`Error in gradient for op ${o.kernelName}. The gradient of input ${t} must have 'float32' dtype, but has '${a.dtype}'`);let l=o.inputs[t];if(!s.arraysEqual(a.shape,l.shape))throw Error(`Error in gradient for op ${o.kernelName}. The gradient of input '${t}' has shape '${a.shape}', which does not match the shape of the input '${l.shape}'`);if(null==e[l.id])e[l.id]=a;else{let t=e[l.id];e[l.id]=n(t,a),t.dispose()}}}}},{"./util":"gBRMK","@parcel/transformer-js/src/esmodule-helpers.js":"9pCYc"}],cZ8UW:[function(e,t,r){/** * @license * Copyright 2017 Google LLC. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. * ============================================================================= */var n=e("@parcel/transformer-js/src/esmodule-helpers.js");n.defineInteropFlag(r),n.export(r,"TensorBuffer",()=>l),n.export(r,"setTensorTracker",()=>p),n.export(r,"setOpHandler",()=>c),n.export(r,"setDeprecationWarningFn",()=>d),n.export(r,"Tensor",()=>f),n.export(r,"getGlobalTensorClass",()=>h),n.export(r,"Variable",()=>m);var s=e("./global_util"),a=e("./tensor_format"),o=e("./util");class l{constructor(e,t,r){if(this.dtype=t,this.shape=e.slice(),this.size=o.sizeFromShape(e),null!=r){let e=r.length;o.assert(e===this.size,()=>`Length of values '${e}' does not match the size inferred by the shape '${this.size}'.`)}if("complex64"===t)throw 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=r||o.getArrayFromDType(t,this.size),this.strides=(0,o.computeStrides)(e)}set(e,...t){0===t.length&&(t=[0]),o.assert(t.length===this.rank,()=>`The number of provided coordinates (${t.length}) must match the rank (${this.rank})`);let r=this.locToIndex(t);this.values[r]=e}get(...e){0===e.length&&(e=[0]);let t=0;for(let r of e){if(r<0||r>=this.shape[t])throw Error(`Requested out of range element at ${e}. Buffer shape=${this.shape}`);t++}let r=e[e.length-1];for(let t=0;to.decodeString(e))}catch(e){throw 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(),i().readToGPU(this.dataId,e)}dataSync(){this.throwIfDisposed();let e=i().readSync(this.dataId);if("string"===this.dtype)try{return e.map(e=>o.decodeString(e))}catch(e){throw 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 i().read(this.dataId);return"string"===this.dtype?e:new Uint8Array(e.buffer)}dispose(){this.isDisposed||(this.kerasMask&&this.kerasMask.dispose(),i().disposeTensor(this),this.isDisposedInternal=!0)}get isDisposed(){return this.isDisposedInternal}throwIfDisposed(){if(this.isDisposed)throw Error("Tensor is disposed.")}print(e=!1){return u.print(this,e)}clone(){return this.throwIfDisposed(),u.clone(this)}toString(e=!1){let t=this.dataSync();return(0,a.tensorToString)(t,this.shape,this.dtype,e)}cast(e){return this.throwIfDisposed(),u.cast(this,e)}variable(e=!0,t,r){return this.throwIfDisposed(),i().makeVariable(this,e,t,r)}}function h(){return(0,s.getGlobal)("Tensor",()=>f)}Object.defineProperty(f,Symbol.hasInstance,{value:e=>!!e&&null!=e.data&&null!=e.dataSync&&null!=e.throwIfDisposed}),h();class m extends f{constructor(e,t,r,n){super(e.shape,e.dtype,e.dataId,n),this.trainable=t,this.name=r}assign(e){if(e.dtype!==this.dtype)throw Error(`dtype of the new value (${e.dtype}) and previous value (${this.dtype}) must match`);if(!o.arraysEqual(e.shape,this.shape))throw Error(`shape of the new value (${e.shape}) and previous value (${this.shape}) must match`);i().disposeTensor(this),this.dataId=e.dataId,i().incRef(this,null)}dispose(){i().disposeVariable(this),this.isDisposedInternal=!0}}Object.defineProperty(m,Symbol.hasInstance,{value:e=>e instanceof f&&null!=e.assign&&e.assign instanceof Function})},{"./global_util":"bMbrs","./tensor_format":"kSuTQ","./util":"gBRMK","@parcel/transformer-js/src/esmodule-helpers.js":"9pCYc"}],kSuTQ:[function(e,t,r){/** * @license * Copyright 2018 Google LLC. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. * ============================================================================= */var n=e("@parcel/transformer-js/src/esmodule-helpers.js");n.defineInteropFlag(r),n.export(r,"tensorToString",()=>a);var s=e("./util");function a(e,t,r,n){let a=(0,s.computeStrides)(t),u=function(e,t,r,n){let a=(0,s.sizeFromShape)(t),l=n[n.length-1],u=Array(l).fill(0),p=t.length,c="complex64"===r?i(e):e;if(p>1)for(let e=0;e20){let e=Array.from(t.slice(0,3*p)),r=Array.from(t.slice((c-3)*p,c*p));return"complex64"===n&&(e=i(e),r=i(r)),["["+e.map((e,t)=>o(e,a[t],n)).join(", ")+", ..., "+r.map((e,t)=>o(e,a[c-3+t],n)).join(", ")+"]"]}return["["+("complex64"===n?i(t):Array.from(t)).map((e,t)=>o(e,a[t],n)).join(", ")+"]"]}let f=r.slice(1),h=s.slice(1),m=s[0]*p,g=[];if(c>20){for(let r=0;r<3;r++){let s=r*m,o=s+m;g.push(...e(t.slice(s,o),f,n,h,a,!1))}g.push("...");for(let r=c-3;r0?g[0]+x:"");for(let e=1;e" "+e).join("\n")),d.join("\n")}function o(e,t,r){let n;return n=Array.isArray(e)?`${parseFloat(e[0].toFixed(7))} + ${parseFloat(e[1].toFixed(7))}j`:(0,s.isString)(e)?`'${e}'`:"bool"===r?l(e):parseFloat(e.toFixed(7)).toString(),(0,s.rightPad)(n,t)}function l(e){return 0===e?"false":"true"}function i(e){let t=[];for(let r=0;rl),n.export(r,"assertTypesMatch",()=>i),n.export(r,"isTensorInList",()=>u),n.export(r,"getTensorsInContainer",()=>p);var s=e("./tensor"),a=e("./types"),o=e("./util");function l(e,t){if(e.dtype===t.dtype)return[e,t];let r=(0,a.upcastType)(e.dtype,t.dtype);return[e.cast(r),t.cast(r)]}function i(e,t){(0,o.assert)(e.dtype===t.dtype,()=>`The dtypes of the first(${e.dtype}) and second(${t.dtype}) input must match`)}function u(e,t){return t.some(t=>t.id===e.id)}function p(e){let t=[];return function e(t,r,n){if(null!=t){if(t instanceof s.Tensor){r.push(t);return}if(Array.isArray(t)||"object"==typeof t)for(let s in t){let a=t[s];n.has(a)||(n.add(a),e(a,r,n))}}}(e,t,new Set),t}},{"./tensor":"cZ8UW","./types":"ahcVG","./util":"gBRMK","@parcel/transformer-js/src/esmodule-helpers.js":"9pCYc"}],ahcVG:[function(e,t,r){/** * @license * Copyright 2017 Google LLC. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. * ============================================================================= */var n,s,a,o,l,i,u,p,c,d,f=e("@parcel/transformer-js/src/esmodule-helpers.js");f.defineInteropFlag(r),f.export(r,"Rank",()=>i),f.export(r,"upcastType",()=>m),f.export(r,"sumOutType",()=>g),f.export(r,"isWebGLData",()=>x),f.export(r,"isWebGPUData",()=>v),(n=i||(i={})).R0="R0",n.R1="R1",n.R2="R2",n.R3="R3",n.R4="R4",n.R5="R5",n.R6="R6",(s=u||(u={})).float32="float32",s.int32="int32",s.bool="int32",s.complex64="complex64",(a=p||(p={})).float32="float32",a.int32="int32",a.bool="bool",a.complex64="complex64",(o=c||(c={})).float32="float32",o.int32="float32",o.bool="float32",o.complex64="complex64",(l=d||(d={})).float32="complex64",l.int32="complex64",l.bool="complex64",l.complex64="complex64";let h={float32:c,int32:u,bool:p,complex64:d};function m(e,t){if("string"===e||"string"===t){if("string"===e&&"string"===t)return"string";throw Error(`Can not upcast ${e} with ${t}`)}return h[e][t]}function g(e){return m(e,"int32")}function x(e){return null!=e&&"object"==typeof e&&"texture"in e&&e.texture instanceof WebGLTexture}function v(e){return"undefined"!=typeof GPUBuffer&&null!=e&&"object"==typeof e&&"buffer"in e&&e.buffer instanceof GPUBuffer}},{"@parcel/transformer-js/src/esmodule-helpers.js":"9pCYc"}],dT8ve:[function(e,t,r){e("./engine");var n=e("./device_util"),s=e("./environment"),a=e("329ebbdb86789035");let o=(0,s.env)();o.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.")}),o.registerFlag("IS_BROWSER",()=>n.isBrowser()),o.registerFlag("IS_NODE",()=>void 0!==a&&void 0!==a.versions&&void 0!==a.versions.node),o.registerFlag("IS_CHROME",()=>"undefined"!=typeof navigator&&null!=navigator&&null!=navigator.userAgent&&/Chrome/.test(navigator.userAgent)&&/Google Inc/.test(navigator.vendor)),o.registerFlag("IS_SAFARI",()=>"undefined"!=typeof navigator&&null!=navigator&&null!=navigator.userAgent&&/Safari/.test(navigator.userAgent)&&/Apple/.test(navigator.vendor)),o.registerFlag("PROD",()=>!1),o.registerFlag("TENSORLIKE_CHECK_SHAPE_CONSISTENCY",()=>o.getBool("DEBUG")),o.registerFlag("DEPRECATION_WARNINGS_ENABLED",()=>!0),o.registerFlag("IS_TEST",()=>!1),o.registerFlag("CHECK_COMPUTATION_FOR_ERRORS",()=>o.getBool("DEBUG")),o.registerFlag("WRAP_TO_IMAGEBITMAP",()=>!1),o.registerFlag("CANVAS2D_WILL_READ_FREQUENTLY_FOR_GPU",()=>!1),o.registerFlag("USE_SETTIMEOUTCUSTOM",()=>!1)},{"329ebbdb86789035":"lTIIq","./engine":"6eJyD","./device_util":"b0HdX","./environment":"i6ZjF"}],b0HdX:[function(e,t,r){let n;/** * @license * Copyright 2017 Google LLC. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. * ============================================================================= */var s=e("@parcel/transformer-js/src/esmodule-helpers.js");function a(e){n=e}function o(e){if(void 0!==n)return n;if(e||"undefined"!=typeof navigator&&null!=navigator){if(e||(e=navigator),"ReactNative"===e.product)return!0;let t=e.userAgent||e.vendor||("undefined"!=typeof window?window.opera:"");if(!t){let t=e;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(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 l(){return"undefined"!=typeof window&&null!=window.document||"undefined"!=typeof WorkerGlobalScope}s.defineInteropFlag(r),s.export(r,"mockIsMobile",()=>a),s.export(r,"isMobile",()=>o),s.export(r,"isBrowser",()=>l)},{"@parcel/transformer-js/src/esmodule-helpers.js":"9pCYc"}],f0ioM:[function(e,t,r){/** * @license * Copyright 2019 Google LLC. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. * ============================================================================= */var n=e("@parcel/transformer-js/src/esmodule-helpers.js");n.defineInteropFlag(r),n.export(r,"PlatformBrowser",()=>u),e("../flags");var s=e("../environment"),a=e("../io/indexed_db"),o=e("../io/local_storage"),l=e("../io/model_management"),i=e("./is_typed_array_browser");class u{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("utf-8"!==t&&"utf8"!==t)throw Error(`Browser's encoder only supports utf-8, but got ${t}`);return null==this.textEncoder&&(this.textEncoder=new TextEncoder),this.textEncoder.encode(e)}decode(e,t){return new TextDecoder(t).decode(e)}setTimeoutCustom(e,t){if("undefined"==typeof window||!(0,s.env)().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",e=>{e.source===window&&e.data.name===this.messageName&&(e.stopPropagation(),(0,this.functionRefs[e.data.index])(),this.handledMessageCount++,this.handledMessageCount===this.functionRefs.length&&(this.functionRefs=[],this.handledMessageCount=0))},!0))}isTypedArray(e){return(0,i.isTypedArrayBrowser)(e)}}if((0,s.env)().get("IS_BROWSER")){(0,s.env)().setPlatform("browser",new u);try{(0,l.ModelStoreManagerRegistry).registerManager(o.BrowserLocalStorage.URL_SCHEME,new o.BrowserLocalStorageManager)}catch(e){}try{(0,l.ModelStoreManagerRegistry).registerManager(a.BrowserIndexedDB.URL_SCHEME,new a.BrowserIndexedDBManager)}catch(e){}}},{"../flags":"dT8ve","../environment":"i6ZjF","../io/indexed_db":"jPhj2","../io/local_storage":"jio7e","../io/model_management":"9ce9v","./is_typed_array_browser":"cTtxZ","@parcel/transformer-js/src/esmodule-helpers.js":"9pCYc"}],jPhj2:[function(e,t,r){/** * @license * Copyright 2018 Google LLC. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. * ============================================================================= */var n=e("@parcel/transformer-js/src/esmodule-helpers.js");n.defineInteropFlag(r),n.export(r,"deleteDatabase",()=>c),n.export(r,"BrowserIndexedDB",()=>h),n.export(r,"indexedDBRouter",()=>m),n.export(r,"browserIndexedDB",()=>g),n.export(r,"BrowserIndexedDBManager",()=>x),e("../flags");var s=e("../environment"),a=e("./io_utils"),o=e("./router_registry"),l=e("./composite_array_buffer");let i="tensorflowjs",u="models_store",p="model_info_store";async function c(){let e=d();return new Promise((t,r)=>{let n=e.deleteDatabase(i);n.onsuccess=()=>t(),n.onerror=e=>r(e)})}function d(){if(!(0,s.env)().getBool("IS_BROWSER"))throw Error("Failed to obtain IndexedDB factory because the current environmentis not a web browser.");let e="undefined"==typeof window?self:window,t=e.indexedDB||e.mozIndexedDB||e.webkitIndexedDB||e.msIndexedDB||e.shimIndexedDB;if(null==t)throw Error("The current browser does not appear to support IndexedDB.");return t}function f(e){let t=e.result;t.createObjectStore(u,{keyPath:"modelPath"}),t.createObjectStore(p,{keyPath:"modelPath"})}class h{constructor(e){if(this.indexedDB=d(),null==e||!e)throw Error("For IndexedDB, modelPath must not be null, undefined or empty.");this.modelPath=e}async save(e){if(e.modelTopology instanceof ArrayBuffer)throw 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((e,r)=>{let n=this.indexedDB.open(i,1);n.onupgradeneeded=()=>f(n),n.onsuccess=()=>{let s=n.result;if(null==t){let t=s.transaction(u,"readonly"),n=t.objectStore(u).get(this.modelPath);n.onsuccess=()=>{if(null==n.result)return s.close(),r(Error(`Cannot find model with path '${this.modelPath}' in IndexedDB.`));e(n.result.modelArtifacts)},n.onerror=e=>(s.close(),r(n.error)),t.oncomplete=()=>s.close()}else{let n,o;t.weightData=(0,l.CompositeArrayBuffer).join(t.weightData);let i=(0,a.getModelArtifactsInfoForJSON)(t),c=s.transaction(p,"readwrite"),d=c.objectStore(p);try{n=d.put({modelPath:this.modelPath,modelArtifactsInfo:i})}catch(e){return r(e)}n.onsuccess=()=>{let n;let a=(o=s.transaction(u,"readwrite")).objectStore(u);try{n=a.put({modelPath:this.modelPath,modelArtifacts:t,modelArtifactsInfo:i})}catch(e){return r(e)}n.onsuccess=()=>e({modelArtifactsInfo:i}),n.onerror=e=>{let t=(d=c.objectStore(p)).delete(this.modelPath);t.onsuccess=()=>(s.close(),r(n.error)),t.onerror=e=>(s.close(),r(n.error))}},n.onerror=e=>(s.close(),r(n.error)),c.oncomplete=()=>{null==o?s.close():o.oncomplete=()=>s.close()}}},n.onerror=e=>r(n.error)})}}h.URL_SCHEME="indexeddb://";let m=e=>(0,s.env)().getBool("IS_BROWSER")&&!Array.isArray(e)&&e.startsWith(h.URL_SCHEME)?g(e.slice(h.URL_SCHEME.length)):null;function g(e){return new h(e)}(0,o.IORouterRegistry).registerSaveRouter(m),(0,o.IORouterRegistry).registerLoadRouter(m);class x{constructor(){this.indexedDB=d()}async listModels(){return new Promise((e,t)=>{let r=this.indexedDB.open(i,1);r.onupgradeneeded=()=>f(r),r.onsuccess=()=>{let n=r.result,s=n.transaction(p,"readonly"),a=s.objectStore(p).getAll();a.onsuccess=()=>{let t={};for(let e of a.result)t[e.modelPath]=e.modelArtifactsInfo;e(t)},a.onerror=e=>(n.close(),t(a.error)),s.oncomplete=()=>n.close()},r.onerror=e=>t(r.error)})}async removeModel(e){var t;return e=(t=e).startsWith(h.URL_SCHEME)?t.slice(h.URL_SCHEME.length):t,new Promise((t,r)=>{let n=this.indexedDB.open(i,1);n.onupgradeneeded=()=>f(n),n.onsuccess=()=>{let s;let a=n.result,o=a.transaction(p,"readwrite"),l=o.objectStore(p),i=l.get(e);i.onsuccess=()=>{if(null==i.result)return a.close(),r(Error(`Cannot find model with path '${e}' in IndexedDB.`));{let n=l.delete(e),o=()=>{let n=(s=a.transaction(u,"readwrite")).objectStore(u).delete(e);n.onsuccess=()=>t(i.result.modelArtifactsInfo),n.onerror=e=>r(i.error)};n.onsuccess=o,n.onerror=e=>(o(),a.close(),r(i.error))}},i.onerror=e=>(a.close(),r(i.error)),o.oncomplete=()=>{null==s?a.close():s.oncomplete=()=>a.close()}},n.onerror=e=>r(n.error)})}}},{"../flags":"dT8ve","../environment":"i6ZjF","./io_utils":"dJfQ0","./router_registry":"570tD","./composite_array_buffer":"gCHLD","@parcel/transformer-js/src/esmodule-helpers.js":"9pCYc"}],dJfQ0:[function(e,t,r){/** * @license * Copyright 2018 Google LLC. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. * ============================================================================= */var n=e("@parcel/transformer-js/src/esmodule-helpers.js");n.defineInteropFlag(r),n.export(r,"encodeWeights",()=>d),n.export(r,"decodeWeights",()=>f),n.export(r,"decodeWeightsStream",()=>x),n.export(r,"concatenateTypedArrays",()=>v),n.export(r,"stringByteLength",()=>b),n.export(r,"arrayBufferToBase64String",()=>_),n.export(r,"base64StringToArrayBuffer",()=>k),n.export(r,"concatenateArrayBuffers",()=>j),n.export(r,"basename",()=>I),n.export(r,"getModelJSONForModelArtifacts",()=>C),n.export(r,"getModelArtifactsForJSONSync",()=>w),n.export(r,"getModelArtifactsForJSON",()=>T),n.export(r,"getModelArtifactsInfoForJSON",()=>S),n.export(r,"getWeightSpecs",()=>N),n.export(r,"getFloat16Decoder",()=>E);var s=e("../ops/complex"),a=e("../ops/tensor"),o=e("../util"),l=e("./types"),i=e("./composite_array_buffer"),u=e("../globals"),p=e("../environment"),c=e("cc5f092a6233570f").Buffer;async function d(e,t){let r=[],n=[],s=Array.isArray(e)?e.map(e=>e.name):Object.keys(e);for(let a=0;a{let t=await l.bytes(),r=new Uint8Array(t.reduce((e,t)=>e+t.length,0)+4*t.length),n=0;for(let e=0;er.slice(s+e,s+t));n[e.name]=m(e,r.slice(s,s+t)),s+=t}return n}async function h(e,t){let r;let n=(0,o.sizeFromShape)(e.shape);if("quantization"in e){let t=e.quantization;r=l.DTYPE_VALUE_SIZE_MAP[t.dtype]}else if("string"===e.dtype){let e=0;for(let r=0;r(s=await g(n,s,t)).slice(e,t)),a=(s=await g(n,s,t)).slice(0,t);s=s.slice(t);let l=m(e,a);if(r[e.name]=l,"webgpu"===(0,u.getBackend)()){let e=(0,u.backend)();"uploadToGPU"in e&&(0,o.sizeFromShape)(l.shape)>=(0,p.env)().get("WEBGPU_CPU_HANDOFF_SIZE_THRESHOLD")&&e.uploadToGPU(l.dataId)}}return r}function v(e){if(null===e)throw Error(`Invalid input value: ${JSON.stringify(e)}`);let t=0,r=[];e.forEach(e=>{if(t+=e.byteLength,r.push(e.byteLength===e.buffer.byteLength?e:new e.constructor(e)),!(e instanceof Float32Array||e instanceof Int32Array||e instanceof Uint8Array))throw Error(`Unsupported TypedArray subtype: ${e.constructor.name}`)});let n=new Uint8Array(t),s=0;return r.forEach(e=>{n.set(new Uint8Array(e.buffer),s),s+=e.byteLength}),n.buffer}let y=void 0!==c&&("undefined"==typeof Blob||"undefined"==typeof atob||"undefined"==typeof btoa);function b(e){return y?c.byteLength(e,"utf8"):new Blob([e]).size}function _(e){if(y)return c.from(e).toString("base64");let t=new Uint8Array(e),r="";for(let e=0,n=t.length;e{let t=e<<13,r=0;for(;(8388608&t)==0;)r-=8388608,t<<=1;return(t&=-8388609)|(r+=0x38800000)},t=new Uint32Array(2048);t[0]=0;for(let r=1;r<1024;r++)t[r]=e(r);for(let e=1024;e<2048;e++)t[e]=0x38000000+(e-1024<<13);return t}(),t=function(){let e=new Uint32Array(64);e[0]=0,e[31]=0x47800000,e[32]=0x80000000,e[63]=0xc7800000;for(let t=1;t<31;t++)e[t]=t<<23;for(let t=33;t<63;t++)e[t]=0x80000000+(t-32<<23);return e}(),r=function(){let e=new Uint32Array(64);for(let t=0;t<64;t++)e[t]=1024;return e[0]=e[32]=0,e}();return n=>{let s=new ArrayBuffer(4*n.length),a=new Uint32Array(s);for(let s=0;s>10]+(1023&o)]+t[o>>10];a[s]=l}return new Float32Array(s)}}},{cc5f092a6233570f:"juSMc","../ops/complex":"98mI6","../ops/tensor":"9hoBJ","../util":"gBRMK","./types":"kDVFi","./composite_array_buffer":"gCHLD","../globals":"dGn2S","../environment":"i6ZjF","@parcel/transformer-js/src/esmodule-helpers.js":"9pCYc"}],juSMc:[function(e,t,r){var n=e("9c62938f1dccc73c"),s=e("aceacb6a4531a9d2"),a="function"==typeof Symbol&&"function"==typeof Symbol.for?Symbol.for("nodejs.util.inspect.custom"):null;function o(e){if(e>0x7fffffff)throw RangeError('The value "'+e+'" is invalid for option "size"');var t=new Uint8Array(e);return Object.setPrototypeOf(t,l.prototype),t}function l(e,t,r){if("number"==typeof e){if("string"==typeof t)throw TypeError('The "string" argument must be of type string. Received type number');return p(e)}return i(e,t,r)}function i(e,t,r){if("string"==typeof e)return function(e,t){if(("string"!=typeof t||""===t)&&(t="utf8"),!l.isEncoding(t))throw TypeError("Unknown encoding: "+t);var r=0|h(e,t),n=o(r),s=n.write(e,t);return s!==r&&(n=n.slice(0,s)),n}(e,t);if(ArrayBuffer.isView(e))return function(e){if(N(e,Uint8Array)){var t=new Uint8Array(e);return d(t.buffer,t.byteOffset,t.byteLength)}return c(e)}(e);if(null==e)throw TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof e);if(N(e,ArrayBuffer)||e&&N(e.buffer,ArrayBuffer)||"undefined"!=typeof SharedArrayBuffer&&(N(e,SharedArrayBuffer)||e&&N(e.buffer,SharedArrayBuffer)))return d(e,t,r);if("number"==typeof e)throw TypeError('The "value" argument must not be of type number. Received type number');var n=e.valueOf&&e.valueOf();if(null!=n&&n!==e)return l.from(n,t,r);var s=function(e){if(l.isBuffer(e)){var t,r=0|f(e.length),n=o(r);return 0===n.length||e.copy(n,0,0,r),n}return void 0!==e.length?"number"!=typeof e.length||(t=e.length)!=t?o(0):c(e):"Buffer"===e.type&&Array.isArray(e.data)?c(e.data):void 0}(e);if(s)return s;if("undefined"!=typeof Symbol&&null!=Symbol.toPrimitive&&"function"==typeof e[Symbol.toPrimitive])return l.from(e[Symbol.toPrimitive]("string"),t,r);throw TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof e)}function u(e){if("number"!=typeof e)throw TypeError('"size" argument must be of type number');if(e<0)throw RangeError('The value "'+e+'" is invalid for option "size"')}function p(e){return u(e),o(e<0?0:0|f(e))}function c(e){for(var t=e.length<0?0:0|f(e.length),r=o(t),n=0;n=0x7fffffff)throw RangeError("Attempt to allocate Buffer larger than maximum size: 0x7fffffff bytes");return 0|e}function h(e,t){if(l.isBuffer(e))return e.length;if(ArrayBuffer.isView(e)||N(e,ArrayBuffer))return e.byteLength;if("string"!=typeof e)throw TypeError('The "string" argument must be one of type string, Buffer, or ArrayBuffer. Received type '+typeof e);var r=e.length,n=arguments.length>2&&!0===arguments[2];if(!n&&0===r)return 0;for(var s=!1;;)switch(t){case"ascii":case"latin1":case"binary":return r;case"utf8":case"utf-8":return w(e).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return 2*r;case"hex":return r>>>1;case"base64":return T(e).length;default:if(s)return n?-1:w(e).length;t=(""+t).toLowerCase(),s=!0}}function m(e,t,r){var s,a,o=!1;if((void 0===t||t<0)&&(t=0),t>this.length||((void 0===r||r>this.length)&&(r=this.length),r<=0||(r>>>=0)<=(t>>>=0)))return"";for(e||(e="utf8");;)switch(e){case"hex":return function(e,t,r){var n=e.length;(!t||t<0)&&(t=0),(!r||r<0||r>n)&&(r=n);for(var s="",a=t;a0x7fffffff?r=0x7fffffff:r<-0x80000000&&(r=-0x80000000),(a=r=+r)!=a&&(r=s?0:e.length-1),r<0&&(r=e.length+r),r>=e.length){if(s)return -1;r=e.length-1}else if(r<0){if(!s)return -1;r=0}if("string"==typeof t&&(t=l.from(t,n)),l.isBuffer(t))return 0===t.length?-1:v(e,t,r,n,s);if("number"==typeof t)return(t&=255,"function"==typeof Uint8Array.prototype.indexOf)?s?Uint8Array.prototype.indexOf.call(e,t,r):Uint8Array.prototype.lastIndexOf.call(e,t,r):v(e,[t],r,n,s);throw TypeError("val must be string, number or Buffer")}function v(e,t,r,n,s){var a,o=1,l=e.length,i=t.length;if(void 0!==n&&("ucs2"===(n=String(n).toLowerCase())||"ucs-2"===n||"utf16le"===n||"utf-16le"===n)){if(e.length<2||t.length<2)return -1;o=2,l/=2,i/=2,r/=2}function u(e,t){return 1===o?e[t]:e.readUInt16BE(t*o)}if(s){var p=-1;for(a=r;al&&(r=l-i),a=r;a>=0;a--){for(var c=!0,d=0;d239?4:u>223?3:u>191?2:1;if(s+c<=r)switch(c){case 1:u<128&&(p=u);break;case 2:(192&(a=e[s+1]))==128&&(i=(31&u)<<6|63&a)>127&&(p=i);break;case 3:a=e[s+1],o=e[s+2],(192&a)==128&&(192&o)==128&&(i=(15&u)<<12|(63&a)<<6|63&o)>2047&&(i<55296||i>57343)&&(p=i);break;case 4:a=e[s+1],o=e[s+2],l=e[s+3],(192&a)==128&&(192&o)==128&&(192&l)==128&&(i=(15&u)<<18|(63&a)<<12|(63&o)<<6|63&l)>65535&&i<1114112&&(p=i)}null===p?(p=65533,c=1):p>65535&&(p-=65536,n.push(p>>>10&1023|55296),p=56320|1023&p),n.push(p),s+=c}return function(e){var t=e.length;if(t<=4096)return String.fromCharCode.apply(String,e);for(var r="",n=0;nr)throw RangeError("Trying to access beyond buffer length")}function _(e,t,r,n,s,a){if(!l.isBuffer(e))throw TypeError('"buffer" argument must be a Buffer instance');if(t>s||te.length)throw RangeError("Index out of range")}function k(e,t,r,n,s,a){if(r+n>e.length||r<0)throw RangeError("Index out of range")}function j(e,t,r,n,a){return t=+t,r>>>=0,a||k(e,t,r,4,34028234663852886e22,-34028234663852886e22),s.write(e,t,r,n,23,4),r+4}function I(e,t,r,n,a){return t=+t,r>>>=0,a||k(e,t,r,8,17976931348623157e292,-17976931348623157e292),s.write(e,t,r,n,52,8),r+8}r.Buffer=l,r.SlowBuffer=function(e){return+e!=e&&(e=0),l.alloc(+e)},r.INSPECT_MAX_BYTES=50,r.kMaxLength=0x7fffffff,l.TYPED_ARRAY_SUPPORT=function(){try{var e=new Uint8Array(1),t={foo:function(){return 42}};return Object.setPrototypeOf(t,Uint8Array.prototype),Object.setPrototypeOf(e,t),42===e.foo()}catch(e){return!1}}(),l.TYPED_ARRAY_SUPPORT||"undefined"==typeof console||"function"!=typeof console.error||console.error("This browser lacks typed array (Uint8Array) support which is required by `buffer` v5.x. Use `buffer` v4.x if you require old browser support."),Object.defineProperty(l.prototype,"parent",{enumerable:!0,get:function(){if(l.isBuffer(this))return this.buffer}}),Object.defineProperty(l.prototype,"offset",{enumerable:!0,get:function(){if(l.isBuffer(this))return this.byteOffset}}),l.poolSize=8192,l.from=function(e,t,r){return i(e,t,r)},Object.setPrototypeOf(l.prototype,Uint8Array.prototype),Object.setPrototypeOf(l,Uint8Array),l.alloc=function(e,t,r){return(u(e),e<=0)?o(e):void 0!==t?"string"==typeof r?o(e).fill(t,r):o(e).fill(t):o(e)},l.allocUnsafe=function(e){return p(e)},l.allocUnsafeSlow=function(e){return p(e)},l.isBuffer=function(e){return null!=e&&!0===e._isBuffer&&e!==l.prototype},l.compare=function(e,t){if(N(e,Uint8Array)&&(e=l.from(e,e.offset,e.byteLength)),N(t,Uint8Array)&&(t=l.from(t,t.offset,t.byteLength)),!l.isBuffer(e)||!l.isBuffer(t))throw TypeError('The "buf1", "buf2" arguments must be one of type Buffer or Uint8Array');if(e===t)return 0;for(var r=e.length,n=t.length,s=0,a=Math.min(r,n);sn.length?l.from(a).copy(n,s):Uint8Array.prototype.set.call(n,a,s);else if(l.isBuffer(a))a.copy(n,s);else throw TypeError('"list" argument must be an Array of Buffers');s+=a.length}return n},l.byteLength=h,l.prototype._isBuffer=!0,l.prototype.swap16=function(){var e=this.length;if(e%2!=0)throw RangeError("Buffer size must be a multiple of 16-bits");for(var t=0;tt&&(e+=" ... "),""},a&&(l.prototype[a]=l.prototype.inspect),l.prototype.compare=function(e,t,r,n,s){if(N(e,Uint8Array)&&(e=l.from(e,e.offset,e.byteLength)),!l.isBuffer(e))throw TypeError('The "target" argument must be one of type Buffer or Uint8Array. Received type '+typeof e);if(void 0===t&&(t=0),void 0===r&&(r=e?e.length:0),void 0===n&&(n=0),void 0===s&&(s=this.length),t<0||r>e.length||n<0||s>this.length)throw RangeError("out of range index");if(n>=s&&t>=r)return 0;if(n>=s)return -1;if(t>=r)return 1;if(t>>>=0,r>>>=0,n>>>=0,s>>>=0,this===e)return 0;for(var a=s-n,o=r-t,i=Math.min(a,o),u=this.slice(n,s),p=e.slice(t,r),c=0;c>>=0,isFinite(r)?(r>>>=0,void 0===n&&(n="utf8")):(n=r,r=void 0);else throw Error("Buffer.write(string, encoding, offset[, length]) is no longer supported");var s,a,o,l,i,u,p,c,d=this.length-t;if((void 0===r||r>d)&&(r=d),e.length>0&&(r<0||t<0)||t>this.length)throw RangeError("Attempt to write outside buffer bounds");n||(n="utf8");for(var f=!1;;)switch(n){case"hex":return function(e,t,r,n){r=Number(r)||0;var s=e.length-r;n?(n=Number(n))>s&&(n=s):n=s;var a=t.length;n>a/2&&(n=a/2);for(var o=0;o>8,s.push(r%256),s.push(n);return s}(e,this.length-p),this,p,c);default:if(f)throw TypeError("Unknown encoding: "+n);n=(""+n).toLowerCase(),f=!0}},l.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}},l.prototype.slice=function(e,t){var r=this.length;e=~~e,t=void 0===t?r:~~t,e<0?(e+=r)<0&&(e=0):e>r&&(e=r),t<0?(t+=r)<0&&(t=0):t>r&&(t=r),t>>=0,t>>>=0,r||b(e,t,this.length);for(var n=this[e],s=1,a=0;++a>>=0,t>>>=0,r||b(e,t,this.length);for(var n=this[e+--t],s=1;t>0&&(s*=256);)n+=this[e+--t]*s;return n},l.prototype.readUint8=l.prototype.readUInt8=function(e,t){return e>>>=0,t||b(e,1,this.length),this[e]},l.prototype.readUint16LE=l.prototype.readUInt16LE=function(e,t){return e>>>=0,t||b(e,2,this.length),this[e]|this[e+1]<<8},l.prototype.readUint16BE=l.prototype.readUInt16BE=function(e,t){return e>>>=0,t||b(e,2,this.length),this[e]<<8|this[e+1]},l.prototype.readUint32LE=l.prototype.readUInt32LE=function(e,t){return e>>>=0,t||b(e,4,this.length),(this[e]|this[e+1]<<8|this[e+2]<<16)+0x1000000*this[e+3]},l.prototype.readUint32BE=l.prototype.readUInt32BE=function(e,t){return e>>>=0,t||b(e,4,this.length),0x1000000*this[e]+(this[e+1]<<16|this[e+2]<<8|this[e+3])},l.prototype.readIntLE=function(e,t,r){e>>>=0,t>>>=0,r||b(e,t,this.length);for(var n=this[e],s=1,a=0;++a=(s*=128)&&(n-=Math.pow(2,8*t)),n},l.prototype.readIntBE=function(e,t,r){e>>>=0,t>>>=0,r||b(e,t,this.length);for(var n=t,s=1,a=this[e+--n];n>0&&(s*=256);)a+=this[e+--n]*s;return a>=(s*=128)&&(a-=Math.pow(2,8*t)),a},l.prototype.readInt8=function(e,t){return(e>>>=0,t||b(e,1,this.length),128&this[e])?-((255-this[e]+1)*1):this[e]},l.prototype.readInt16LE=function(e,t){e>>>=0,t||b(e,2,this.length);var r=this[e]|this[e+1]<<8;return 32768&r?0xffff0000|r:r},l.prototype.readInt16BE=function(e,t){e>>>=0,t||b(e,2,this.length);var r=this[e+1]|this[e]<<8;return 32768&r?0xffff0000|r:r},l.prototype.readInt32LE=function(e,t){return e>>>=0,t||b(e,4,this.length),this[e]|this[e+1]<<8|this[e+2]<<16|this[e+3]<<24},l.prototype.readInt32BE=function(e,t){return e>>>=0,t||b(e,4,this.length),this[e]<<24|this[e+1]<<16|this[e+2]<<8|this[e+3]},l.prototype.readFloatLE=function(e,t){return e>>>=0,t||b(e,4,this.length),s.read(this,e,!0,23,4)},l.prototype.readFloatBE=function(e,t){return e>>>=0,t||b(e,4,this.length),s.read(this,e,!1,23,4)},l.prototype.readDoubleLE=function(e,t){return e>>>=0,t||b(e,8,this.length),s.read(this,e,!0,52,8)},l.prototype.readDoubleBE=function(e,t){return e>>>=0,t||b(e,8,this.length),s.read(this,e,!1,52,8)},l.prototype.writeUintLE=l.prototype.writeUIntLE=function(e,t,r,n){if(e=+e,t>>>=0,r>>>=0,!n){var s=Math.pow(2,8*r)-1;_(this,e,t,r,s,0)}var a=1,o=0;for(this[t]=255&e;++o>>=0,r>>>=0,!n){var s=Math.pow(2,8*r)-1;_(this,e,t,r,s,0)}var a=r-1,o=1;for(this[t+a]=255&e;--a>=0&&(o*=256);)this[t+a]=e/o&255;return t+r},l.prototype.writeUint8=l.prototype.writeUInt8=function(e,t,r){return e=+e,t>>>=0,r||_(this,e,t,1,255,0),this[t]=255&e,t+1},l.prototype.writeUint16LE=l.prototype.writeUInt16LE=function(e,t,r){return e=+e,t>>>=0,r||_(this,e,t,2,65535,0),this[t]=255&e,this[t+1]=e>>>8,t+2},l.prototype.writeUint16BE=l.prototype.writeUInt16BE=function(e,t,r){return e=+e,t>>>=0,r||_(this,e,t,2,65535,0),this[t]=e>>>8,this[t+1]=255&e,t+2},l.prototype.writeUint32LE=l.prototype.writeUInt32LE=function(e,t,r){return e=+e,t>>>=0,r||_(this,e,t,4,0xffffffff,0),this[t+3]=e>>>24,this[t+2]=e>>>16,this[t+1]=e>>>8,this[t]=255&e,t+4},l.prototype.writeUint32BE=l.prototype.writeUInt32BE=function(e,t,r){return e=+e,t>>>=0,r||_(this,e,t,4,0xffffffff,0),this[t]=e>>>24,this[t+1]=e>>>16,this[t+2]=e>>>8,this[t+3]=255&e,t+4},l.prototype.writeIntLE=function(e,t,r,n){if(e=+e,t>>>=0,!n){var s=Math.pow(2,8*r-1);_(this,e,t,r,s-1,-s)}var a=0,o=1,l=0;for(this[t]=255&e;++a>0)-l&255;return t+r},l.prototype.writeIntBE=function(e,t,r,n){if(e=+e,t>>>=0,!n){var s=Math.pow(2,8*r-1);_(this,e,t,r,s-1,-s)}var a=r-1,o=1,l=0;for(this[t+a]=255&e;--a>=0&&(o*=256);)e<0&&0===l&&0!==this[t+a+1]&&(l=1),this[t+a]=(e/o>>0)-l&255;return t+r},l.prototype.writeInt8=function(e,t,r){return e=+e,t>>>=0,r||_(this,e,t,1,127,-128),e<0&&(e=255+e+1),this[t]=255&e,t+1},l.prototype.writeInt16LE=function(e,t,r){return e=+e,t>>>=0,r||_(this,e,t,2,32767,-32768),this[t]=255&e,this[t+1]=e>>>8,t+2},l.prototype.writeInt16BE=function(e,t,r){return e=+e,t>>>=0,r||_(this,e,t,2,32767,-32768),this[t]=e>>>8,this[t+1]=255&e,t+2},l.prototype.writeInt32LE=function(e,t,r){return e=+e,t>>>=0,r||_(this,e,t,4,0x7fffffff,-0x80000000),this[t]=255&e,this[t+1]=e>>>8,this[t+2]=e>>>16,this[t+3]=e>>>24,t+4},l.prototype.writeInt32BE=function(e,t,r){return e=+e,t>>>=0,r||_(this,e,t,4,0x7fffffff,-0x80000000),e<0&&(e=0xffffffff+e+1),this[t]=e>>>24,this[t+1]=e>>>16,this[t+2]=e>>>8,this[t+3]=255&e,t+4},l.prototype.writeFloatLE=function(e,t,r){return j(this,e,t,!0,r)},l.prototype.writeFloatBE=function(e,t,r){return j(this,e,t,!1,r)},l.prototype.writeDoubleLE=function(e,t,r){return I(this,e,t,!0,r)},l.prototype.writeDoubleBE=function(e,t,r){return I(this,e,t,!1,r)},l.prototype.copy=function(e,t,r,n){if(!l.isBuffer(e))throw TypeError("argument should be a Buffer");if(r||(r=0),n||0===n||(n=this.length),t>=e.length&&(t=e.length),t||(t=0),n>0&&n=this.length)throw RangeError("Index out of range");if(n<0)throw RangeError("sourceEnd out of bounds");n>this.length&&(n=this.length),e.length-t>>=0,r=void 0===r?this.length:r>>>0,e||(e=0),"number"==typeof e)for(s=t;s55295&&r<57344){if(!s){if(r>56319||o+1===n){(t-=3)>-1&&a.push(239,191,189);continue}s=r;continue}if(r<56320){(t-=3)>-1&&a.push(239,191,189),s=r;continue}r=(s-55296<<10|r-56320)+65536}else s&&(t-=3)>-1&&a.push(239,191,189);if(s=null,r<128){if((t-=1)<0)break;a.push(r)}else if(r<2048){if((t-=2)<0)break;a.push(r>>6|192,63&r|128)}else if(r<65536){if((t-=3)<0)break;a.push(r>>12|224,r>>6&63|128,63&r|128)}else if(r<1114112){if((t-=4)<0)break;a.push(r>>18|240,r>>12&63|128,r>>6&63|128,63&r|128)}else throw Error("Invalid code point")}return a}function T(e){return n.toByteArray(function(e){if((e=(e=e.split("=")[0]).trim().replace(C,"")).length<2)return"";for(;e.length%4!=0;)e+="=";return e}(e))}function S(e,t,r,n){for(var s=0;s=t.length)&&!(s>=e.length);++s)t[s+r]=e[s];return s}function N(e,t){return e instanceof t||null!=e&&null!=e.constructor&&null!=e.constructor.name&&e.constructor.name===t.name}var E=function(){for(var e="0123456789abcdef",t=Array(256),r=0;r<16;++r)for(var n=16*r,s=0;s<16;++s)t[n+s]=e[r]+e[s];return t}()},{"9c62938f1dccc73c":"iaOvk",aceacb6a4531a9d2:"9RC4J"}],iaOvk:[function(e,t,r){r.byteLength=function(e){var t=u(e),r=t[0],n=t[1];return(r+n)*3/4-n},r.toByteArray=function(e){var t,r,n=u(e),o=n[0],l=n[1],i=new a((o+l)*3/4-l),p=0,c=l>0?o-4:o;for(r=0;r>16&255,i[p++]=t>>8&255,i[p++]=255&t;return 2===l&&(t=s[e.charCodeAt(r)]<<2|s[e.charCodeAt(r+1)]>>4,i[p++]=255&t),1===l&&(t=s[e.charCodeAt(r)]<<10|s[e.charCodeAt(r+1)]<<4|s[e.charCodeAt(r+2)]>>2,i[p++]=t>>8&255,i[p++]=255&t),i},r.fromByteArray=function(e){for(var t,r=e.length,s=r%3,a=[],o=0,l=r-s;o>18&63]+n[s>>12&63]+n[s>>6&63]+n[63&s]);return a.join("")}(e,o,o+16383>l?l:o+16383));return 1===s?a.push(n[(t=e[r-1])>>2]+n[t<<4&63]+"=="):2===s&&a.push(n[(t=(e[r-2]<<8)+e[r-1])>>10]+n[t>>4&63]+n[t<<2&63]+"="),a.join("")};for(var n=[],s=[],a="undefined"!=typeof Uint8Array?Uint8Array:Array,o="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",l=0,i=o.length;l0)throw Error("Invalid string. Length must be a multiple of 4");var r=e.indexOf("=");-1===r&&(r=t);var n=r===t?0:4-r%4;return[r,n]}s["-".charCodeAt(0)]=62,s["_".charCodeAt(0)]=63},{}],"9RC4J":[function(e,t,r){/*! ieee754. BSD-3-Clause License. Feross Aboukhadijeh*/r.read=function(e,t,r,n,s){var a,o,l=8*s-n-1,i=(1<>1,p=-7,c=r?s-1:0,d=r?-1:1,f=e[t+c];for(c+=d,a=f&(1<<-p)-1,f>>=-p,p+=l;p>0;a=256*a+e[t+c],c+=d,p-=8);for(o=a&(1<<-p)-1,a>>=-p,p+=n;p>0;o=256*o+e[t+c],c+=d,p-=8);if(0===a)a=1-u;else{if(a===i)return o?NaN:1/0*(f?-1:1);o+=Math.pow(2,n),a-=u}return(f?-1:1)*o*Math.pow(2,a-n)},r.write=function(e,t,r,n,s,a){var o,l,i,u=8*a-s-1,p=(1<>1,d=23===s?5960464477539062e-23:0,f=n?0:a-1,h=n?1:-1,m=t<0||0===t&&1/t<0?1:0;for(isNaN(t=Math.abs(t))||t===1/0?(l=isNaN(t)?1:0,o=p):(o=Math.floor(Math.log(t)/Math.LN2),t*(i=Math.pow(2,-o))<1&&(o--,i*=2),o+c>=1?t+=d/i:t+=d*Math.pow(2,1-c),t*i>=2&&(o++,i/=2),o+c>=p?(l=0,o=p):o+c>=1?(l=(t*i-1)*Math.pow(2,s),o+=c):(l=t*Math.pow(2,c-1)*Math.pow(2,s),o=0));s>=8;e[r+f]=255&l,f+=h,l/=256,s-=8);for(o=o<0;e[r+f]=255&o,f+=h,o/=256,u-=8);e[r+f-h]|=128*m}},{}],"98mI6":[function(e,t,r){/** * @license * Copyright 2020 Google LLC. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. * ============================================================================= */var n=e("@parcel/transformer-js/src/esmodule-helpers.js");n.defineInteropFlag(r),n.export(r,"complex",()=>i);var s=e("../engine"),a=e("../kernel_names"),o=e("../tensor_util_env"),l=e("../util");let i=/* @__PURE__ */(0,e("./operation").op)({complex_:function(e,t){let r=(0,o.convertToTensor)(e,"real","complex"),n=(0,o.convertToTensor)(t,"imag","complex");return l.assertShapesMatch(r.shape,n.shape,`real and imag shapes, ${r.shape} and ${n.shape}, must match in call to tf.complex().`),(0,s.ENGINE).runKernel(a.Complex,{real:r,imag:n})}})},{"../engine":"6eJyD","../kernel_names":"aqvy4","../tensor_util_env":"g1Qlv","../util":"gBRMK","./operation":"2kGjz","@parcel/transformer-js/src/esmodule-helpers.js":"9pCYc"}],g1Qlv:[function(e,t,r){/** * @license * Copyright 2018 Google LLC. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. * ============================================================================= */var n=e("@parcel/transformer-js/src/esmodule-helpers.js");n.defineInteropFlag(r),n.export(r,"inferShape",()=>p),n.export(r,"convertToTensor",()=>d),n.export(r,"convertToTensorArray",()=>f);var s=e("./engine"),a=e("./environment"),o=e("./tensor"),l=e("./types"),i=e("./util"),u=e("./util_base");function p(e,t){let r=e;if((0,i.isTypedArray)(e))return"string"===t?[]:[e.length];if((0,l.isWebGLData)(e)){let t=e.channels||"RGBA";return[e.height,e.width*t.length]}if((0,l.isWebGPUData)(e))return[e.buffer.size/(null==t?4:(0,u.bytesPerElement)(t))];if(!Array.isArray(e))return[];let n=[];for(;Array.isArray(r)||(0,i.isTypedArray)(r)&&"string"!==t;)n.push(r.length),r=r[0];return Array.isArray(e)&&(0,a.env)().getBool("TENSORLIKE_CHECK_SHAPE_CONSISTENCY")&&function e(t,r,n){if(n=n||[],!Array.isArray(t)&&!(0,i.isTypedArray)(t)){(0,i.assert)(0===r.length,()=>`Element arr[${n.join("][")}] is a primitive, but should be an array/TypedArray of ${r[0]} elements`);return}(0,i.assert)(r.length>0,()=>`Element arr[${n.join("][")}] should be a primitive, but is an array of ${t.length} elements`),(0,i.assert)(t.length===r[0],()=>`Element arr[${n.join("][")}] should have ${r[0]} elements, but has ${t.length} elements`);let s=r.slice(1);for(let r=0;r=0&&(a=n),c(n,a,t,r),null==e||!(0,i.isTypedArray)(e)&&!Array.isArray(e)&&"number"!=typeof e&&"boolean"!=typeof e&&"string"!=typeof e){let n=null==e?"null":e.constructor.name;throw Error(`Argument '${t}' passed to '${r}' must be a Tensor or TensorLike, but got '${n}'`)}let l=p(e,a);(0,i.isTypedArray)(e)||Array.isArray(e)||(e=[e]);let u="string"!==a?(0,i.toTypedArray)(e,a):(0,i.flatten)(e,[],!0);return(0,s.ENGINE).makeTensor(u,l,a)}function f(e,t,r,n="numeric"){if(!Array.isArray(e))throw Error(`Argument ${t} passed to ${r} must be a \`Tensor[]\` or \`TensorLike[]\``);return e.map((e,s)=>d(e,`${t}[${s}]`,r,n))}},{"./engine":"6eJyD","./environment":"i6ZjF","./tensor":"cZ8UW","./types":"ahcVG","./util":"gBRMK","./util_base":"8U7kO","@parcel/transformer-js/src/esmodule-helpers.js":"9pCYc"}],"2kGjz":[function(e,t,r){/** * @license * Copyright 2018 Google LLC. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. * ============================================================================= */var n=e("@parcel/transformer-js/src/esmodule-helpers.js");n.defineInteropFlag(r),n.export(r,"OP_SCOPE_SUFFIX",()=>o),n.export(r,"op",()=>l);var s=e("../engine"),a=e("../util");let o="__op";function l(e){let t=Object.keys(e);if(1!==t.length)throw Error(`Please provide an object with a single key (operation name) mapping to a function. Got an object with ${t.length} keys.`);let r=t[0],n=e[r];r.endsWith("_")&&(r=r.substring(0,r.length-1));let l=(...e)=>{(0,s.ENGINE).startScope(r);try{let t=n(...e);return(0,a.isPromise)(t)&&console.error("Cannot return a Promise inside of tidy."),(0,s.ENGINE).endScope(t),t}catch(e){throw(0,s.ENGINE).endScope(null),e}};return Object.defineProperty(l,"name",{value:r+=o,configurable:!0}),l}},{"../engine":"6eJyD","../util":"gBRMK","@parcel/transformer-js/src/esmodule-helpers.js":"9pCYc"}],"9hoBJ":[function(e,t,r){/** * @license * Copyright 2018 Google LLC. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. * ============================================================================= */var n=e("@parcel/transformer-js/src/esmodule-helpers.js");n.defineInteropFlag(r),n.export(r,"tensor",()=>o);var s=e("../tensor_util_env"),a=e("./tensor_ops_util");function o(e,t,r){let n=(0,s.inferShape)(e,r);return(0,a.makeTensor)(e,t,n,r)}},{"../tensor_util_env":"g1Qlv","./tensor_ops_util":"c7cet","@parcel/transformer-js/src/esmodule-helpers.js":"9pCYc"}],c7cet:[function(e,t,r){/** * @license * Copyright 2018 Google LLC. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. * ============================================================================= */var n=e("@parcel/transformer-js/src/esmodule-helpers.js");n.defineInteropFlag(r),n.export(r,"makeTensor",()=>l);var s=e("../engine"),a=e("../types"),o=e("../util");function l(e,t,r,n){if(null==n)n=(0,o.inferDtype)(e);else if("complex64"===n)throw Error("Cannot construct a complex64 tensor directly. Please use tf.complex(real, imag).");if((0,a.isWebGPUData)(e)||(0,a.isWebGLData)(e)){if("float32"!==n&&"int32"!==n)throw Error(`Creating tensor from GPU data only supports 'float32'|'int32' dtype, while the dtype is ${n}.`);return(0,s.ENGINE).backend.createTensorFromGPUData(e,t||r,n)}if(!(0,o.isTypedArray)(e)&&!Array.isArray(e)&&"number"!=typeof e&&"boolean"!=typeof e&&"string"!=typeof e)throw Error("values passed to tensor(values) must be a number/boolean/string or an array of numbers/booleans/strings, or a TypedArray");if(null!=t){(0,o.assertNonNegativeIntegerDimensions)(t);let e=(0,o.sizeFromShape)(t),n=(0,o.sizeFromShape)(r);(0,o.assert)(e===n,()=>`Based on the provided shape, [${t}], the tensor should have ${e} values but has ${n}`);for(let e=0;e`Error creating a new Tensor. Inferred shape (${r}) does not match the provided shape (${t}). `)}}return(0,o.isTypedArray)(e)||Array.isArray(e)||(e=[e]),t=t||r,e="string"!==n?(0,o.toTypedArray)(e,n):(0,o.flatten)(e,[],!0),(0,s.ENGINE).makeTensor(e,t,n)}},{"../engine":"6eJyD","../types":"ahcVG","../util":"gBRMK","@parcel/transformer-js/src/esmodule-helpers.js":"9pCYc"}],kDVFi:[function(e,t,r){/** * @license * Copyright 2018 Google LLC. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. * ============================================================================= */var n=e("@parcel/transformer-js/src/esmodule-helpers.js");n.defineInteropFlag(r),n.export(r,"DTYPE_VALUE_SIZE_MAP",()=>s);let s={float32:4,float16:2,int32:4,uint16:2,uint8:1,bool:1,complex64:8}},{"@parcel/transformer-js/src/esmodule-helpers.js":"9pCYc"}],gCHLD:[function(e,t,r){var n=e("@parcel/transformer-js/src/esmodule-helpers.js");n.defineInteropFlag(r),n.export(r,"CompositeArrayBuffer",()=>a),n.export(r,"search",()=>o);var s=e("../util");class a{static join(e){return new a(e).slice()}constructor(e){if(this.shards=[],this.previousShardIndex=0,null==e||(e instanceof Array||(e=[e]),0===(e=e.map(e=>s.isTypedArray(e)?e.buffer:e)).length))return;this.bufferUniformSize=e[0].byteLength;let t=0;for(let r=0;r=this.byteLength)return -1;if(null!=this.bufferUniformSize)return this.previousShardIndex=Math.floor(e/this.bufferUniformSize),this.previousShardIndex;function t(t){return e=t.end?1:0}if(0===t(this.shards[this.previousShardIndex]))return this.previousShardIndex;let r=o(this.shards,t);return -1===r?-1:(this.previousShardIndex=r,this.previousShardIndex)}}function o(e,t){let r=0,n=e.length;for(;r<=n;){let s=Math.floor((n-r)/2)+r,a=t(e[s]);if(0===a)return s;a<0?n=s:r=s+1}return -1}},{"../util":"gBRMK","@parcel/transformer-js/src/esmodule-helpers.js":"9pCYc"}],dGn2S:[function(e,t,r){/** * @license * Copyright 2018 Google LLC. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. * ============================================================================= */var n=e("@parcel/transformer-js/src/esmodule-helpers.js");n.defineInteropFlag(r),n.export(r,"enableProdMode",()=>i),n.export(r,"enableDebugMode",()=>u),n.export(r,"disableDeprecationWarnings",()=>p),n.export(r,"deprecationWarn",()=>c),n.export(r,"disposeVariables",()=>d),n.export(r,"engine",()=>f),n.export(r,"memory",()=>h),n.export(r,"profile",()=>m),n.export(r,"tidy",()=>g),n.export(r,"dispose",()=>x),n.export(r,"keep",()=>v),n.export(r,"time",()=>y),n.export(r,"setBackend",()=>b),n.export(r,"ready",()=>_),n.export(r,"getBackend",()=>k),n.export(r,"removeBackend",()=>j),n.export(r,"findBackend",()=>I),n.export(r,"findBackendFactory",()=>C),n.export(r,"registerBackend",()=>w),n.export(r,"backend",()=>T),n.export(r,"setPlatform",()=>S);var s=e("./engine"),a=e("./environment"),o=e("./tensor"),l=e("./tensor_util");function i(){(0,a.env)().set("PROD",!0)}function u(){(0,a.env)().set("DEBUG",!0)}function p(){(0,a.env)().set("DEPRECATION_WARNINGS_ENABLED",!1),console.warn("TensorFlow.js deprecation warnings have been disabled.")}function c(e){(0,a.env)().getBool("DEPRECATION_WARNINGS_ENABLED")&&console.warn(e+" You can disable deprecation warnings with tf.disableDeprecationWarnings().")}function d(){(0,s.ENGINE).disposeVariables()}function f(){return s.ENGINE}function h(){return(0,s.ENGINE).memory()}function m(e){return(0,s.ENGINE).profile(e)}function g(e,t){return(0,s.ENGINE).tidy(e,t)}function x(e){(0,l.getTensorsInContainer)(e).forEach(e=>e.dispose())}function v(e){return(0,s.ENGINE).keep(e)}function y(e){return(0,s.ENGINE).time(e)}function b(e){return(0,s.ENGINE).setBackend(e)}function _(){return(0,s.ENGINE).ready()}function k(){return s.ENGINE.backendName}function j(e){(0,s.ENGINE).removeBackend(e)}function I(e){return(0,s.ENGINE).findBackend(e)}function C(e){return(0,s.ENGINE).findBackendFactory(e)}function w(e,t,r=1){return(0,s.ENGINE).registerBackend(e,t,r)}function T(){return s.ENGINE.backend}function S(e,t){(0,a.env)().setPlatform(e,t)}(0,o.setDeprecationWarningFn)(c)},{"./engine":"6eJyD","./environment":"i6ZjF","./tensor":"cZ8UW","./tensor_util":"jgr40","@parcel/transformer-js/src/esmodule-helpers.js":"9pCYc"}],"570tD":[function(e,t,r){/** * @license * Copyright 2018 Google LLC. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. * ============================================================================= */var n=e("@parcel/transformer-js/src/esmodule-helpers.js");n.defineInteropFlag(r),n.export(r,"IORouterRegistry",()=>s),n.export(r,"registerSaveRouter",()=>a),n.export(r,"registerLoadRouter",()=>o),n.export(r,"getSaveHandlers",()=>l),n.export(r,"getLoadHandlers",()=>i);class s{constructor(){this.saveRouters=[],this.loadRouters=[]}static getInstance(){return null==s.instance&&(s.instance=new s),s.instance}static registerSaveRouter(e){s.getInstance().saveRouters.push(e)}static registerLoadRouter(e){s.getInstance().loadRouters.push(e)}static getSaveHandlers(e){return s.getHandlers(e,"save")}static getLoadHandlers(e,t){return s.getHandlers(e,"load",t)}static getHandlers(e,t,r){let n=[];return("load"===t?s.getInstance().loadRouters:s.getInstance().saveRouters).forEach(t=>{let s=t(e,r);null!==s&&n.push(s)}),n}}let a=e=>s.registerSaveRouter(e),o=e=>s.registerLoadRouter(e),l=e=>s.getSaveHandlers(e),i=(e,t)=>s.getLoadHandlers(e,t)},{"@parcel/transformer-js/src/esmodule-helpers.js":"9pCYc"}],jio7e:[function(e,t,r){/** * @license * Copyright 2018 Google LLC. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. * ============================================================================= */var n=e("@parcel/transformer-js/src/esmodule-helpers.js");n.defineInteropFlag(r),n.export(r,"purgeLocalStorageArtifacts",()=>c),n.export(r,"BrowserLocalStorage",()=>m),n.export(r,"localStorageRouter",()=>g),n.export(r,"browserLocalStorage",()=>x),n.export(r,"BrowserLocalStorageManager",()=>v),e("../flags");var s=e("../environment"),a=e("../util"),o=e("./io_utils"),l=e("./composite_array_buffer"),i=e("./router_registry");let u="tensorflowjs_models",p="info";function c(){if(!(0,s.env)().getBool("IS_BROWSER")||"undefined"==typeof window||void 0===window.localStorage)throw Error("purgeLocalStorageModels() cannot proceed because local storage is unavailable in the current environment.");let e=window.localStorage,t=[];for(let r=0;rs.length){e.removeItem(n);let r=h(n);-1===t.indexOf(r)&&t.push(r)}}return t}function d(e){return{info:[u,e,p].join("/"),topology:[u,e,"model_topology"].join("/"),weightSpecs:[u,e,"weight_specs"].join("/"),weightData:[u,e,"weight_data"].join("/"),modelMetadata:[u,e,"model_metadata"].join("/")}}function f(e){for(let t of Object.values(e))window.localStorage.removeItem(t)}function h(e){let t=e.split("/");if(t.length<3)throw Error(`Invalid key format: ${e}`);return t.slice(1,t.length-1).join("/")}class m{constructor(e){if(!(0,s.env)().getBool("IS_BROWSER")||"undefined"==typeof window||void 0===window.localStorage)throw Error("The current environment does not support local storage.");if(this.LS=window.localStorage,null==e||!e)throw Error("For local storage, modelPath must not be null, undefined or empty.");this.modelPath=e,this.keys=d(this.modelPath)}async save(e){if(e.modelTopology instanceof ArrayBuffer)throw Error("BrowserLocalStorage.save() does not support saving model topology in binary formats yet.");{let t=JSON.stringify(e.modelTopology),r=JSON.stringify(e.weightSpecs),n=(0,o.getModelArtifactsInfoForJSON)(e),s=(0,l.CompositeArrayBuffer).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,r),this.LS.setItem(this.keys.weightData,(0,o.arrayBufferToBase64String)(s));let a={format:e.format,generatedBy:e.generatedBy,convertedBy:e.convertedBy,signature:null!=e.signature?e.signature:void 0,userDefinedMetadata:null!=e.userDefinedMetadata?e.userDefinedMetadata:void 0,modelInitializer:null!=e.modelInitializer?e.modelInitializer:void 0,initializerSignature:null!=e.initializerSignature?e.initializerSignature:void 0,trainingConfig:null!=e.trainingConfig?e.trainingConfig:void 0};return this.LS.setItem(this.keys.modelMetadata,JSON.stringify(a)),{modelArtifactsInfo:n}}catch(e){throw f(this.keys),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(null==e)throw Error(`In local storage, there is no model with name '${this.modelPath}'`);if("JSON"!==e.modelTopologyType)throw Error("BrowserLocalStorage does not support loading non-JSON model topology yet.");let t={},r=JSON.parse(this.LS.getItem(this.keys.topology));if(null==r)throw Error(`In local storage, the topology of model '${this.modelPath}' is missing.`);t.modelTopology=r;let n=JSON.parse(this.LS.getItem(this.keys.weightSpecs));if(null==n)throw 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(null!=s){let e=JSON.parse(s);t.format=e.format,t.generatedBy=e.generatedBy,t.convertedBy=e.convertedBy,null!=e.signature&&(t.signature=e.signature),null!=e.userDefinedMetadata&&(t.userDefinedMetadata=e.userDefinedMetadata),null!=e.modelInitializer&&(t.modelInitializer=e.modelInitializer),null!=e.initializerSignature&&(t.initializerSignature=e.initializerSignature),null!=e.trainingConfig&&(t.trainingConfig=e.trainingConfig)}let a=this.LS.getItem(this.keys.weightData);if(null==a)throw Error(`In local storage, the binary weight values of model '${this.modelPath}' are missing.`);return t.weightData=(0,o.base64StringToArrayBuffer)(a),t}}m.URL_SCHEME="localstorage://";let g=e=>(0,s.env)().getBool("IS_BROWSER")&&!Array.isArray(e)&&e.startsWith(m.URL_SCHEME)?x(e.slice(m.URL_SCHEME.length)):null;function x(e){return new m(e)}(0,i.IORouterRegistry).registerSaveRouter(g),(0,i.IORouterRegistry).registerLoadRouter(g);class v{constructor(){(0,a.assert)((0,s.env)().getBool("IS_BROWSER"),()=>"Current environment is not a web browser"),(0,a.assert)("undefined"==typeof window||void 0!==window.localStorage,()=>"Current browser does not appear to support localStorage"),this.LS=window.localStorage}async listModels(){let e={},t=u+"/",r="/"+p;for(let n=0;no),n.export(r,"moveModel",()=>d),n.export(r,"copyModel",()=>c),n.export(r,"removeModel",()=>p),n.export(r,"listModels",()=>u);var s=e("../util"),a=e("./router_registry");class o{constructor(){this.managers={}}static getInstance(){return null==o.instance&&(o.instance=new o),o.instance}static registerManager(e,t){(0,s.assert)(null!=e,()=>"scheme must not be undefined or null."),e.endsWith("://")&&(e=e.slice(0,e.indexOf("://"))),(0,s.assert)(e.length>0,()=>"scheme must not be an empty string.");let r=o.getInstance();(0,s.assert)(null==r.managers[e],()=>`A model store manager is already registered for scheme '${e}'.`),r.managers[e]=t}static getManager(e){let t=o.getInstance().managers[e];if(null==t)throw Error(`Cannot find model manager for scheme '${e}'`);return t}static getSchemes(){return Object.keys(o.getInstance().managers)}}function l(e){if(-1===e.indexOf("://"))throw Error(`The url string provided does not contain a scheme. Supported schemes are: ${o.getSchemes().join(",")}`);return{scheme:e.split("://")[0],path:e.split("://")[1]}}async function i(e,t,r=!1){(0,s.assert)(e!==t,()=>`Old path and new path are the same: '${e}'`);let n=(0,a.IORouterRegistry).getLoadHandlers(e);(0,s.assert)(n.length>0,()=>`Copying failed because no load handler is found for source URL ${e}.`),(0,s.assert)(n.length<2,()=>`Copying failed because more than one (${n.length}) load handlers for source URL ${e}.`);let u=n[0],p=(0,a.IORouterRegistry).getSaveHandlers(t);(0,s.assert)(p.length>0,()=>`Copying failed because no save handler is found for destination URL ${t}.`),(0,s.assert)(p.length<2,()=>`Copying failed because more than one (${n.length}) save handlers for destination URL ${t}.`);let c=p[0],d=l(e).scheme,f=l(e).path,h=d===l(e).scheme,m=await u.load();r&&h&&await o.getManager(d).removeModel(f);let g=await c.save(m);return r&&!h&&await o.getManager(d).removeModel(f),g.modelArtifactsInfo}async function u(){let e=o.getSchemes(),t={};for(let r of e){let e=await o.getManager(r).listModels();for(let n in e)t[r+"://"+n]=e[n]}return t}async function p(e){let t=l(e);return o.getManager(t.scheme).removeModel(t.path)}async function c(e,t){return i(e,t,!1)}async function d(e,t){return i(e,t,!0)}},{"../util":"gBRMK","./router_registry":"570tD","@parcel/transformer-js/src/esmodule-helpers.js":"9pCYc"}],hYiSu:[function(e,t,r){let n;/** * @license * Copyright 2019 Google LLC. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. * ============================================================================= */var s=e("@parcel/transformer-js/src/esmodule-helpers.js");s.defineInteropFlag(r),s.export(r,"getNodeFetch",()=>l),s.export(r,"resetSystemFetch",()=>i),s.export(r,"setSystemFetch",()=>u),s.export(r,"getSystemFetch",()=>p),s.export(r,"PlatformNode",()=>c);var a=e("../environment"),o=e("9eae209353a3d608");let l={importFetch:()=>e("dfcdb939bb56fbb8")};function i(){n=null}function u(e){n=e}function p(){return n}class c{constructor(){this.util=e("3818a9dc927c4605"),this.textEncoder=new this.util.TextEncoder}fetch(e,t){return null!=(0,a.env)().global.fetch?(0,a.env)().global.fetch(e,t):(null==n&&(n=l.importFetch()),n(e,t))}now(){let e=o.hrtime();return 1e3*e[0]+e[1]/1e6}encode(e,t){if("utf-8"!==t&&"utf8"!==t)throw Error(`Node built-in encoder only supports utf-8, but got ${t}`);return this.textEncoder.encode(e)}decode(e,t){return 0===e.length?"":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)}}(0,a.env)().get("IS_NODE")&&!(0,a.env)().get("IS_BROWSER")&&(0,a.env)().setPlatform("node",new c)},{"9eae209353a3d608":"lTIIq","../environment":"i6ZjF",dfcdb939bb56fbb8:"b9oDQ","3818a9dc927c4605":"b9oDQ","@parcel/transformer-js/src/esmodule-helpers.js":"9pCYc"}],b9oDQ:[function(e,t,r){},{}],"3SrXS":[function(e,t,r){/** * @license * Copyright 2020 Google Inc. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. * ============================================================================= */var n=e("@parcel/transformer-js/src/esmodule-helpers.js");n.defineInteropFlag(r),n.export(r,"buffer",()=>o);var s=e("../tensor"),a=e("../util");function o(e,t="float32",r){return t=t||"float32",a.assertNonNegativeIntegerDimensions(e),new s.TensorBuffer(e,t,r)}},{"../tensor":"cZ8UW","../util":"gBRMK","@parcel/transformer-js/src/esmodule-helpers.js":"9pCYc"}],ekSnT:[function(e,t,r){/** * @license * Copyright 2020 Google Inc. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. * ============================================================================= */var n=e("@parcel/transformer-js/src/esmodule-helpers.js");n.defineInteropFlag(r),n.export(r,"cast",()=>i);var s=e("../engine"),a=e("../kernel_names"),o=e("../tensor_util_env"),l=e("../util");let i=/* @__PURE__ */(0,e("./operation").op)({cast_:function(e,t){let r=(0,o.convertToTensor)(e,"x","cast");if(!l.isValidDtype(t))throw Error(`Failed to cast to unknown dtype ${t}`);if("string"===t&&"string"!==r.dtype||"string"!==t&&"string"===r.dtype)throw Error("Only strings can be casted to strings");return(0,s.ENGINE).runKernel(a.Cast,{x:r},{dtype:t})}})},{"../engine":"6eJyD","../kernel_names":"aqvy4","../tensor_util_env":"g1Qlv","../util":"gBRMK","./operation":"2kGjz","@parcel/transformer-js/src/esmodule-helpers.js":"9pCYc"}],gI2Tp:[function(e,t,r){/** * @license * Copyright 2020 Google LLC. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. * ============================================================================= */var n=e("@parcel/transformer-js/src/esmodule-helpers.js");n.defineInteropFlag(r),n.export(r,"clone",()=>l);var s=e("../engine"),a=e("../kernel_names"),o=e("../tensor_util_env");let l=/* @__PURE__ */(0,e("./operation").op)({clone_:function(e){let t=(0,o.convertToTensor)(e,"x","clone","string_or_numeric");return(0,s.ENGINE).runKernel(a.Identity,{x:t})}})},{"../engine":"6eJyD","../kernel_names":"aqvy4","../tensor_util_env":"g1Qlv","./operation":"2kGjz","@parcel/transformer-js/src/esmodule-helpers.js":"9pCYc"}],"4ToBR":[function(e,t,r){/** * @license * Copyright 2020 Google Inc. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. * ============================================================================= */var n=e("@parcel/transformer-js/src/esmodule-helpers.js");function s(e,t=!1){console.log(e.toString(t))}n.defineInteropFlag(r),n.export(r,"print",()=>s)},{"@parcel/transformer-js/src/esmodule-helpers.js":"9pCYc"}],k0GPL:[function(e,t,r){/** * @license * Copyright 2022 Google LLC. * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. * ============================================================================= */var n=e("@parcel/transformer-js/src/esmodule-helpers.js");n.defineInteropFlag(r),n.export(r,"registerOptimizers",()=>f);var s=e("./adadelta_optimizer"),a=e("./adagrad_optimizer"),o=e("./adam_optimizer"),l=e("./adamax_optimizer"),i=e("./momentum_optimizer"),u=e("./rmsprop_optimizer"),p=e("./sgd_optimizer"),c=e("../serialization");let d=[s.AdadeltaOptimizer,a.AdagradOptimizer,o.AdamOptimizer,l.AdamaxOptimizer,i.MomentumOptimizer,u.RMSPropOptimizer,p.SGDOptimizer];function f(){for(let e of d)(0,c.registerClass)(e)}},{"./adadelta_optimizer":"1rtJl","./adagrad_optimizer":"f9OX9","./adam_optimizer":"i7Li7","./adamax_optimizer":"gb2az","./momentum_optimizer":"ka4Mb","./rmsprop_optimizer":"iwr1K","./sgd_optimizer":"aaxfI","../serialization":"3Y583","@parcel/transformer-js/src/esmodule-helpers.js":"9pCYc"}],"1rtJl":[function(e,t,r){/** * @license * Copyright 2018 Google LLC. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. * ============================================================================= */var n=e("@parcel/transformer-js/src/esmodule-helpers.js");n.defineInteropFlag(r),n.export(r,"AdadeltaOptimizer",()=>f);var s=e("../engine"),a=e("../globals"),o=e("../ops/add"),l=e("../ops/div"),i=e("../ops/mul"),u=e("../ops/ops"),p=e("../ops/square"),c=e("../ops/zeros_like"),d=e("./optimizer");class f extends d.Optimizer{static get className(){return"Adadelta"}constructor(e,t,r=null){super(),this.learningRate=e,this.rho=t,this.epsilon=r,this.accumulatedGrads=[],this.accumulatedUpdates=[],null==r&&(this.epsilon=(0,s.ENGINE).backend.epsilon())}applyGradients(e){(Array.isArray(e)?e.map(e=>e.name):Object.keys(e)).forEach((t,r)=>{let n=s.ENGINE.registeredVariables[t];null==this.accumulatedGrads[r]&&(this.accumulatedGrads[r]={originalName:`${t}/accum_grad`,variable:(0,a.tidy)(()=>(0,c.zerosLike)(n).variable(!1))}),null==this.accumulatedUpdates[r]&&(this.accumulatedUpdates[r]={originalName:`${t}/accum_var`,variable:(0,a.tidy)(()=>(0,c.zerosLike)(n).variable(!1))});let d=Array.isArray(e)?e[r].tensor:e[t];if(null==d)return;let f=this.accumulatedGrads[r].variable,h=this.accumulatedUpdates[r].variable;(0,a.tidy)(()=>{let e=(0,o.add)((0,i.mul)(f,this.rho),(0,i.mul)((0,p.square)(d),1-this.rho)),t=(0,i.mul)((0,l.div)((0,u.sqrt)((0,o.add)(h,this.epsilon)),(0,u.sqrt)((0,o.add)(f,this.epsilon))),d),r=(0,o.add)((0,i.mul)(h,this.rho),(0,i.mul)((0,p.square)(t),1-this.rho));f.assign(e),h.assign(r);let s=(0,o.add)((0,i.mul)(t,-this.learningRate),n);n.assign(s)})}),this.incrementIterations()}dispose(){null!=this.accumulatedUpdates&&((0,a.dispose)(this.accumulatedGrads.map(e=>e.variable)),(0,a.dispose)(this.accumulatedUpdates.map(e=>e.variable)))}async getWeights(){let e=[...this.accumulatedGrads,...this.accumulatedUpdates];return[await this.saveIterations()].concat(e.map(e=>({name:e.originalName,tensor:e.variable})))}async setWeights(e){let t=(e=await this.extractIterations(e)).length/2;this.accumulatedGrads=e.slice(0,t).map(e=>({originalName:e.name,variable:e.tensor.variable(!1)})),this.accumulatedUpdates=e.slice(t,2*t).map(e=>({originalName:e.name,variable:e.tensor.variable(!1)}))}getConfig(){return{learningRate:this.learningRate,rho:this.rho,epsilon:this.epsilon}}static fromConfig(e,t){return new e(t.learningRate,t.rho,t.epsilon)}}},{"../engine":"6eJyD","../globals":"dGn2S","../ops/add":"g9v2X","../ops/div":"f7E5D","../ops/mul":"gPetX","../ops/ops":"hRONF","../ops/square":"1Qqi7","../ops/zeros_like":"gjKam","./optimizer":"11gW1","@parcel/transformer-js/src/esmodule-helpers.js":"9pCYc"}],g9v2X:[function(e,t,r){/** * @license * Copyright 2020 Google LLC. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. * ============================================================================= */var n=e("@parcel/transformer-js/src/esmodule-helpers.js");n.defineInteropFlag(r),n.export(r,"add",()=>i);var s=e("../engine"),a=e("../kernel_names"),o=e("../tensor_util"),l=e("../tensor_util_env");let i=/* @__PURE__ */(0,e("./operation").op)({add_:function(e,t){let r=(0,l.convertToTensor)(e,"a","add"),n=(0,l.convertToTensor)(t,"b","add");[r,n]=(0,o.makeTypesMatch)(r,n);let i={a:r,b:n};return(0,s.ENGINE).runKernel(a.Add,i)}})},{"../engine":"6eJyD","../kernel_names":"aqvy4","../tensor_util":"jgr40","../tensor_util_env":"g1Qlv","./operation":"2kGjz","@parcel/transformer-js/src/esmodule-helpers.js":"9pCYc"}],f7E5D:[function(e,t,r){/** * @license * Copyright 2020 Google LLC. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. * ============================================================================= */var n=e("@parcel/transformer-js/src/esmodule-helpers.js");n.defineInteropFlag(r),n.export(r,"div",()=>u);var s=e("../engine"),a=e("../kernel_names"),o=e("../tensor_util"),l=e("../tensor_util_env"),i=e("./floorDiv");let u=/* @__PURE__ */(0,e("./operation").op)({div_:function(e,t){let r=(0,l.convertToTensor)(e,"a","div"),n=(0,l.convertToTensor)(t,"b","div");if([r,n]=(0,o.makeTypesMatch)(r,n),"int32"===r.dtype&&"int32"===n.dtype)return(0,i.floorDiv)(r,n);let u={a:r,b:n};return(0,s.ENGINE).runKernel(a.RealDiv,u,{})}})},{"../engine":"6eJyD","../kernel_names":"aqvy4","../tensor_util":"jgr40","../tensor_util_env":"g1Qlv","./floorDiv":"idcjE","./operation":"2kGjz","@parcel/transformer-js/src/esmodule-helpers.js":"9pCYc"}],idcjE:[function(e,t,r){/** * @license * Copyright 2020 Google LLC. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. * ============================================================================= */var n=e("@parcel/transformer-js/src/esmodule-helpers.js");n.defineInteropFlag(r),n.export(r,"floorDiv",()=>i);var s=e("../engine"),a=e("../kernel_names"),o=e("../tensor_util"),l=e("../tensor_util_env");let i=/* @__PURE__ */(0,e("./operation").op)({floorDiv_:function(e,t){let r=(0,l.convertToTensor)(e,"a","floorDiv"),n=(0,l.convertToTensor)(t,"b","floorDiv");[r,n]=(0,o.makeTypesMatch)(r,n);let i={a:r,b:n};return(0,s.ENGINE).runKernel(a.FloorDiv,i)}})},{"../engine":"6eJyD","../kernel_names":"aqvy4","../tensor_util":"jgr40","../tensor_util_env":"g1Qlv","./operation":"2kGjz","@parcel/transformer-js/src/esmodule-helpers.js":"9pCYc"}],gPetX:[function(e,t,r){/** * @license * Copyright 2020 Google LLC. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. * ============================================================================= */var n=e("@parcel/transformer-js/src/esmodule-helpers.js");n.defineInteropFlag(r),n.export(r,"mul",()=>i);var s=e("../engine"),a=e("../kernel_names"),o=e("../tensor_util"),l=e("../tensor_util_env");let i=/* @__PURE__ */(0,e("./operation").op)({mul_:function(e,t){let r=(0,l.convertToTensor)(e,"a","mul"),n=(0,l.convertToTensor)(t,"b","mul");[r,n]=(0,o.makeTypesMatch)(r,n);let i={a:r,b:n};return(0,s.ENGINE).runKernel(a.Multiply,i)}})},{"../engine":"6eJyD","../kernel_names":"aqvy4","../tensor_util":"jgr40","../tensor_util_env":"g1Qlv","./operation":"2kGjz","@parcel/transformer-js/src/esmodule-helpers.js":"9pCYc"}],hRONF:[function(e,t,r){/** * @license * Copyright 2020 Google LLC. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. * ============================================================================= */var n=e("@parcel/transformer-js/src/esmodule-helpers.js");n.defineInteropFlag(r),n.export(r,"abs",()=>s.abs),n.export(r,"acos",()=>a.acos),n.export(r,"acosh",()=>o.acosh),n.export(r,"add",()=>l.add),n.export(r,"addN",()=>i.addN),n.export(r,"all",()=>u.all),n.export(r,"any",()=>p.any),n.export(r,"argMax",()=>c.argMax),n.export(r,"argMin",()=>d.argMin),n.export(r,"asin",()=>f.asin),n.export(r,"asinh",()=>h.asinh),n.export(r,"atan",()=>m.atan),n.export(r,"atan2",()=>g.atan2),n.export(r,"atanh",()=>x.atanh),n.export(r,"avgPool",()=>v.avgPool),n.export(r,"avgPool3d",()=>y.avgPool3d),n.export(r,"basicLSTMCell",()=>b.basicLSTMCell),n.export(r,"batchToSpaceND",()=>_.batchToSpaceND),n.export(r,"batchNorm",()=>k.batchNorm),n.export(r,"batchNorm2d",()=>j.batchNorm2d),n.export(r,"batchNorm3d",()=>I.batchNorm3d),n.export(r,"batchNorm4d",()=>C.batchNorm4d),n.export(r,"bincount",()=>w.bincount),n.export(r,"bitwiseAnd",()=>T.bitwiseAnd),n.export(r,"broadcastArgs",()=>S.broadcastArgs),n.export(r,"broadcastTo",()=>N.broadcastTo),n.export(r,"buffer",()=>E.buffer),n.export(r,"cast",()=>F.cast),n.export(r,"ceil",()=>R.ceil),n.export(r,"clipByValue",()=>A.clipByValue),n.export(r,"clone",()=>P.clone),n.export(r,"complex",()=>D.complex),n.export(r,"concat",()=>$.concat),n.export(r,"concat1d",()=>M.concat1d),n.export(r,"concat2d",()=>O.concat2d),n.export(r,"concat3d",()=>V.concat3d),n.export(r,"concat4d",()=>B.concat4d),n.export(r,"conv1d",()=>L.conv1d),n.export(r,"conv2d",()=>G.conv2d),n.export(r,"conv2dTranspose",()=>z.conv2dTranspose),n.export(r,"conv3d",()=>U.conv3d),n.export(r,"conv3dTranspose",()=>Y.conv3dTranspose),n.export(r,"cos",()=>W.cos),n.export(r,"cosh",()=>q.cosh),n.export(r,"cumprod",()=>K.cumprod),n.export(r,"cumsum",()=>H.cumsum),n.export(r,"denseBincount",()=>X.denseBincount),n.export(r,"depthToSpace",()=>Q.depthToSpace),n.export(r,"depthwiseConv2d",()=>J.depthwiseConv2d),n.export(r,"diag",()=>Z.diag),n.export(r,"dilation2d",()=>ee.dilation2d),n.export(r,"div",()=>et.div),n.export(r,"divNoNan",()=>er.divNoNan),n.export(r,"dot",()=>en.dot),n.export(r,"einsum",()=>es.einsum),n.export(r,"elu",()=>ea.elu),n.export(r,"ensureShape",()=>eo.ensureShape),n.export(r,"equal",()=>el.equal),n.export(r,"erf",()=>ei.erf),n.export(r,"euclideanNorm",()=>eu.euclideanNorm),n.export(r,"exp",()=>ep.exp),n.export(r,"expandDims",()=>ec.expandDims),n.export(r,"expm1",()=>ed.expm1),n.export(r,"eye",()=>ef.eye),n.export(r,"fill",()=>eh.fill),n.export(r,"floor",()=>em.floor),n.export(r,"floorDiv",()=>eg.floorDiv),n.export(r,"gather",()=>ex.gather),n.export(r,"greater",()=>ev.greater),n.export(r,"greaterEqual",()=>ey.greaterEqual),n.export(r,"imag",()=>eb.imag),n.export(r,"isFinite",()=>e_.isFinite),n.export(r,"isInf",()=>ek.isInf),n.export(r,"isNaN",()=>ej.isNaN),n.export(r,"leakyRelu",()=>eI.leakyRelu),n.export(r,"less",()=>eC.less),n.export(r,"lessEqual",()=>ew.lessEqual),n.export(r,"linspace",()=>eT.linspace),n.export(r,"localResponseNormalization",()=>eS.localResponseNormalization),n.export(r,"log",()=>eN.log),n.export(r,"log1p",()=>eE.log1p),n.export(r,"logSigmoid",()=>eF.logSigmoid),n.export(r,"logSoftmax",()=>eR.logSoftmax),n.export(r,"logSumExp",()=>eA.logSumExp),n.export(r,"logicalAnd",()=>eP.logicalAnd),n.export(r,"logicalNot",()=>eD.logicalNot),n.export(r,"logicalOr",()=>e$.logicalOr),n.export(r,"logicalXor",()=>eM.logicalXor),n.export(r,"lowerBound",()=>eO.lowerBound),n.export(r,"matMul",()=>eV.matMul),n.export(r,"max",()=>eB.max),n.export(r,"maxPool",()=>eL.maxPool),n.export(r,"maxPool3d",()=>eG.maxPool3d),n.export(r,"maxPoolWithArgmax",()=>ez.maxPoolWithArgmax),n.export(r,"maximum",()=>eU.maximum),n.export(r,"mean",()=>eY.mean),n.export(r,"meshgrid",()=>eW.meshgrid),n.export(r,"min",()=>eq.min),n.export(r,"minimum",()=>eK.minimum),n.export(r,"mirrorPad",()=>eH.mirrorPad),n.export(r,"mod",()=>eX.mod),n.export(r,"moments",()=>eQ.moments),n.export(r,"mul",()=>eJ.mul),n.export(r,"multiRNNCell",()=>eZ.multiRNNCell),n.export(r,"multinomial",()=>e0.multinomial),n.export(r,"neg",()=>e1.neg),n.export(r,"notEqual",()=>e2.notEqual),n.export(r,"oneHot",()=>e3.oneHot),n.export(r,"ones",()=>e4.ones),n.export(r,"onesLike",()=>e9.onesLike),n.export(r,"outerProduct",()=>e6.outerProduct),n.export(r,"pad",()=>e5.pad),n.export(r,"pad1d",()=>e8.pad1d),n.export(r,"pad2d",()=>e7.pad2d),n.export(r,"pad3d",()=>te.pad3d),n.export(r,"pad4d",()=>tt.pad4d),n.export(r,"pool",()=>tr.pool),n.export(r,"pow",()=>tn.pow),n.export(r,"prelu",()=>ts.prelu),n.export(r,"print",()=>ta.print),n.export(r,"prod",()=>to.prod),n.export(r,"raggedGather",()=>tl.raggedGather),n.export(r,"raggedRange",()=>ti.raggedRange),n.export(r,"raggedTensorToTensor",()=>tu.raggedTensorToTensor),n.export(r,"rand",()=>tp.rand),n.export(r,"randomGamma",()=>tc.randomGamma),n.export(r,"randomNormal",()=>td.randomNormal),n.export(r,"randomStandardNormal",()=>tf.randomStandardNormal),n.export(r,"randomUniform",()=>th.randomUniform),n.export(r,"randomUniformInt",()=>tm.randomUniformInt),n.export(r,"range",()=>tg.range),n.export(r,"real",()=>tx.real),n.export(r,"reciprocal",()=>tv.reciprocal),n.export(r,"relu",()=>ty.relu),n.export(r,"relu6",()=>tb.relu6),n.export(r,"reshape",()=>t_.reshape),n.export(r,"reverse",()=>tk.reverse),n.export(r,"reverse1d",()=>tj.reverse1d),n.export(r,"reverse2d",()=>tI.reverse2d),n.export(r,"reverse3d",()=>tC.reverse3d),n.export(r,"reverse4d",()=>tw.reverse4d),n.export(r,"round",()=>tT.round),n.export(r,"rsqrt",()=>tS.rsqrt),n.export(r,"scalar",()=>tN.scalar),n.export(r,"selu",()=>tE.selu),n.export(r,"separableConv2d",()=>tF.separableConv2d),n.export(r,"setdiff1dAsync",()=>tR.setdiff1dAsync),n.export(r,"sigmoid",()=>tA.sigmoid),n.export(r,"sign",()=>tP.sign),n.export(r,"sin",()=>tD.sin),n.export(r,"sinh",()=>t$.sinh),n.export(r,"slice",()=>tM.slice),n.export(r,"slice1d",()=>tO.slice1d),n.export(r,"slice2d",()=>tV.slice2d),n.export(r,"slice3d",()=>tB.slice3d),n.export(r,"slice4d",()=>tL.slice4d),n.export(r,"softmax",()=>tG.softmax),n.export(r,"softplus",()=>tz.softplus),n.export(r,"spaceToBatchND",()=>tU.spaceToBatchND),n.export(r,"fft",()=>tY.fft),n.export(r,"ifft",()=>tW.ifft),n.export(r,"irfft",()=>tq.irfft),n.export(r,"rfft",()=>tK.rfft),n.export(r,"split",()=>tH.split),n.export(r,"sqrt",()=>tX.sqrt),n.export(r,"square",()=>tQ.square),n.export(r,"squaredDifference",()=>tJ.squaredDifference),n.export(r,"squeeze",()=>tZ.squeeze),n.export(r,"stack",()=>t0.stack),n.export(r,"step",()=>t1.step),n.export(r,"stridedSlice",()=>t2.stridedSlice),n.export(r,"sub",()=>t3.sub),n.export(r,"sum",()=>t4.sum),n.export(r,"tan",()=>t9.tan),n.export(r,"tanh",()=>t6.tanh),n.export(r,"tensor",()=>t5.tensor),n.export(r,"tensor1d",()=>t8.tensor1d),n.export(r,"tensor2d",()=>t7.tensor2d),n.export(r,"tensor3d",()=>re.tensor3d),n.export(r,"tensor4d",()=>rt.tensor4d),n.export(r,"tensor5d",()=>rr.tensor5d),n.export(r,"tensor6d",()=>rn.tensor6d),n.export(r,"tensorScatterUpdate",()=>rs.tensorScatterUpdate),n.export(r,"tile",()=>ra.tile),n.export(r,"topk",()=>ro.topk),n.export(r,"truncatedNormal",()=>rl.truncatedNormal),n.export(r,"unique",()=>ri.unique),n.export(r,"unsortedSegmentSum",()=>ru.unsortedSegmentSum),n.export(r,"unstack",()=>rp.unstack),n.export(r,"upperBound",()=>rc.upperBound),n.export(r,"variable",()=>rd.variable),n.export(r,"where",()=>rf.where),n.export(r,"whereAsync",()=>rh.whereAsync),n.export(r,"zeros",()=>rm.zeros),n.export(r,"zerosLike",()=>rg.zerosLike),n.export(r,"op",()=>rS.op),n.export(r,"OP_SCOPE_SUFFIX",()=>rS.OP_SCOPE_SUFFIX),n.export(r,"image",()=>nl),n.export(r,"linalg",()=>ni),n.export(r,"losses",()=>nu),n.export(r,"spectral",()=>na),n.export(r,"fused",()=>rN),n.export(r,"signal",()=>no),n.export(r,"sparse",()=>np),n.export(r,"string",()=>nc);var s=e("./abs"),a=e("./acos"),o=e("./acosh"),l=e("./add"),i=e("./add_n"),u=e("./all"),p=e("./any"),c=e("./arg_max"),d=e("./arg_min"),f=e("./asin"),h=e("./asinh"),m=e("./atan"),g=e("./atan2"),x=e("./atanh"),v=e("./avg_pool"),y=e("./avg_pool_3d"),b=e("./basic_lstm_cell"),_=e("./batch_to_space_nd"),k=e("./batchnorm"),j=e("./batchnorm2d"),I=e("./batchnorm3d"),C=e("./batchnorm4d"),w=e("./bincount"),T=e("./bitwise_and"),S=e("./broadcast_args"),N=e("./broadcast_to"),E=e("./buffer"),F=e("./cast"),R=e("./ceil"),A=e("./clip_by_value"),P=e("./clone"),D=e("./complex"),$=e("./concat"),M=e("./concat_1d"),O=e("./concat_2d"),V=e("./concat_3d"),B=e("./concat_4d"),L=e("./conv1d"),G=e("./conv2d"),z=e("./conv2d_transpose"),U=e("./conv3d"),Y=e("./conv3d_transpose"),W=e("./cos"),q=e("./cosh"),K=e("./cumprod"),H=e("./cumsum"),X=e("./dense_bincount"),Q=e("./depth_to_space"),J=e("./depthwise_conv2d"),Z=e("./diag"),ee=e("./dilation2d"),et=e("./div"),er=e("./div_no_nan"),en=e("./dot"),es=e("./einsum"),ea=e("./elu"),eo=e("./ensure_shape"),el=e("./equal"),ei=e("./erf"),eu=e("./euclidean_norm"),ep=e("./exp"),ec=e("./expand_dims"),ed=e("./expm1"),ef=e("./eye"),eh=e("./fill"),em=e("./floor"),eg=e("./floorDiv"),ex=e("./gather"),ev=e("./greater"),ey=e("./greater_equal"),eb=e("./imag"),e_=e("./is_finite"),ek=e("./is_inf"),ej=e("./is_nan"),eI=e("./leaky_relu"),eC=e("./less"),ew=e("./less_equal"),eT=e("./linspace"),eS=e("./local_response_normalization"),eN=e("./log"),eE=e("./log1p"),eF=e("./log_sigmoid"),eR=e("./log_softmax"),eA=e("./log_sum_exp"),eP=e("./logical_and"),eD=e("./logical_not"),e$=e("./logical_or"),eM=e("./logical_xor"),eO=e("./lower_bound"),eV=e("./mat_mul"),eB=e("./max"),eL=e("./max_pool"),eG=e("./max_pool_3d"),ez=e("./max_pool_with_argmax"),eU=e("./maximum"),eY=e("./mean"),eW=e("./meshgrid"),eq=e("./min"),eK=e("./minimum"),eH=e("./mirror_pad"),eX=e("./mod"),eQ=e("./moments"),eJ=e("./mul"),eZ=e("./multi_rnn_cell"),e0=e("./multinomial"),e1=e("./neg"),e2=e("./not_equal"),e3=e("./one_hot"),e4=e("./ones"),e9=e("./ones_like"),e6=e("./outer_product"),e5=e("./pad"),e8=e("./pad1d"),e7=e("./pad2d"),te=e("./pad3d"),tt=e("./pad4d"),tr=e("./pool"),tn=e("./pow"),ts=e("./prelu"),ta=e("./print"),to=e("./prod"),tl=e("./ragged_gather"),ti=e("./ragged_range"),tu=e("./ragged_tensor_to_tensor"),tp=e("./rand"),tc=e("./random_gamma"),td=e("./random_normal"),tf=e("./random_standard_normal"),th=e("./random_uniform"),tm=e("./random_uniform_int"),tg=e("./range"),tx=e("./real"),tv=e("./reciprocal"),ty=e("./relu"),tb=e("./relu6"),t_=e("./reshape"),tk=e("./reverse"),tj=e("./reverse_1d"),tI=e("./reverse_2d"),tC=e("./reverse_3d"),tw=e("./reverse_4d"),tT=e("./round"),tS=e("./rsqrt"),tN=e("./scalar"),tE=e("./selu"),tF=e("./separable_conv2d"),tR=e("./setdiff1d_async"),tA=e("./sigmoid"),tP=e("./sign"),tD=e("./sin"),t$=e("./sinh"),tM=e("./slice"),tO=e("./slice1d"),tV=e("./slice2d"),tB=e("./slice3d"),tL=e("./slice4d"),tG=e("./softmax"),tz=e("./softplus"),tU=e("./space_to_batch_nd"),tY=e("./spectral/fft"),tW=e("./spectral/ifft"),tq=e("./spectral/irfft"),tK=e("./spectral/rfft"),tH=e("./split"),tX=e("./sqrt"),tQ=e("./square"),tJ=e("./squared_difference"),tZ=e("./squeeze"),t0=e("./stack"),t1=e("./step"),t2=e("./strided_slice"),t3=e("./sub"),t4=e("./sum"),t9=e("./tan"),t6=e("./tanh"),t5=e("./tensor"),t8=e("./tensor1d"),t7=e("./tensor2d"),re=e("./tensor3d"),rt=e("./tensor4d"),rr=e("./tensor5d"),rn=e("./tensor6d"),rs=e("./tensor_scatter_update"),ra=e("./tile"),ro=e("./topk"),rl=e("./truncated_normal"),ri=e("./unique"),ru=e("./unsorted_segment_sum"),rp=e("./unstack"),rc=e("./upper_bound"),rd=e("./variable"),rf=e("./where"),rh=e("./where_async"),rm=e("./zeros"),rg=e("./zeros_like"),rx=e("./boolean_mask");n.exportAll(rx,r);var rv=e("./transpose");n.exportAll(rv,r);var ry=e("./norm");n.exportAll(ry,r);var rb=e("./moving_average");n.exportAll(rb,r);var r_=e("./scatter_nd");n.exportAll(r_,r);var rk=e("./search_sorted");n.exportAll(rk,r);var rj=e("./sparse_to_dense");n.exportAll(rj,r);var rI=e("./gather_nd");n.exportAll(rI,r);var rC=e("./dropout");n.exportAll(rC,r);var rw=e("./signal_ops_util");n.exportAll(rw,r);var rT=e("./in_top_k");n.exportAll(rT,r);var rS=e("./operation"),rN=e("./fused_ops"),rE=e("./signal/hamming_window"),rF=e("./signal/hann_window"),rR=e("./signal/frame"),rA=e("./signal/stft"),rP=e("./image/crop_and_resize"),rD=e("./image/flip_left_right"),r$=e("./image/grayscale_to_rgb"),rM=e("./image/rgb_to_grayscale"),rO=e("./image/rotate_with_offset"),rV=e("./image/non_max_suppression"),rB=e("./image/non_max_suppression_async"),rL=e("./image/non_max_suppression_with_score"),rG=e("./image/non_max_suppression_with_score_async"),rz=e("./image/non_max_suppression_padded"),rU=e("./image/non_max_suppression_padded_async"),rY=e("./image/resize_bilinear"),rW=e("./image/resize_nearest_neighbor"),rq=e("./image/threshold"),rK=e("./image/transform"),rH=e("./linalg/band_part"),rX=e("./linalg/gram_schmidt"),rQ=e("./linalg/qr"),rJ=e("./losses/absolute_difference"),rZ=e("./losses/compute_weighted_loss"),r0=e("./losses/cosine_distance"),r1=e("./losses/hinge_loss"),r2=e("./losses/huber_loss"),r3=e("./losses/log_loss"),r4=e("./losses/mean_squared_error"),r9=e("./losses/sigmoid_cross_entropy"),r6=e("./losses/softmax_cross_entropy"),r5=e("./sparse/sparse_fill_empty_rows"),r8=e("./sparse/sparse_reshape"),r7=e("./sparse/sparse_segment_mean"),ne=e("./sparse/sparse_segment_sum"),nt=e("./string/string_n_grams"),nr=e("./string/string_split"),nn=e("./string/string_to_hash_bucket_fast"),ns=e("./string/static_regex_replace");let na={fft:tY.fft,ifft:tW.ifft,rfft:tK.rfft,irfft:tq.irfft},no={hammingWindow:rE.hammingWindow,hannWindow:rF.hannWindow,frame:rR.frame,stft:rA.stft},nl={flipLeftRight:rD.flipLeftRight,grayscaleToRGB:r$.grayscaleToRGB,resizeNearestNeighbor:rW.resizeNearestNeighbor,resizeBilinear:rY.resizeBilinear,rgbToGrayscale:rM.rgbToGrayscale,rotateWithOffset:rO.rotateWithOffset,cropAndResize:rP.cropAndResize,nonMaxSuppression:rV.nonMaxSuppression,nonMaxSuppressionAsync:rB.nonMaxSuppressionAsync,nonMaxSuppressionWithScore:rL.nonMaxSuppressionWithScore,nonMaxSuppressionWithScoreAsync:rG.nonMaxSuppressionWithScoreAsync,nonMaxSuppressionPadded:rz.nonMaxSuppressionPadded,nonMaxSuppressionPaddedAsync:rU.nonMaxSuppressionPaddedAsync,threshold:rq.threshold,transform:rK.transform},ni={bandPart:rH.bandPart,gramSchmidt:rX.gramSchmidt,qr:rQ.qr},nu={absoluteDifference:rJ.absoluteDifference,computeWeightedLoss:rZ.computeWeightedLoss,cosineDistance:r0.cosineDistance,hingeLoss:r1.hingeLoss,huberLoss:r2.huberLoss,logLoss:r3.logLoss,meanSquaredError:r4.meanSquaredError,sigmoidCrossEntropy:r9.sigmoidCrossEntropy,softmaxCrossEntropy:r6.softmaxCrossEntropy},np={sparseFillEmptyRows:r5.sparseFillEmptyRows,sparseReshape:r8.sparseReshape,sparseSegmentMean:r7.sparseSegmentMean,sparseSegmentSum:ne.sparseSegmentSum},nc={stringNGrams:nt.stringNGrams,stringSplit:nr.stringSplit,stringToHashBucketFast:nn.stringToHashBucketFast,staticRegexReplace:ns.staticRegexReplace}},{"./abs":"3JIEu","./acos":"cP9uJ","./acosh":"aKQXq","./add":"g9v2X","./add_n":"Aowye","./all":"37b4n","./any":"8q1GH","./arg_max":"64TGv","./arg_min":"iHnn7","./asin":"2TaW7","./asinh":"7YyEk","./atan":"5Q8mo","./atan2":"iBWAM","./atanh":"fpppH","./avg_pool":"ghaN2","./avg_pool_3d":"hDR85","./basic_lstm_cell":"4i0eA","./batch_to_space_nd":"h1uzb","./batchnorm":"8XeJn","./batchnorm2d":"k6XHa","./batchnorm3d":"f79DB","./batchnorm4d":"bivaa","./bincount":"1eiwT","./bitwise_and":"k3aiR","./broadcast_args":"3DTNA","./broadcast_to":"3fEHu","./buffer":"3SrXS","./cast":"ekSnT","./ceil":"ib8D9","./clip_by_value":"b2nZF","./clone":"gI2Tp","./complex":"98mI6","./concat":"aQPCM","./concat_1d":"b4JWP","./concat_2d":"4ojPm","./concat_3d":"jInMT","./concat_4d":"8reej","./conv1d":"kX6wE","./conv2d":"59r1a","./conv2d_transpose":"juZcV","./conv3d":"4kwgW","./conv3d_transpose":"g5Nm2","./cos":"4lRiV","./cosh":"7pfc8","./cumprod":"cs9Qt","./cumsum":"8UcEb","./dense_bincount":"5Vmkv","./depth_to_space":"leeI4","./depthwise_conv2d":"kLAtV","./diag":"kY849","./dilation2d":"izYym","./div":"f7E5D","./div_no_nan":"jI2z6","./dot":"bsMUo","./einsum":"iHV90","./elu":"gTKMF","./ensure_shape":"7skYx","./equal":"8cA6U","./erf":"exYkO","./euclidean_norm":"7T6br","./exp":"g4QHY","./expand_dims":"bkwaY","./expm1":"dwa81","./eye":"1q7xZ","./fill":"b1ljI","./floor":"29qAJ","./floorDiv":"idcjE","./gather":"bVuYh","./greater":"auCuN","./greater_equal":"5jRVD","./imag":"2YwxX","./is_finite":"9pYlX","./is_inf":"cXc8F","./is_nan":"kIDze","./leaky_relu":"4La0e","./less":"kyWc5","./less_equal":"bqBgL","./linspace":"4oO8G","./local_response_normalization":"PXpCA","./log":"jzL0E","./log1p":"3kse5","./log_sigmoid":"6s8Zj","./log_softmax":"7hcJP","./log_sum_exp":"9LKqV","./logical_and":"eVMNJ","./logical_not":"hWzRt","./logical_or":"7uYz3","./logical_xor":"9Bill","./lower_bound":"db0zS","./mat_mul":"9ZocJ","./max":"6JsYy","./max_pool":"eWrIA","./max_pool_3d":"as7ZM","./max_pool_with_argmax":"bXdzQ","./maximum":"dq98s","./mean":"ddOHD","./meshgrid":"gelPo","./min":"k9ZaF","./minimum":"jeIQ1","./mirror_pad":"hDICJ","./mod":"ekS4m","./moments":"hG4nU","./mul":"gPetX","./multi_rnn_cell":"7gbfg","./multinomial":"i3IDh","./neg":"7zXw5","./not_equal":"lDPfv","./one_hot":"z9rKs","./ones":"bs1MK","./ones_like":"wfRrw","./outer_product":"as4kd","./pad":"ady8n","./pad1d":"Xfx8c","./pad2d":"5deCK","./pad3d":"hd4Cr","./pad4d":"42UbX","./pool":"iU8mp","./pow":"cL5Hc","./prelu":"9UqPZ","./print":"4ToBR","./prod":"fh6nt","./ragged_gather":"eeYzF","./ragged_range":"jEZ32","./ragged_tensor_to_tensor":"9GUiW","./rand":"6BhXX","./random_gamma":"8ubNM","./random_normal":"5F50h","./random_standard_normal":"8B5oa","./random_uniform":"gyGgn","./random_uniform_int":"KqnrA","./range":"lKSmL","./real":"gL38H","./reciprocal":"889wq","./relu":"cx9c3","./relu6":"g5u74","./reshape":"VuY4S","./reverse":"6PhlD","./reverse_1d":"ddJ5K","./reverse_2d":"e5ICP","./reverse_3d":"ap92w","./reverse_4d":"3Dxlb","./round":"fNSi1","./rsqrt":"6fl2z","./scalar":"53j04","./selu":"854kD","./separable_conv2d":"g9xim","./setdiff1d_async":"3esgH","./sigmoid":"gGNpa","./sign":"9Ms9R","./sin":"4qLCn","./sinh":"bnveM","./slice":"cjlcK","./slice1d":"1ya8P","./slice2d":"ifCCa","./slice3d":"iJ1Vg","./slice4d":"asX0D","./softmax":"1slpr","./softplus":"9FSsO","./space_to_batch_nd":"ltsHr","./spectral/fft":"kA5mr","./spectral/ifft":"40Lhz","./spectral/irfft":"8apyy","./spectral/rfft":"enYFV","./split":"xglNu","./sqrt":"kl1Ie","./square":"1Qqi7","./squared_difference":"ktglY","./squeeze":"8ELtY","./stack":"gM8I8","./step":"2cIA8","./strided_slice":"4HYaV","./sub":"cQqL3","./sum":"gsfPR","./tan":"6U5oZ","./tanh":"yVinF","./tensor":"9hoBJ","./tensor1d":"j8r4R","./tensor2d":"anm7F","./tensor3d":"fN8Yq","./tensor4d":"5i3cW","./tensor5d":"jQ0Mp","./tensor6d":"fj5AK","./tensor_scatter_update":"fh20S","./tile":"5kcg2","./topk":"kbuJ1","./truncated_normal":"64b7J","./unique":"8QZfe","./unsorted_segment_sum":"ijbzG","./unstack":"7lgSS","./upper_bound":"45Ote","./variable":"9wyHt","./where":"4ZjiT","./where_async":"bAvwN","./zeros":"1YDK1","./zeros_like":"gjKam","./boolean_mask":"4hNOT","./transpose":"4OrXK","./norm":"auMxT","./moving_average":"1x3sH","./scatter_nd":"j0Hjd","./search_sorted":"2Y7bB","./sparse_to_dense":"9wN9b","./gather_nd":"ftx7F","./dropout":"8yPYM","./signal_ops_util":"ebQTE","./in_top_k":"dSfPB","./operation":"2kGjz","./fused_ops":"5Y9nQ","./signal/hamming_window":"d2Ryg","./signal/hann_window":"bYtSf","./signal/frame":"11lOp","./signal/stft":"e1vbw","./image/crop_and_resize":"TjMmg","./image/flip_left_right":"kns2j","./image/grayscale_to_rgb":"9VwKI","./image/rgb_to_grayscale":"cvHCC","./image/rotate_with_offset":"9G7PX","./image/non_max_suppression":"l18In","./image/non_max_suppression_async":"25fjM","./image/non_max_suppression_with_score":"3QkyU","./image/non_max_suppression_with_score_async":"1hBGY","./image/non_max_suppression_padded":"dc0Hx","./image/non_max_suppression_padded_async":"8i0M7","./image/resize_bilinear":"jcgG4","./image/resize_nearest_neighbor":"jdfJP","./image/threshold":"b4A5K","./image/transform":"jyDR3","./linalg/band_part":"802Ux","./linalg/gram_schmidt":"h2qxT","./linalg/qr":"ki0cx","./losses/absolute_difference":"fYxMY","./losses/compute_weighted_loss":"3X2X3","./losses/cosine_distance":"c9vR1","./losses/hinge_loss":"745PS","./losses/huber_loss":"6ueCA","./losses/log_loss":"3DiEw","./losses/mean_squared_error":"iOpdj","./losses/sigmoid_cross_entropy":"ak4fC","./losses/softmax_cross_entropy":"l673k","./sparse/sparse_fill_empty_rows":"c5a3k","./sparse/sparse_reshape":"aQZAA","./sparse/sparse_segment_mean":"bPnbn","./sparse/sparse_segment_sum":"kyjdR","./string/string_n_grams":"jdtAC","./string/string_split":"byxrk","./string/string_to_hash_bucket_fast":"38QJ5","./string/static_regex_replace":"eTPWG","@parcel/transformer-js/src/esmodule-helpers.js":"9pCYc"}],"3JIEu":[function(e,t,r){/** * @license * Copyright 2018 Google LLC. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. * ============================================================================= */var n=e("@parcel/transformer-js/src/esmodule-helpers.js");n.defineInteropFlag(r),n.export(r,"abs",()=>l);var s=e("../engine"),a=e("../kernel_names"),o=e("../tensor_util_env");let l=/* @__PURE__ */(0,e("./operation").op)({abs_:function(e){let t=(0,o.convertToTensor)(e,"x","abs");return"complex64"===t.dtype?(0,s.ENGINE).runKernel(a.ComplexAbs,{x:t}):(0,s.ENGINE).runKernel(a.Abs,{x:t})}})},{"../engine":"6eJyD","../kernel_names":"aqvy4","../tensor_util_env":"g1Qlv","./operation":"2kGjz","@parcel/transformer-js/src/esmodule-helpers.js":"9pCYc"}],cP9uJ:[function(e,t,r){/** * @license * Copyright 2018 Google LLC. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. * ============================================================================= */var n=e("@parcel/transformer-js/src/esmodule-helpers.js");n.defineInteropFlag(r),n.export(r,"acos",()=>l);var s=e("../engine"),a=e("../kernel_names"),o=e("../tensor_util_env");let l=/* @__PURE__ */(0,e("./operation").op)({acos_:function(e){let t=(0,o.convertToTensor)(e,"x","acos");return(0,s.ENGINE).runKernel(a.Acos,{x:t})}})},{"../engine":"6eJyD","../kernel_names":"aqvy4","../tensor_util_env":"g1Qlv","./operation":"2kGjz","@parcel/transformer-js/src/esmodule-helpers.js":"9pCYc"}],aKQXq:[function(e,t,r){/** * @license * Copyright 2018 Google LLC. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. * ============================================================================= */var n=e("@parcel/transformer-js/src/esmodule-helpers.js");n.defineInteropFlag(r),n.export(r,"acosh",()=>l);var s=e("../engine"),a=e("../kernel_names"),o=e("../tensor_util_env");let l=/* @__PURE__ */(0,e("./operation").op)({acosh_:function(e){let t=(0,o.convertToTensor)(e,"x","acosh");return(0,s.ENGINE).runKernel(a.Acosh,{x:t})}})},{"../engine":"6eJyD","../kernel_names":"aqvy4","../tensor_util_env":"g1Qlv","./operation":"2kGjz","@parcel/transformer-js/src/esmodule-helpers.js":"9pCYc"}],Aowye:[function(e,t,r){/** * @license * Copyright 2020 Google LLC. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. * ============================================================================= */var n=e("@parcel/transformer-js/src/esmodule-helpers.js");n.defineInteropFlag(r),n.export(r,"addN",()=>i);var s=e("../engine"),a=e("../kernel_names"),o=e("../tensor_util_env"),l=e("../util");let i=/* @__PURE__ */(0,e("./operation").op)({addN_:function(e){l.assert(Array.isArray(e),()=>"The argument passed to tf.addN() must be a list of tensors"),l.assert(e.length>=1,()=>`Must pass at least one tensor to tf.addN(), but got ${e.length}`);let t=e.map((e,t)=>(0,o.convertToTensor)(e,`tensors${t}`,"addN")),r=t[0];return t.forEach(e=>{if(e.dtype!==r.dtype)throw Error("All tensors passed to tf.addN() must have the same dtype")}),t.forEach(e=>{if(!l.arraysEqual(e.shape,r.shape))throw Error("All tensors passed to tf.addN() must have the same shape")}),(0,s.ENGINE).runKernel(a.AddN,t)}})},{"../engine":"6eJyD","../kernel_names":"aqvy4","../tensor_util_env":"g1Qlv","../util":"gBRMK","./operation":"2kGjz","@parcel/transformer-js/src/esmodule-helpers.js":"9pCYc"}],"37b4n":[function(e,t,r){/** * @license * Copyright 2020 Google LLC. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. * ============================================================================= */var n=e("@parcel/transformer-js/src/esmodule-helpers.js");n.defineInteropFlag(r),n.export(r,"all",()=>l);var s=e("../engine"),a=e("../kernel_names"),o=e("../tensor_util_env");let l=/* @__PURE__ */(0,e("./operation").op)({all_:function(e,t=null,r=!1){let n=(0,o.convertToTensor)(e,"x","all","bool");return(0,s.ENGINE).runKernel(a.All,{x:n},{axis:t,keepDims:r})}})},{"../engine":"6eJyD","../kernel_names":"aqvy4","../tensor_util_env":"g1Qlv","./operation":"2kGjz","@parcel/transformer-js/src/esmodule-helpers.js":"9pCYc"}],"8q1GH":[function(e,t,r){/** * @license * Copyright 2020 Google LLC. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. * ============================================================================= */var n=e("@parcel/transformer-js/src/esmodule-helpers.js");n.defineInteropFlag(r),n.export(r,"any",()=>l);var s=e("../engine"),a=e("../kernel_names"),o=e("../tensor_util_env");let l=/* @__PURE__ */(0,e("./operation").op)({any_:function(e,t=null,r=!1){let n=(0,o.convertToTensor)(e,"x","any","bool");return(0,s.ENGINE).runKernel(a.Any,{x:n},{axis:t,keepDims:r})}})},{"../engine":"6eJyD","../kernel_names":"aqvy4","../tensor_util_env":"g1Qlv","./operation":"2kGjz","@parcel/transformer-js/src/esmodule-helpers.js":"9pCYc"}],"64TGv":[function(e,t,r){/** * @license * Copyright 2020 Google Inc. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. * ============================================================================= */var n=e("@parcel/transformer-js/src/esmodule-helpers.js");n.defineInteropFlag(r),n.export(r,"argMax",()=>l);var s=e("../engine"),a=e("../kernel_names"),o=e("../tensor_util_env");let l=/* @__PURE__ */(0,e("./operation").op)({argMax_:function(e,t=0){let r=(0,o.convertToTensor)(e,"x","argMax");return(0,s.ENGINE).runKernel(a.ArgMax,{x:r},{axis:t})}})},{"../engine":"6eJyD","../kernel_names":"aqvy4","../tensor_util_env":"g1Qlv","./operation":"2kGjz","@parcel/transformer-js/src/esmodule-helpers.js":"9pCYc"}],iHnn7:[function(e,t,r){/** * @license * Copyright 2020 Google Inc. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. * ============================================================================= */var n=e("@parcel/transformer-js/src/esmodule-helpers.js");n.defineInteropFlag(r),n.export(r,"argMin",()=>l);var s=e("../engine"),a=e("../kernel_names"),o=e("../tensor_util_env");let l=/* @__PURE__ */(0,e("./operation").op)({argMin_:function(e,t=0){let r=(0,o.convertToTensor)(e,"x","argMin");return(0,s.ENGINE).runKernel(a.ArgMin,{x:r},{axis:t})}})},{"../engine":"6eJyD","../kernel_names":"aqvy4","../tensor_util_env":"g1Qlv","./operation":"2kGjz","@parcel/transformer-js/src/esmodule-helpers.js":"9pCYc"}],"2TaW7":[function(e,t,r){/** * @license * Copyright 2018 Google LLC. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. * ============================================================================= */var n=e("@parcel/transformer-js/src/esmodule-helpers.js");n.defineInteropFlag(r),n.export(r,"asin",()=>l);var s=e("../engine"),a=e("../kernel_names"),o=e("../tensor_util_env");let l=/* @__PURE__ */(0,e("./operation").op)({asin_:function(e){let t=(0,o.convertToTensor)(e,"x","asin");return(0,s.ENGINE).runKernel(a.Asin,{x:t})}})},{"../engine":"6eJyD","../kernel_names":"aqvy4","../tensor_util_env":"g1Qlv","./operation":"2kGjz","@parcel/transformer-js/src/esmodule-helpers.js":"9pCYc"}],"7YyEk":[function(e,t,r){/** * @license * Copyright 2018 Google LLC. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. * ============================================================================= */var n=e("@parcel/transformer-js/src/esmodule-helpers.js");n.defineInteropFlag(r),n.export(r,"asinh",()=>l);var s=e("../engine"),a=e("../kernel_names"),o=e("../tensor_util_env");let l=/* @__PURE__ */(0,e("./operation").op)({asinh_:function(e){let t=(0,o.convertToTensor)(e,"x","asinh");return(0,s.ENGINE).runKernel(a.Asinh,{x:t})}})},{"../engine":"6eJyD","../kernel_names":"aqvy4","../tensor_util_env":"g1Qlv","./operation":"2kGjz","@parcel/transformer-js/src/esmodule-helpers.js":"9pCYc"}],"5Q8mo":[function(e,t,r){/** * @license * Copyright 2018 Google LLC. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. * ============================================================================= */var n=e("@parcel/transformer-js/src/esmodule-helpers.js");n.defineInteropFlag(r),n.export(r,"atan",()=>l);var s=e("../engine"),a=e("../kernel_names"),o=e("../tensor_util_env");let l=/* @__PURE__ */(0,e("./operation").op)({atan_:function(e){let t=(0,o.convertToTensor)(e,"x","atan");return(0,s.ENGINE).runKernel(a.Atan,{x:t})}})},{"../engine":"6eJyD","../kernel_names":"aqvy4","../tensor_util_env":"g1Qlv","./operation":"2kGjz","@parcel/transformer-js/src/esmodule-helpers.js":"9pCYc"}],iBWAM:[function(e,t,r){/** * @license * Copyright 2020 Google LLC. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. * ============================================================================= */var n=e("@parcel/transformer-js/src/esmodule-helpers.js");n.defineInteropFlag(r),n.export(r,"atan2",()=>i);var s=e("../engine"),a=e("../kernel_names"),o=e("../tensor_util"),l=e("../tensor_util_env");let i=/* @__PURE__ */(0,e("./operation").op)({atan2_:function(e,t){let r=(0,l.convertToTensor)(e,"a","atan2"),n=(0,l.convertToTensor)(t,"b","atan2");[r,n]=(0,o.makeTypesMatch)(r,n);let i={a:r,b:n};return(0,s.ENGINE).runKernel(a.Atan2,i)}})},{"../engine":"6eJyD","../kernel_names":"aqvy4","../tensor_util":"jgr40","../tensor_util_env":"g1Qlv","./operation":"2kGjz","@parcel/transformer-js/src/esmodule-helpers.js":"9pCYc"}],fpppH:[function(e,t,r){/** * @license * Copyright 2018 Google LLC. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. * ============================================================================= */var n=e("@parcel/transformer-js/src/esmodule-helpers.js");n.defineInteropFlag(r),n.export(r,"atanh",()=>l);var s=e("../engine"),a=e("../kernel_names"),o=e("../tensor_util_env");let l=/* @__PURE__ */(0,e("./operation").op)({atanh_:function(e){let t=(0,o.convertToTensor)(e,"x","atanh");return(0,s.ENGINE).runKernel(a.Atanh,{x:t})}})},{"../engine":"6eJyD","../kernel_names":"aqvy4","../tensor_util_env":"g1Qlv","./operation":"2kGjz","@parcel/transformer-js/src/esmodule-helpers.js":"9pCYc"}],ghaN2:[function(e,t,r){/** * @license * Copyright 2020 Google LLC. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. * ============================================================================= */var n=e("@parcel/transformer-js/src/esmodule-helpers.js");n.defineInteropFlag(r),n.export(r,"avgPool",()=>d);var s=e("../engine"),a=e("../kernel_names"),o=e("../tensor_util_env"),l=e("../util"),i=e("./cast"),u=e("./conv_util"),p=e("./operation"),c=e("./reshape");let d=/* @__PURE__ */(0,p.op)({avgPool_:function(e,t,r,n,p){let d=(0,o.convertToTensor)(e,"x","avgPool","float32");l.assert(u.eitherStridesOrDilationsAreOne(r,1),()=>`Error in avgPool: Either strides or dilations must be 1. Got strides ${r} and dilations '1'`);let f=d,h=!1;3===d.rank&&(h=!0,f=(0,c.reshape)(d,[1,d.shape[0],d.shape[1],d.shape[2]])),l.assert(4===f.rank,()=>`Error in avgPool: x must be rank 4 but got rank ${f.rank}.`),u.checkPadOnDimRoundingMode("avgPool",n,p);let m={x:f},g=(0,s.ENGINE).runKernel(a.AvgPool,m,{filterSize:t,strides:r,pad:n,dimRoundingMode:p});return(g=(0,i.cast)(g,d.dtype),h)?(0,c.reshape)(g,[g.shape[1],g.shape[2],g.shape[3]]):g}})},{"../engine":"6eJyD","../kernel_names":"aqvy4","../tensor_util_env":"g1Qlv","../util":"gBRMK","./cast":"ekSnT","./conv_util":"kmOtb","./operation":"2kGjz","./reshape":"VuY4S","@parcel/transformer-js/src/esmodule-helpers.js":"9pCYc"}],kmOtb:[function(e,t,r){/** * @license * Copyright 2020 Google LLC. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. * ============================================================================= */var n=e("@parcel/transformer-js/src/esmodule-helpers.js");n.defineInteropFlag(r),n.export(r,"computeDilation2DInfo",()=>a),n.export(r,"computePool2DInfo",()=>o),n.export(r,"computePool3DInfo",()=>l),n.export(r,"computeConv2DInfo",()=>i),n.export(r,"computeConv3DInfo",()=>u),n.export(r,"computeDefaultPad",()=>p),n.export(r,"tupleValuesAreOne",()=>m),n.export(r,"eitherStridesOrDilationsAreOne",()=>g),n.export(r,"stridesOrDilationsArePositive",()=>x),n.export(r,"convertConv2DDataFormat",()=>v),n.export(r,"checkPadOnDimRoundingMode",()=>y);var s=e("../util");function a(e,t,r,n,s="NHWC",o){let l=[...t,e[3]];return i(e,l,r,o,n,null,null,v(s))}function o(e,t,r,n,s,a,l="channelsLast"){let u;let[p,d]=c(t);if("channelsLast"===l)u=[p,d,e[3],e[3]];else if("channelsFirst"===l)u=[p,d,e[1],e[1]];else throw Error(`Unknown dataFormat ${l}`);return i(e,u,r,n,s,a,!1,l)}function l(e,t,r,n,s,a,o="NDHWC"){let i,p;let[c,f,h]=d(t);if("NDHWC"===o)p="channelsLast",i=[c,f,h,e[4],e[4]];else if("NCDHW"===o)p="channelsFirst",i=[c,f,h,e[1],e[1]];else throw Error(`Unknown dataFormat ${o}`);return u(e,i,r,n,s,!1,p,a)}function i(e,t,r,n,s,a,o=!1,l="channelsLast"){let u,[d,m,g,x]=[-1,-1,-1,-1];if("channelsLast"===l)[d,m,g,x]=e;else if("channelsFirst"===l)[d,x,m,g]=e;else throw Error(`Unknown dataFormat ${l}`);let[v,y,,b]=t,[_,k]=c(r),[j,I]=c(n),C=f(v,j),w=f(y,I),{padInfo:T,outHeight:S,outWidth:N}=function(e,t,r,n,s,a,o,l,i){let u,c,d;if("number"==typeof e){let s=0===e?"VALID":"NUMBER";u={top:e,bottom:e,left:e,right:e,type:s};let o=function(e,t,r,n,s){null==n&&(n=p(e,t,r));let a=e[0],o=e[1];return[h((a-t+2*n)/r+1,s),h((o-t+2*n)/r+1,s)]}([t,r],a,n,e,l);c=o[0],d=o[1]}else if("same"===e){let e=Math.max(0,((c=Math.ceil(t/n))-1)*n+a-t),l=Math.max(0,((d=Math.ceil(r/s))-1)*s+o-r),i=Math.floor(e/2),p=Math.floor(l/2);u={top:i,bottom:e-i,left:p,right:l-p,type:"SAME"}}else if("valid"===e)u={top:0,bottom:0,left:0,right:0,type:"VALID"},c=Math.ceil((t-a+1)/n),d=Math.ceil((r-o+1)/s);else if("object"==typeof e){let p="channelsLast"===i?e[1][0]:e[2][0],f="channelsLast"===i?e[1][1]:e[2][1],m="channelsLast"===i?e[2][0]:e[3][0],g="channelsLast"===i?e[2][1]:e[3][1];u={top:p,bottom:f,left:m,right:g,type:0===p&&0===f&&0===m&&0===g?"VALID":"EXPLICIT"},c=h((t-a+p+f)/n+1,l),d=h((r-o+m+g)/s+1,l)}else throw Error(`Unknown padding parameter: ${e}`);return{padInfo:u,outHeight:c,outWidth:d}}(s,m,g,_,k,C,w,a,l),E=o?b*x:b;return"channelsFirst"===l?u=[d,E,S,N]:"channelsLast"===l&&(u=[d,S,N,E]),{batchSize:d,dataFormat:l,inHeight:m,inWidth:g,inChannels:x,outHeight:S,outWidth:N,outChannels:E,padInfo:T,strideHeight:_,strideWidth:k,filterHeight:v,filterWidth:y,effectiveFilterHeight:C,effectiveFilterWidth:w,dilationHeight:j,dilationWidth:I,inShape:e,outShape:u,filterShape:t}}function u(e,t,r,n,s,a=!1,o="channelsLast",l){let i,[c,m,g,x,v]=[-1,-1,-1,-1,-1];if("channelsLast"===o)[c,m,g,x,v]=e;else if("channelsFirst"===o)[c,v,m,g,x]=e;else throw Error(`Unknown dataFormat ${o}`);let[y,b,_,,k]=t,[j,I,C]=d(r),[w,T,S]=d(n),N=f(y,w),E=f(b,T),F=f(_,S),{padInfo:R,outDepth:A,outHeight:P,outWidth:D}=function(e,t,r,n,s,a,o,l,i,u,c){let d,f,m,g;if("valid"===e&&(e=0),"number"==typeof e){let x=0===e?"VALID":"NUMBER";d={top:e,bottom:e,left:e,right:e,front:e,back:e,type:x};let v=function(e,t,r,n,s,a){null==s&&(s=p(e,t[0],n[0]));let o=[0,0,0,1];for(let r=0;r<3;r++)e[r]+2*s>=t[r]&&(o[r]=h((e[r]-t[r]+2*s)/n[r]+1,a));return o}([t,r,n,1],[l,i,u],0,[s,a,o],e,c);f=v[0],m=v[1],g=v[2]}else if("same"===e){let e=((f=Math.ceil(t/s))-1)*s+l-t,p=((m=Math.ceil(r/a))-1)*a+i-r,c=((g=Math.ceil(n/o))-1)*o+u-n,h=Math.floor(e/2),x=Math.floor(p/2),v=Math.floor(c/2);d={top:x,bottom:p-x,left:v,right:c-v,front:h,back:e-h,type:"SAME"}}else throw Error(`Unknown padding parameter: ${e}`);return{padInfo:d,outDepth:f,outHeight:m,outWidth:g}}(s,m,g,x,j,I,C,N,E,F,l),$=a?k*v:k;return"channelsFirst"===o?i=[c,$,A,P,D]:"channelsLast"===o&&(i=[c,A,P,D,$]),{batchSize:c,dataFormat:o,inDepth:m,inHeight:g,inWidth:x,inChannels:v,outDepth:A,outHeight:P,outWidth:D,outChannels:$,padInfo:R,strideDepth:j,strideHeight:I,strideWidth:C,filterDepth:y,filterHeight:b,filterWidth:_,effectiveFilterDepth:N,effectiveFilterHeight:E,effectiveFilterWidth:F,dilationDepth:w,dilationHeight:T,dilationWidth:S,inShape:e,outShape:i,filterShape:t}}function p(e,t,r,n=1){let s=f(t,n);return Math.floor((e[0]*(r-1)-r+s)/2)}function c(e){return"number"==typeof e?[e,e,e]:2===e.length?[e[0],e[1],1]:e}function d(e){return"number"==typeof e?[e,e,e]:e}function f(e,t){return t<=1?e:e+(e-1)*(t-1)}function h(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 Error(`Unknown roundingMode ${t}`)}}function m(e){let[t,r,n]=c(e);return 1===t&&1===r&&1===n}function g(e,t){return m(e)||m(t)}function x(e){return c(e).every(e=>e>0)}function v(e){if("NHWC"===e)return"channelsLast";if("NCHW"===e)return"channelsFirst";throw Error(`Unknown dataFormat ${e}`)}function y(e,t,r){if(null!=r){if("string"==typeof t)throw Error(`Error in ${e}: pad must be an integer when using dimRoundingMode ${r} but got pad ${t}.`);if("number"==typeof t)s.assert(s.isInt(t),()=>`Error in ${e}: pad must be an integer when using dimRoundingMode ${r} but got pad ${t}.`);else if("object"==typeof t)t.forEach(t=>{t.forEach(t=>{s.assert(s.isInt(t),()=>`Error in ${e}: pad must be an integer when using dimRoundingMode ${r} but got pad ${t}.`)})});else throw Error(`Error in ${e}: Unknown padding parameter: ${t}`)}}},{"../util":"gBRMK","@parcel/transformer-js/src/esmodule-helpers.js":"9pCYc"}],VuY4S:[function(e,t,r){/** * @license * Copyright 2020 Google LLC. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. * ============================================================================= */var n=e("@parcel/transformer-js/src/esmodule-helpers.js");n.defineInteropFlag(r),n.export(r,"reshape",()=>l);var s=e("../engine"),a=e("../kernel_names"),o=e("../tensor_util_env");let l=/* @__PURE__ */(0,e("./operation").op)({reshape_:function(e,t){let r=(0,o.convertToTensor)(e,"x","reshape","string_or_numeric");return(0,s.ENGINE).runKernel(a.Reshape,{x:r},{shape:t})}})},{"../engine":"6eJyD","../kernel_names":"aqvy4","../tensor_util_env":"g1Qlv","./operation":"2kGjz","@parcel/transformer-js/src/esmodule-helpers.js":"9pCYc"}],hDR85:[function(e,t,r){/** * @license * Copyright 2020 Google LLC. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. * ============================================================================= */var n=e("@parcel/transformer-js/src/esmodule-helpers.js");n.defineInteropFlag(r),n.export(r,"avgPool3d",()=>d);var s=e("../engine"),a=e("../kernel_names"),o=e("../tensor_util_env"),l=e("../util"),i=e("./cast"),u=e("./conv_util"),p=e("./operation"),c=e("./reshape");let d=/* @__PURE__ */(0,p.op)({avgPool3d_:function(e,t,r,n,p,d="NDHWC"){let f=(0,o.convertToTensor)(e,"x","avgPool3d","float32"),h=f,m=!1;4===f.rank&&(m=!0,h=(0,c.reshape)(f,[1,f.shape[0],f.shape[1],f.shape[2],f.shape[3]])),l.assert(5===h.rank,()=>`Error in avgPool3d: x must be rank 5 but got rank ${h.rank}.`),l.assert("NDHWC"===d,()=>`Error in avgPool3d: Only NDHWC is currently supported, but got dataFormat of ${d}`),l.assert("number"==typeof r&&r>0||Array.isArray(r)&&r[0]>0&&r[1]>0&&r[2]>0,()=>`Error in avgPool3d: Stride must be > 0, but got '${r}'`),(0,u.checkPadOnDimRoundingMode)("avgPool3d",n,p);let g={x:h},x=(0,s.ENGINE).runKernel(a.AvgPool3D,g,{filterSize:t,strides:r,pad:n,dimRoundingMode:p,dataFormat:d});return(x=(0,i.cast)(x,h.dtype),m)?(0,c.reshape)(x,[x.shape[1],x.shape[2],x.shape[3],x.shape[4]]):x}})},{"../engine":"6eJyD","../kernel_names":"aqvy4","../tensor_util_env":"g1Qlv","../util":"gBRMK","./cast":"ekSnT","./conv_util":"kmOtb","./operation":"2kGjz","./reshape":"VuY4S","@parcel/transformer-js/src/esmodule-helpers.js":"9pCYc"}],"4i0eA":[function(e,t,r){/** * @license * Copyright 2020 Google LLC. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. * ============================================================================= */var n=e("@parcel/transformer-js/src/esmodule-helpers.js");n.defineInteropFlag(r),n.export(r,"basicLSTMCell",()=>f);var s=e("../tensor_util_env"),a=e("./add"),o=e("./concat"),l=e("./mat_mul"),i=e("./mul"),u=e("./operation"),p=e("./sigmoid"),c=e("./slice"),d=e("./tanh");let f=/* @__PURE__ */(0,u.op)({basicLSTMCell_:function(e,t,r,n,u,f){let h=(0,s.convertToTensor)(e,"forgetBias","basicLSTMCell"),m=(0,s.convertToTensor)(t,"lstmKernel","basicLSTMCell"),g=(0,s.convertToTensor)(r,"lstmBias","basicLSTMCell"),x=(0,s.convertToTensor)(n,"data","basicLSTMCell"),v=(0,s.convertToTensor)(u,"c","basicLSTMCell"),y=(0,s.convertToTensor)(f,"h","basicLSTMCell"),b=(0,o.concat)([x,y],1),_=(0,l.matMul)(b,m),k=(0,a.add)(_,g),j=k.shape[0],I=k.shape[1]/4,C=[j,I],w=(0,c.slice)(k,[0,0],C),T=(0,c.slice)(k,[0,I],C),S=(0,c.slice)(k,[0,2*I],C),N=(0,c.slice)(k,[0,3*I],C),E=(0,a.add)((0,i.mul)((0,p.sigmoid)(w),(0,d.tanh)(T)),(0,i.mul)(v,(0,p.sigmoid)((0,a.add)(h,S)))),F=(0,i.mul)((0,d.tanh)(E),(0,p.sigmoid)(N));return[E,F]}})},{"../tensor_util_env":"g1Qlv","./add":"g9v2X","./concat":"aQPCM","./mat_mul":"9ZocJ","./mul":"gPetX","./operation":"2kGjz","./sigmoid":"gGNpa","./slice":"cjlcK","./tanh":"yVinF","@parcel/transformer-js/src/esmodule-helpers.js":"9pCYc"}],aQPCM:[function(e,t,r){/** * @license * Copyright 2020 Google LLC. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. * ============================================================================= */var n=e("@parcel/transformer-js/src/esmodule-helpers.js");n.defineInteropFlag(r),n.export(r,"concat",()=>u);var s=e("../engine"),a=e("../kernel_names"),o=e("../tensor_util_env"),l=e("../util"),i=e("./clone");let u=/* @__PURE__ */(0,e("./operation").op)({concat_:function(e,t=0){(0,l.assert)(e.length>=1,()=>"Pass at least one tensor to concat");let r=(0,o.convertToTensorArray)(e,"tensors","concat","string_or_numeric");return("complex64"===r[0].dtype&&r.forEach(e=>{if("complex64"!==e.dtype)throw Error(`Cannot concatenate complex64 tensors with a tensor with dtype ${e.dtype}. `)}),1===r.length)?(0,i.clone)(r[0]):(0,s.ENGINE).runKernel(a.Concat,r,{axis:t})}})},{"../engine":"6eJyD","../kernel_names":"aqvy4","../tensor_util_env":"g1Qlv","../util":"gBRMK","./clone":"gI2Tp","./operation":"2kGjz","@parcel/transformer-js/src/esmodule-helpers.js":"9pCYc"}],"9ZocJ":[function(e,t,r){/** * @license * Copyright 2020 Google LLC. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. * ============================================================================= */var n=e("@parcel/transformer-js/src/esmodule-helpers.js");n.defineInteropFlag(r),n.export(r,"matMul",()=>i);var s=e("../engine"),a=e("../kernel_names"),o=e("../tensor_util"),l=e("../tensor_util_env");let i=/* @__PURE__ */(0,e("./operation").op)({matMul_:function(e,t,r=!1,n=!1){let i=(0,l.convertToTensor)(e,"a","matMul"),u=(0,l.convertToTensor)(t,"b","matMul");[i,u]=(0,o.makeTypesMatch)(i,u);let p={a:i,b:u};return(0,s.ENGINE).runKernel(a.BatchMatMul,p,{transposeA:r,transposeB:n})}})},{"../engine":"6eJyD","../kernel_names":"aqvy4","../tensor_util":"jgr40","../tensor_util_env":"g1Qlv","./operation":"2kGjz","@parcel/transformer-js/src/esmodule-helpers.js":"9pCYc"}],gGNpa:[function(e,t,r){/** * @license * Copyright 2018 Google LLC. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. * ============================================================================= */var n=e("@parcel/transformer-js/src/esmodule-helpers.js");n.defineInteropFlag(r),n.export(r,"sigmoid",()=>l);var s=e("../engine"),a=e("../kernel_names"),o=e("../tensor_util_env");let l=/* @__PURE__ */(0,e("./operation").op)({sigmoid_:function(e){let t=(0,o.convertToTensor)(e,"x","sigmoid","float32");return(0,s.ENGINE).runKernel(a.Sigmoid,{x:t})}})},{"../engine":"6eJyD","../kernel_names":"aqvy4","../tensor_util_env":"g1Qlv","./operation":"2kGjz","@parcel/transformer-js/src/esmodule-helpers.js":"9pCYc"}],cjlcK:[function(e,t,r){/** * @license * Copyright 2018 Google LLC. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. * ============================================================================= */var n=e("@parcel/transformer-js/src/esmodule-helpers.js");n.defineInteropFlag(r),n.export(r,"slice",()=>l);var s=e("../engine"),a=e("../kernel_names"),o=e("../tensor_util_env");let l=/* @__PURE__ */(0,e("./operation").op)({slice_:function(e,t,r){let n=(0,o.convertToTensor)(e,"x","slice","string_or_numeric");if(0===n.rank)throw Error("Slicing scalar is not possible");return(0,s.ENGINE).runKernel(a.Slice,{x:n},{begin:t,size:r})}})},{"../engine":"6eJyD","../kernel_names":"aqvy4","../tensor_util_env":"g1Qlv","./operation":"2kGjz","@parcel/transformer-js/src/esmodule-helpers.js":"9pCYc"}],yVinF:[function(e,t,r){/** * @license * Copyright 2018 Google LLC. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. * ============================================================================= */var n=e("@parcel/transformer-js/src/esmodule-helpers.js");n.defineInteropFlag(r),n.export(r,"tanh",()=>l);var s=e("../engine"),a=e("../kernel_names"),o=e("../tensor_util_env");let l=/* @__PURE__ */(0,e("./operation").op)({tanh_:function(e){let t=(0,o.convertToTensor)(e,"x","tanh","float32");return(0,s.ENGINE).runKernel(a.Tanh,{x:t})}})},{"../engine":"6eJyD","../kernel_names":"aqvy4","../tensor_util_env":"g1Qlv","./operation":"2kGjz","@parcel/transformer-js/src/esmodule-helpers.js":"9pCYc"}],h1uzb:[function(e,t,r){/** * @license * Copyright 2020 Google LLC. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. * ============================================================================= */var n=e("@parcel/transformer-js/src/esmodule-helpers.js");n.defineInteropFlag(r),n.export(r,"batchToSpaceND",()=>i);var s=e("../engine"),a=e("../kernel_names"),o=e("../tensor_util_env"),l=e("../util");let i=/* @__PURE__ */(0,e("./operation").op)({batchToSpaceND_:function(e,t,r){let n=(0,o.convertToTensor)(e,"x","batchToSpaceND"),i=t.reduce((e,t)=>e*t);return l.assert(n.rank>=1+t.length,()=>`input rank is ${n.rank} but should be > than blockShape.length ${t.length}`),l.assert(r.length===t.length,()=>`crops.length is ${r.length} but should be equal to blockShape.length ${t.length}`),l.assert(n.shape[0]%i==0,()=>`input tensor batch is ${n.shape[0]} but is not divisible by the product of the elements of blockShape ${t.join(" * ")} === ${i}`),(0,s.ENGINE).runKernel(a.BatchToSpaceND,{x:n},{blockShape:t,crops:r})}})},{"../engine":"6eJyD","../kernel_names":"aqvy4","../tensor_util_env":"g1Qlv","../util":"gBRMK","./operation":"2kGjz","@parcel/transformer-js/src/esmodule-helpers.js":"9pCYc"}],"8XeJn":[function(e,t,r){/** * @license * Copyright 2020 Google LLC. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. * ============================================================================= */var n=e("@parcel/transformer-js/src/esmodule-helpers.js");n.defineInteropFlag(r),n.export(r,"batchNorm",()=>c);var s=e("../engine"),a=e("../kernel_names"),o=e("../tensor_util_env"),l=e("../util"),i=e("./batchnorm_util"),u=e("./operation"),p=e("./reshape");let c=/* @__PURE__ */(0,u.op)({batchNorm_:function(e,t,r,n,u,c){let d,f;null==c&&(c=.001);let h=(0,o.convertToTensor)(e,"x","batchNorm"),m=(0,o.convertToTensor)(t,"mean","batchNorm"),g=(0,o.convertToTensor)(r,"variance","batchNorm");null!=u&&(d=(0,o.convertToTensor)(u,"scale","batchNorm")),null!=n&&(f=(0,o.convertToTensor)(n,"offset","batchNorm")),l.assert(m.rank===g.rank,()=>"Batch normalization gradient requires mean and variance to have equal ranks."),l.assert(null==f||m.rank===f.rank,()=>"Batch normalization gradient requires mean and offset to have equal ranks."),l.assert(null==d||m.rank===d.rank,()=>"Batch normalization gradient requires mean and scale to have equal ranks.");let x={x:(0,i.xAs4D)(h),scale:d,offset:f,mean:m,variance:g},v={varianceEpsilon:c},y=(0,s.ENGINE).runKernel(a.FusedBatchNorm,x,v);return(0,p.reshape)(y,h.shape)}})},{"../engine":"6eJyD","../kernel_names":"aqvy4","../tensor_util_env":"g1Qlv","../util":"gBRMK","./batchnorm_util":"2BjdW","./operation":"2kGjz","./reshape":"VuY4S","@parcel/transformer-js/src/esmodule-helpers.js":"9pCYc"}],"2BjdW":[function(e,t,r){var n=e("@parcel/transformer-js/src/esmodule-helpers.js");n.defineInteropFlag(r),n.export(r,"xAs4D",()=>a);var s=e("./reshape");function a(e){return 0===e.rank||1===e.rank?(0,s.reshape)(e,[1,1,1,e.size]):2===e.rank?(0,s.reshape)(e,[1,1,e.shape[0],e.shape[1]]):3===e.rank?(0,s.reshape)(e,[1,e.shape[0],e.shape[1],e.shape[2]]):e}},{"./reshape":"VuY4S","@parcel/transformer-js/src/esmodule-helpers.js":"9pCYc"}],k6XHa:[function(e,t,r){var n=e("@parcel/transformer-js/src/esmodule-helpers.js");n.defineInteropFlag(r),n.export(r,"batchNorm2d",()=>l);var s=e("../tensor_util_env"),a=e("../util"),o=e("./batchnorm");let l=/* @__PURE__ */(0,e("./operation").op)({batchNorm2d_:function(e,t,r,n,l,i){let u,p;let c=(0,s.convertToTensor)(e,"x","batchNorm"),d=(0,s.convertToTensor)(t,"mean","batchNorm"),f=(0,s.convertToTensor)(r,"variance","batchNorm");return null!=l&&(u=(0,s.convertToTensor)(l,"scale","batchNorm")),null!=n&&(p=(0,s.convertToTensor)(n,"offset","batchNorm")),a.assert(2===c.rank,()=>`Error in batchNorm2D: x must be rank 2 but got rank ${c.rank}.`),a.assert(2===d.rank||1===d.rank,()=>`Error in batchNorm2D: mean must be rank 2 or rank 1 but got rank ${d.rank}.`),a.assert(2===f.rank||1===f.rank,()=>`Error in batchNorm2D: variance must be rank 2 or rank 1 but got rank ${f.rank}.`),null!=u&&a.assert(2===u.rank||1===u.rank,()=>`Error in batchNorm2D: scale must be rank 2 or rank 1 but got rank ${u.rank}.`),null!=p&&a.assert(2===p.rank||1===p.rank,()=>`Error in batchNorm2D: offset must be rank 2 or rank 1 but got rank ${p.rank}.`),(0,o.batchNorm)(c,d,f,p,u,i)}})},{"../tensor_util_env":"g1Qlv","../util":"gBRMK","./batchnorm":"8XeJn","./operation":"2kGjz","@parcel/transformer-js/src/esmodule-helpers.js":"9pCYc"}],f79DB:[function(e,t,r){var n=e("@parcel/transformer-js/src/esmodule-helpers.js");n.defineInteropFlag(r),n.export(r,"batchNorm3d",()=>l);var s=e("../tensor_util_env"),a=e("../util"),o=e("./batchnorm");let l=/* @__PURE__ */(0,e("./operation").op)({batchNorm3d_:function(e,t,r,n,l,i){let u,p;let c=(0,s.convertToTensor)(e,"x","batchNorm"),d=(0,s.convertToTensor)(t,"mean","batchNorm"),f=(0,s.convertToTensor)(r,"variance","batchNorm");return null!=l&&(u=(0,s.convertToTensor)(l,"scale","batchNorm")),null!=n&&(p=(0,s.convertToTensor)(n,"offset","batchNorm")),a.assert(3===c.rank,()=>`Error in batchNorm3D: x must be rank 3 but got rank ${c.rank}.`),a.assert(3===d.rank||1===d.rank,()=>`Error in batchNorm3D: mean must be rank 3 or rank 1 but got rank ${d.rank}.`),a.assert(3===f.rank||1===f.rank,()=>`Error in batchNorm3D: variance must be rank 3 or rank 1 but got rank ${f.rank}.`),null!=u&&a.assert(3===u.rank||1===u.rank,()=>`Error in batchNorm3D: scale must be rank 3 or rank 1 but got rank ${u.rank}.`),null!=p&&a.assert(3===p.rank||1===p.rank,()=>`Error in batchNorm3D: offset must be rank 3 or rank 1 but got rank ${p.rank}.`),(0,o.batchNorm)(c,d,f,p,u,i)}})},{"../tensor_util_env":"g1Qlv","../util":"gBRMK","./batchnorm":"8XeJn","./operation":"2kGjz","@parcel/transformer-js/src/esmodule-helpers.js":"9pCYc"}],bivaa:[function(e,t,r){var n=e("@parcel/transformer-js/src/esmodule-helpers.js");n.defineInteropFlag(r),n.export(r,"batchNorm4d",()=>l);var s=e("../tensor_util_env"),a=e("../util"),o=e("./batchnorm");let l=/* @__PURE__ */(0,e("./operation").op)({batchNorm4d_:function(e,t,r,n,l,i){let u,p;let c=(0,s.convertToTensor)(e,"x","batchNorm"),d=(0,s.convertToTensor)(t,"mean","batchNorm"),f=(0,s.convertToTensor)(r,"variance","batchNorm");return null!=l&&(u=(0,s.convertToTensor)(l,"scale","batchNorm")),null!=n&&(p=(0,s.convertToTensor)(n,"offset","batchNorm")),a.assert(4===c.rank,()=>`Error in batchNorm4D: x must be rank 4 but got rank ${c.rank}.`),a.assert(4===d.rank||1===d.rank,()=>`Error in batchNorm4D: mean must be rank 4 or rank 1 but got rank ${d.rank}.`),a.assert(4===f.rank||1===f.rank,()=>`Error in batchNorm4D: variance must be rank 4 or rank 1 but got rank ${f.rank}.`),null!=u&&a.assert(4===u.rank||1===u.rank,()=>`Error in batchNorm4D: scale must be rank 4 or rank 1 but got rank ${u.rank}.`),null!=p&&a.assert(4===p.rank||1===p.rank,()=>`Error in batchNorm4D: offset must be rank 4 or rank 1 but got rank ${p.rank}.`),(0,o.batchNorm)(c,d,f,p,u,i)}})},{"../tensor_util_env":"g1Qlv","../util":"gBRMK","./batchnorm":"8XeJn","./operation":"2kGjz","@parcel/transformer-js/src/esmodule-helpers.js":"9pCYc"}],"1eiwT":[function(e,t,r){/** * @license * Copyright 2020 Google LLC. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. * ============================================================================= */var n=e("@parcel/transformer-js/src/esmodule-helpers.js");n.defineInteropFlag(r),n.export(r,"bincount",()=>i);var s=e("../engine"),a=e("../kernel_names"),o=e("../tensor_util_env"),l=e("../util");let i=/* @__PURE__ */(0,e("./operation").op)({bincount_:function(e,t,r){let n=(0,o.convertToTensor)(e,"x","bincount"),i=(0,o.convertToTensor)(t,"weights","bincount");return l.assert("int32"===n.dtype,()=>`Error in bincount: input dtype must be int32, but got ${n.dtype}`),l.assert(r>=0,()=>`size must be non-negative, but got ${r}.`),l.assert(i.size===n.size||0===i.size,()=>`Error in bincount: weights must have the same size as input or0-length, but got input shape: ${n.shape}, weights shape: ${i.shape}.`),(0,s.ENGINE).runKernel(a.Bincount,{x:n,weights:i},{size:r})}})},{"../engine":"6eJyD","../kernel_names":"aqvy4","../tensor_util_env":"g1Qlv","../util":"gBRMK","./operation":"2kGjz","@parcel/transformer-js/src/esmodule-helpers.js":"9pCYc"}],k3aiR:[function(e,t,r){/** * @license * Copyright 2023 Google LLC. * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. * ============================================================================= */var n=e("@parcel/transformer-js/src/esmodule-helpers.js");n.defineInteropFlag(r),n.export(r,"bitwiseAnd",()=>i);var s=e("../engine"),a=e("../kernel_names"),o=e("../tensor_util_env"),l=e("../util_base");let i=/* @__PURE__ */(0,e("./operation").op)({bitwiseAnd_:function(e,t){let r=(0,o.convertToTensor)(e,"x","bitwiseAnd"),n=(0,o.convertToTensor)(t,"y","bitwiseAnd");if(!(0,l.arraysEqual)(r.shape,n.shape))throw Error(`BitwiseAnd: Tensors must have the same shape. x: ${r.shape}, y: ${n.shape}`);if("int32"!==r.dtype||"int32"!==n.dtype)throw Error(`BitwiseAnd: Only supports 'int32' values in tensor, found type of x: ${r.dtype} and type of y: ${n.dtype}`);return(0,s.ENGINE).runKernel(a.BitwiseAnd,{a:r,b:n})}})},{"../engine":"6eJyD","../kernel_names":"aqvy4","../tensor_util_env":"g1Qlv","../util_base":"8U7kO","./operation":"2kGjz","@parcel/transformer-js/src/esmodule-helpers.js":"9pCYc"}],"3DTNA":[function(e,t,r){/** * @license * Copyright 2021 Google LLC. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. * ============================================================================= */var n=e("@parcel/transformer-js/src/esmodule-helpers.js");n.defineInteropFlag(r),n.export(r,"broadcastArgs",()=>l);var s=e("../engine"),a=e("../kernel_names"),o=e("../tensor_util_env");let l=/* @__PURE__ */(0,e("./operation").op)({broadcastArgs_:function(e,t){let r=(0,o.convertToTensor)(e,"s0","broadcastArgs","int32"),n=(0,o.convertToTensor)(t,"s1","broadcastArgs","int32");if(1!==r.rank)throw Error(`broadcastArgs(): first input must be a vector (rank=1). Has rank ${r.rank}`);if(1!==n.rank)throw Error(`broadcastArgs(): second input must be a vector (rank=1). Has rank ${n.rank}`);return(0,s.ENGINE).runKernel(a.BroadcastArgs,{s0:r,s1:n})}})},{"../engine":"6eJyD","../kernel_names":"aqvy4","../tensor_util_env":"g1Qlv","./operation":"2kGjz","@parcel/transformer-js/src/esmodule-helpers.js":"9pCYc"}],"3fEHu":[function(e,t,r){/** * @license * Copyright 2020 Google LLC. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. * ============================================================================= */var n=e("@parcel/transformer-js/src/esmodule-helpers.js");n.defineInteropFlag(r),n.export(r,"broadcastTo",()=>c);var s=e("../engine"),a=e("../kernel_names"),o=e("../tensor_util_env"),l=e("../util_base"),i=e("./clone"),u=e("./operation"),p=e("./reshape");let c=/* @__PURE__ */(0,u.op)({broadcastTo_:function(e,t){let r=(0,o.convertToTensor)(e,"broadcastTo","x"),n=r.shape;if((0,l.assertNonNegativeIntegerDimensions)(t),t.lengthr.rank){let e=r.shape.slice();for(;e.length=0;e--)if(u[e]===t[e])c[e]=1;else if(1!==r.shape[e])throw Error(`broadcastTo(): [${n}] cannot be broadcast to [${t}].`);if(0===c.map((e,t)=>e>1?t:-1).filter(e=>e>=0).length)return(0,i.clone)(r);let d={x:r};return(0,s.ENGINE).runKernel(a.Tile,d,{reps:c})}})},{"../engine":"6eJyD","../kernel_names":"aqvy4","../tensor_util_env":"g1Qlv","../util_base":"8U7kO","./clone":"gI2Tp","./operation":"2kGjz","./reshape":"VuY4S","@parcel/transformer-js/src/esmodule-helpers.js":"9pCYc"}],ib8D9:[function(e,t,r){/** * @license * Copyright 2018 Google LLC. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. * ============================================================================= */var n=e("@parcel/transformer-js/src/esmodule-helpers.js");n.defineInteropFlag(r),n.export(r,"ceil",()=>l);var s=e("../engine"),a=e("../kernel_names"),o=e("../tensor_util_env");let l=/* @__PURE__ */(0,e("./operation").op)({ceil_:function(e){let t=(0,o.convertToTensor)(e,"x","ceil","float32");return(0,s.ENGINE).runKernel(a.Ceil,{x:t})}})},{"../engine":"6eJyD","../kernel_names":"aqvy4","../tensor_util_env":"g1Qlv","./operation":"2kGjz","@parcel/transformer-js/src/esmodule-helpers.js":"9pCYc"}],b2nZF:[function(e,t,r){/** * @license * Copyright 2018 Google LLC. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. * ============================================================================= */var n=e("@parcel/transformer-js/src/esmodule-helpers.js");n.defineInteropFlag(r),n.export(r,"clipByValue",()=>u);var s=e("../engine"),a=e("../kernel_names"),o=e("../tensor_util_env"),l=e("../util"),i=e("./fill");let u=/* @__PURE__ */(0,e("./operation").op)({clipByValue_:function(e,t,r){let n=(0,o.convertToTensor)(e,"x","clipByValue");return(l.assert(t<=r,()=>`Error in clip: min (${t}) must be less than or equal to max (${r}).`),t===r)?(0,i.fill)(n.shape,t,n.dtype):(0,s.ENGINE).runKernel(a.ClipByValue,{x:n},{clipValueMin:t,clipValueMax:r})}})},{"../engine":"6eJyD","../kernel_names":"aqvy4","../tensor_util_env":"g1Qlv","../util":"gBRMK","./fill":"b1ljI","./operation":"2kGjz","@parcel/transformer-js/src/esmodule-helpers.js":"9pCYc"}],b1ljI:[function(e,t,r){/** * @license * Copyright 2020 Google LLC. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. * ============================================================================= */var n=e("@parcel/transformer-js/src/esmodule-helpers.js");n.defineInteropFlag(r),n.export(r,"fill",()=>i);var s=e("../engine"),a=e("../kernel_names"),o=e("../util"),l=e("../util_base");function i(e,t,r){(0,l.assertNonNegativeIntegerDimensions)(e),r=r||(0,o.inferDtype)(t);let n={shape:e,value:t,dtype:r};return(0,s.ENGINE).runKernel(a.Fill,{},n)}},{"../engine":"6eJyD","../kernel_names":"aqvy4","../util":"gBRMK","../util_base":"8U7kO","@parcel/transformer-js/src/esmodule-helpers.js":"9pCYc"}],b4JWP:[function(e,t,r){var n=e("@parcel/transformer-js/src/esmodule-helpers.js");n.defineInteropFlag(r),n.export(r,"concat1d",()=>a);var s=e("./concat");let a=/* @__PURE__ */(0,e("./operation").op)({concat1d_:function(e){return(0,s.concat)(e,0)}})},{"./concat":"aQPCM","./operation":"2kGjz","@parcel/transformer-js/src/esmodule-helpers.js":"9pCYc"}],"4ojPm":[function(e,t,r){var n=e("@parcel/transformer-js/src/esmodule-helpers.js");n.defineInteropFlag(r),n.export(r,"concat2d",()=>a);var s=e("./concat");let a=/* @__PURE__ */(0,e("./operation").op)({concat2d_:function(e,t){return(0,s.concat)(e,t)}})},{"./concat":"aQPCM","./operation":"2kGjz","@parcel/transformer-js/src/esmodule-helpers.js":"9pCYc"}],jInMT:[function(e,t,r){var n=e("@parcel/transformer-js/src/esmodule-helpers.js");n.defineInteropFlag(r),n.export(r,"concat3d",()=>a);var s=e("./concat");let a=/* @__PURE__ */(0,e("./operation").op)({concat3d_:function(e,t){return(0,s.concat)(e,t)}})},{"./concat":"aQPCM","./operation":"2kGjz","@parcel/transformer-js/src/esmodule-helpers.js":"9pCYc"}],"8reej":[function(e,t,r){var n=e("@parcel/transformer-js/src/esmodule-helpers.js");n.defineInteropFlag(r),n.export(r,"concat4d",()=>a);var s=e("./concat");let a=/* @__PURE__ */(0,e("./operation").op)({concat4d_:function(e,t){return(0,s.concat)(e,t)}})},{"./concat":"aQPCM","./operation":"2kGjz","@parcel/transformer-js/src/esmodule-helpers.js":"9pCYc"}],kX6wE:[function(e,t,r){var n=e("@parcel/transformer-js/src/esmodule-helpers.js");n.defineInteropFlag(r),n.export(r,"conv1d",()=>p);var s=e("../tensor_util_env"),a=e("../util"),o=e("./conv2d"),l=e("./conv_util"),i=e("./operation"),u=e("./reshape");let p=/* @__PURE__ */(0,i.op)({conv1d_:function(e,t,r,n,i="NWC",p=1,c){let d=(0,s.convertToTensor)(e,"x","conv1d"),f=(0,s.convertToTensor)(t,"filter","conv1d"),h=d,m=!1;2===d.rank&&(m=!0,h=(0,u.reshape)(d,[1,d.shape[0],d.shape[1]])),a.assert(3===h.rank,()=>`Error in conv1d: input must be rank 3, but got rank ${h.rank}.`),a.assert(3===f.rank,()=>`Error in conv1d: filter must be rank 3, but got rank ${f.rank}.`),l.checkPadOnDimRoundingMode("conv1d",n,c),a.assert(h.shape[2]===f.shape[1],()=>`Error in conv1d: depth of input (${h.shape[2]}) must match input depth for filter ${f.shape[1]}.`),a.assert(l.eitherStridesOrDilationsAreOne(r,p),()=>`Error in conv1D: Either stride or dilation must be 1. Got stride ${r} and dilation '${p}'`),a.assert(l.stridesOrDilationsArePositive(p),()=>"Error in conv1D: Dilated rates should be larger than 0."),a.assert(l.stridesOrDilationsArePositive(r),()=>"Error in conv1D: Stride should be larger than 0."),a.assert("NWC"===i,()=>`Error in conv1d: got dataFormat of ${i} but only NWC is currently supported.`);let g=(0,u.reshape)(f,[1,f.shape[0],f.shape[1],f.shape[2]]),x=(0,u.reshape)(h,[h.shape[0],1,h.shape[1],h.shape[2]]),v=(0,o.conv2d)(x,g,[1,r],n,"NHWC",[1,p],c);return m?(0,u.reshape)(v,[v.shape[2],v.shape[3]]):(0,u.reshape)(v,[v.shape[0],v.shape[2],v.shape[3]])}})},{"../tensor_util_env":"g1Qlv","../util":"gBRMK","./conv2d":"59r1a","./conv_util":"kmOtb","./operation":"2kGjz","./reshape":"VuY4S","@parcel/transformer-js/src/esmodule-helpers.js":"9pCYc"}],"59r1a":[function(e,t,r){/** * @license * Copyright 2020 Google LLC. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. * ============================================================================= */var n=e("@parcel/transformer-js/src/esmodule-helpers.js");n.defineInteropFlag(r),n.export(r,"conv2d",()=>c);var s=e("../engine"),a=e("../kernel_names"),o=e("../tensor_util_env"),l=e("../util"),i=e("./conv_util"),u=e("./operation"),p=e("./reshape");let c=/* @__PURE__ */(0,u.op)({conv2d_:function(e,t,r,n,u="NHWC",c=[1,1],d){let f=(0,o.convertToTensor)(e,"x","conv2d","float32"),h=(0,o.convertToTensor)(t,"filter","conv2d","float32"),m=f,g=!1;3===f.rank&&(g=!0,m=(0,p.reshape)(f,[1,f.shape[0],f.shape[1],f.shape[2]])),l.assert(4===m.rank,()=>`Error in conv2d: input must be rank 4, but got rank ${m.rank}.`),l.assert(4===h.rank,()=>`Error in conv2d: filter must be rank 4, but got rank ${h.rank}.`),i.checkPadOnDimRoundingMode("conv2d",n,d);let x="NHWC"===u?m.shape[3]:m.shape[1];l.assert(x===h.shape[2],()=>`Error in conv2d: depth of input (${x}) must match input depth for filter ${h.shape[2]}.`),l.assert(i.eitherStridesOrDilationsAreOne(r,c),()=>`Error in conv2D: Either strides or dilations must be 1. Got strides ${r} and dilations '${c}'`),l.assert(i.stridesOrDilationsArePositive(c),()=>"Error in conv2D: Dilated rates should be larger than 0."),l.assert(i.stridesOrDilationsArePositive(r),()=>"Error in conv2D: Strides should be larger than 0.");let v={x:m,filter:h},y=(0,s.ENGINE).runKernel(a.Conv2D,v,{strides:r,pad:n,dataFormat:u,dilations:c,dimRoundingMode:d});return g?(0,p.reshape)(y,[y.shape[1],y.shape[2],y.shape[3]]):y}})},{"../engine":"6eJyD","../kernel_names":"aqvy4","../tensor_util_env":"g1Qlv","../util":"gBRMK","./conv_util":"kmOtb","./operation":"2kGjz","./reshape":"VuY4S","@parcel/transformer-js/src/esmodule-helpers.js":"9pCYc"}],juZcV:[function(e,t,r){var n=e("@parcel/transformer-js/src/esmodule-helpers.js");n.defineInteropFlag(r),n.export(r,"conv2dTranspose",()=>o);var s=e("../tensor_util_env"),a=e("./conv2d_backprop_input");let o=/* @__PURE__ */(0,e("./operation").op)({conv2dTranspose_:function(e,t,r,n,o,l){let i=(0,s.convertToTensor)(e,"x","conv2dTranspose"),u=(0,s.convertToTensor)(t,"filter","conv2dTranspose");return(0,a.conv2DBackpropInput)(r,i,u,n,o,"NHWC",l)}})},{"../tensor_util_env":"g1Qlv","./conv2d_backprop_input":"bD5qH","./operation":"2kGjz","@parcel/transformer-js/src/esmodule-helpers.js":"9pCYc"}],bD5qH:[function(e,t,r){/** * @license * Copyright 2020 Google LLC. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. * ============================================================================= */var n=e("@parcel/transformer-js/src/esmodule-helpers.js");n.defineInteropFlag(r),n.export(r,"conv2DBackpropInput",()=>p);var s=e("../engine"),a=e("../kernel_names"),o=e("../util"),l=e("./conv_util"),i=e("./operation"),u=e("./reshape");let p=/* @__PURE__ */(0,i.op)({conv2DBackpropInput_:function(e,t,r,n,i,p="NHWC",c){o.assert(e.length===t.rank,()=>`Length of inShape (${e.length}) and rank of dy (${t.rank}) must match`);let d=e,f=t,h=!1;3===t.rank&&(h=!0,f=(0,u.reshape)(t,[1,t.shape[0],t.shape[1],t.shape[2]]),d=[1,e[0],e[1],e[2]]),o.assert(4===d.length,()=>`Error in conv2dDerInput: inShape must be length 4, but got length ${d.length}.`),o.assert(4===f.rank,()=>`Error in conv2dDerInput: dy must be rank 4, but got rank ${f.rank}`),o.assert(4===r.rank,()=>`Error in conv2dDerInput: filter must be rank 4, but got rank ${r.rank}`);let m="NHWC"===p?d[3]:d[1],g="NHWC"===p?f.shape[3]:f.shape[1];o.assert(m===r.shape[2],()=>`Error in conv2dDerInput: depth of input (${m}) must match input depth for filter ${r.shape[2]}.`),o.assert(g===r.shape[3],()=>`Error in conv2dDerInput: depth of output (${g}) must match output depth for filter ${r.shape[3]}.`),l.checkPadOnDimRoundingMode("conv2dDerInput",i,c);let x={dy:f,filter:r},v={strides:n,pad:i,dataFormat:p,dimRoundingMode:c,inputShape:d},y=(0,s.ENGINE).runKernel(a.Conv2DBackpropInput,x,v);return h?(0,u.reshape)(y,[y.shape[1],y.shape[2],y.shape[3]]):y}})},{"../engine":"6eJyD","../kernel_names":"aqvy4","../util":"gBRMK","./conv_util":"kmOtb","./operation":"2kGjz","./reshape":"VuY4S","@parcel/transformer-js/src/esmodule-helpers.js":"9pCYc"}],"4kwgW":[function(e,t,r){/** * @license * Copyright 2020 Google LLC. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. * ============================================================================= */var n=e("@parcel/transformer-js/src/esmodule-helpers.js");n.defineInteropFlag(r),n.export(r,"conv3d",()=>c);var s=e("../engine"),a=e("../kernel_names"),o=e("../tensor_util_env"),l=e("../util"),i=e("./conv_util"),u=e("./operation"),p=e("./reshape");let c=/* @__PURE__ */(0,u.op)({conv3d_:function(e,t,r,n,u="NDHWC",c=[1,1,1]){let d=(0,o.convertToTensor)(e,"x","conv3d"),f=(0,o.convertToTensor)(t,"filter","conv3d"),h=d,m=!1;4===d.rank&&(m=!0,h=(0,p.reshape)(d,[1,d.shape[0],d.shape[1],d.shape[2],d.shape[3]])),l.assert(5===h.rank,()=>`Error in conv3d: input must be rank 5, but got rank ${h.rank}.`),l.assert(5===f.rank,()=>`Error in conv3d: filter must be rank 5, but got rank ${f.rank}.`),l.assert(h.shape[4]===f.shape[3],()=>`Error in conv3d: depth of input (${h.shape[4]}) must match input depth for filter ${f.shape[3]}.`),l.assert((0,i.eitherStridesOrDilationsAreOne)(r,c),()=>`Error in conv3D: Either strides or dilations must be 1. Got strides ${r} and dilations '${c}'`),l.assert("NDHWC"===u,()=>`Error in conv3d: got dataFormat of ${u} but only NDHWC is currently supported.`),l.assert((0,i.stridesOrDilationsArePositive)(c),()=>"Error in conv3D: Dilated rates should be larger than 0."),l.assert((0,i.stridesOrDilationsArePositive)(r),()=>"Error in conv3D: Strides should be larger than 0.");let g={x:h,filter:f},x=(0,s.ENGINE).runKernel(a.Conv3D,g,{strides:r,pad:n,dataFormat:u,dilations:c});return m?(0,p.reshape)(x,[x.shape[1],x.shape[2],x.shape[3],x.shape[4]]):x}})},{"../engine":"6eJyD","../kernel_names":"aqvy4","../tensor_util_env":"g1Qlv","../util":"gBRMK","./conv_util":"kmOtb","./operation":"2kGjz","./reshape":"VuY4S","@parcel/transformer-js/src/esmodule-helpers.js":"9pCYc"}],g5Nm2:[function(e,t,r){var n=e("@parcel/transformer-js/src/esmodule-helpers.js");n.defineInteropFlag(r),n.export(r,"conv3dTranspose",()=>o);var s=e("../tensor_util_env"),a=e("./conv3d_backprop_input");let o=/* @__PURE__ */(0,e("./operation").op)({conv3dTranspose_:function(e,t,r,n,o){let l=(0,s.convertToTensor)(e,"x","conv3dTranspose"),i=(0,s.convertToTensor)(t,"filter","conv3dTranspose");return(0,a.conv3DBackpropInput)(r,l,i,n,o)}})},{"../tensor_util_env":"g1Qlv","./conv3d_backprop_input":"1tHQU","./operation":"2kGjz","@parcel/transformer-js/src/esmodule-helpers.js":"9pCYc"}],"1tHQU":[function(e,t,r){/** * @license * Copyright 2020 Google LLC. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. * ============================================================================= */var n=e("@parcel/transformer-js/src/esmodule-helpers.js");n.defineInteropFlag(r),n.export(r,"conv3DBackpropInput",()=>u);var s=e("../engine"),a=e("../kernel_names"),o=e("../util"),l=e("./operation"),i=e("./reshape");let u=/* @__PURE__ */(0,l.op)({conv3DBackpropInput_:function(e,t,r,n,l){o.assert(e.length===t.rank,()=>`Length of inShape (${e.length}) and rank of dy (${t.rank}) must match`);let u=e,p=t,c=!1;4===t.rank&&(c=!0,p=(0,i.reshape)(t,[1,t.shape[0],t.shape[1],t.shape[2],t.shape[3]]),u=[1,e[0],e[1],e[2],e[3]]);let d=u[4],f=p.shape[4];o.assert(5===u.length,()=>`Error in conv3dDerInput: inShape must be length 5, but got length ${u.length}.`),o.assert(5===p.rank,()=>`Error in conv3dDerInput: dy must be rank 5, but got rank ${p.rank}`),o.assert(5===r.rank,()=>`Error in conv3dDerInput: filter must be rank 5, but got rank ${r.rank}`),o.assert(d===r.shape[3],()=>`Error in conv3dDerInput: depth of input (${d}) must match input depth for filter ${r.shape[3]}.`),o.assert(f===r.shape[4],()=>`Error in conv3dDerInput: depth of output (${f}) must match output depth for filter ${r.shape[4]}.`);let h={dy:p,filter:r},m={pad:l,strides:n,inputShape:u},g=(0,s.ENGINE).runKernel(a.Conv3DBackpropInputV2,h,m);return c?(0,i.reshape)(g,[g.shape[1],g.shape[2],g.shape[3],g.shape[4]]):g}})},{"../engine":"6eJyD","../kernel_names":"aqvy4","../util":"gBRMK","./operation":"2kGjz","./reshape":"VuY4S","@parcel/transformer-js/src/esmodule-helpers.js":"9pCYc"}],"4lRiV":[function(e,t,r){/** * @license * Copyright 2018 Google LLC. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. * ============================================================================= */var n=e("@parcel/transformer-js/src/esmodule-helpers.js");n.defineInteropFlag(r),n.export(r,"cos",()=>l);var s=e("../engine"),a=e("../kernel_names"),o=e("../tensor_util_env");let l=/* @__PURE__ */(0,e("./operation").op)({cos_:function(e){let t=(0,o.convertToTensor)(e,"x","cos","float32");return(0,s.ENGINE).runKernel(a.Cos,{x:t})}})},{"../engine":"6eJyD","../kernel_names":"aqvy4","../tensor_util_env":"g1Qlv","./operation":"2kGjz","@parcel/transformer-js/src/esmodule-helpers.js":"9pCYc"}],"7pfc8":[function(e,t,r){/** * @license * Copyright 2018 Google LLC. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. * ============================================================================= */var n=e("@parcel/transformer-js/src/esmodule-helpers.js");n.defineInteropFlag(r),n.export(r,"cosh",()=>l);var s=e("../engine"),a=e("../kernel_names"),o=e("../tensor_util_env");let l=/* @__PURE__ */(0,e("./operation").op)({cosh_:function(e){let t=(0,o.convertToTensor)(e,"x","cosh","float32");return(0,s.ENGINE).runKernel(a.Cosh,{x:t})}})},{"../engine":"6eJyD","../kernel_names":"aqvy4","../tensor_util_env":"g1Qlv","./operation":"2kGjz","@parcel/transformer-js/src/esmodule-helpers.js":"9pCYc"}],cs9Qt:[function(e,t,r){/** * @license * Copyright 2022 Google LLC. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the 'License'); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an 'AS IS' BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. * ============================================================================= */var n=e("@parcel/transformer-js/src/esmodule-helpers.js");n.defineInteropFlag(r),n.export(r,"cumprod",()=>l);var s=e("../engine"),a=e("../kernel_names"),o=e("../tensor_util_env");let l=/* @__PURE__ */(0,e("./operation").op)({cumprod_:function(e,t=0,r=!1,n=!1){let l=(0,o.convertToTensor)(e,"x","cumprod");return(0,s.ENGINE).runKernel(a.Cumprod,{x:l},{axis:t,exclusive:r,reverse:n})}})},{"../engine":"6eJyD","../kernel_names":"aqvy4","../tensor_util_env":"g1Qlv","./operation":"2kGjz","@parcel/transformer-js/src/esmodule-helpers.js":"9pCYc"}],"8UcEb":[function(e,t,r){/** * @license * Copyright 2018 Google LLC. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. * ============================================================================= */var n=e("@parcel/transformer-js/src/esmodule-helpers.js");n.defineInteropFlag(r),n.export(r,"cumsum",()=>l);var s=e("../engine"),a=e("../kernel_names"),o=e("../tensor_util_env");let l=/* @__PURE__ */(0,e("./operation").op)({cumsum_:function(e,t=0,r=!1,n=!1){let l=(0,o.convertToTensor)(e,"x","cumsum");return(0,s.ENGINE).runKernel(a.Cumsum,{x:l},{axis:t,exclusive:r,reverse:n})}})},{"../engine":"6eJyD","../kernel_names":"aqvy4","../tensor_util_env":"g1Qlv","./operation":"2kGjz","@parcel/transformer-js/src/esmodule-helpers.js":"9pCYc"}],"5Vmkv":[function(e,t,r){/** * @license * Copyright 2020 Google LLC. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. * ============================================================================= */var n=e("@parcel/transformer-js/src/esmodule-helpers.js");n.defineInteropFlag(r),n.export(r,"denseBincount",()=>i);var s=e("../engine"),a=e("../kernel_names"),o=e("../tensor_util_env"),l=e("../util");let i=/* @__PURE__ */(0,e("./operation").op)({denseBincount_:function(e,t,r,n=!1){let i=(0,o.convertToTensor)(e,"x","denseBincount"),u=(0,o.convertToTensor)(t,"weights","denseBincount");return l.assert("int32"===i.dtype,()=>`Error in denseBincount: input dtype must be int32, but got ${i.dtype}`),l.assert(i.rank<=2,()=>`Error in denseBincount: input must be at most rank 2, but got rank ${i.rank}.`),l.assert(r>=0,()=>`size must be non-negative, but got ${r}.`),l.assert(u.size===i.size||0===u.size,()=>`Error in denseBincount: weights must have the same shape as x or 0-length, but got x shape: ${i.shape}, weights shape: ${u.shape}.`),(0,s.ENGINE).runKernel(a.DenseBincount,{x:i,weights:u},{size:r,binaryOutput:n})}})},{"../engine":"6eJyD","../kernel_names":"aqvy4","../tensor_util_env":"g1Qlv","../util":"gBRMK","./operation":"2kGjz","@parcel/transformer-js/src/esmodule-helpers.js":"9pCYc"}],leeI4:[function(e,t,r){/** * @license * Copyright 2020 Google LLC. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. * ============================================================================= */var n=e("@parcel/transformer-js/src/esmodule-helpers.js");n.defineInteropFlag(r),n.export(r,"depthToSpace",()=>i);var s=e("../engine"),a=e("../kernel_names"),o=e("../tensor_util_env"),l=e("../util");let i=/* @__PURE__ */(0,e("./operation").op)({depthToSpace_:function(e,t,r="NHWC"){let n=(0,o.convertToTensor)(e,"x","depthToSpace","float32"),i="NHWC"===r?n.shape[1]:n.shape[2],u="NHWC"===r?n.shape[2]:n.shape[3],p="NHWC"===r?n.shape[3]:n.shape[1];return l.assert(t>1,()=>`blockSize should be > 1 for depthToSpace, but was: ${t}`),l.assert(i*t>=0,()=>`Negative dimension size caused by overflow when multiplying ${i} and ${t} for depthToSpace with input shape ${n.shape}`),l.assert(u*t>=0,()=>`Negative dimension size caused by overflow when multiplying ${u} and ${t} for depthToSpace with input shape ${n.shape}`),l.assert(p%(t*t)==0,()=>`Dimension size must be evenly divisible by ${t*t} but is ${p} for depthToSpace with input shape ${n.shape}`),(0,s.ENGINE).runKernel(a.DepthToSpace,{x:n},{blockSize:t,dataFormat:r})}})},{"../engine":"6eJyD","../kernel_names":"aqvy4","../tensor_util_env":"g1Qlv","../util":"gBRMK","./operation":"2kGjz","@parcel/transformer-js/src/esmodule-helpers.js":"9pCYc"}],kLAtV:[function(e,t,r){/** * @license * Copyright 2020 Google LLC. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. * ============================================================================= */var n=e("@parcel/transformer-js/src/esmodule-helpers.js");n.defineInteropFlag(r),n.export(r,"depthwiseConv2d",()=>c);var s=e("../engine"),a=e("../kernel_names"),o=e("../tensor_util_env"),l=e("../util"),i=e("./conv_util"),u=e("./operation"),p=e("./reshape");let c=/* @__PURE__ */(0,u.op)({depthwiseConv2d_:function(e,t,r,n,u="NHWC",c=[1,1],d){let f=(0,o.convertToTensor)(e,"x","depthwiseConv2d","float32"),h=(0,o.convertToTensor)(t,"filter","depthwiseConv2d","float32"),m=f,g=!1;3===f.rank&&(g=!0,m=(0,p.reshape)(f,[1,f.shape[0],f.shape[1],f.shape[2]])),l.assert(4===m.rank,()=>`Error in depthwiseConv2d: input must be rank 4, but got rank ${m.rank}.`),l.assert(4===h.rank,()=>`Error in depthwiseConv2d: filter must be rank 4, but got rank ${h.rank}.`);let x="NHWC"===u?m.shape[3]:m.shape[1];l.assert(x===h.shape[2],()=>`Error in depthwiseConv2d: number of input channels (${x}) must match the inChannels dimension in filter ${h.shape[2]}.`),i.checkPadOnDimRoundingMode("depthwiseConv2d",n,d);let v={x:m,filter:h},y=(0,s.ENGINE).runKernel(a.DepthwiseConv2dNative,v,{strides:r,pad:n,dataFormat:u,dilations:c,dimRoundingMode:d});return g?(0,p.reshape)(y,[y.shape[1],y.shape[2],y.shape[3]]):y}})},{"../engine":"6eJyD","../kernel_names":"aqvy4","../tensor_util_env":"g1Qlv","../util":"gBRMK","./conv_util":"kmOtb","./operation":"2kGjz","./reshape":"VuY4S","@parcel/transformer-js/src/esmodule-helpers.js":"9pCYc"}],kY849:[function(e,t,r){/** * @license * Copyright 2020 Google LLC. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. * ============================================================================= */var n=e("@parcel/transformer-js/src/esmodule-helpers.js");n.defineInteropFlag(r),n.export(r,"diag",()=>l);var s=e("../engine"),a=e("../kernel_names"),o=e("../tensor_util_env");let l=/* @__PURE__ */(0,e("./operation").op)({diag_:function(e){let t=(0,o.convertToTensor)(e,"x","diag");return(0,s.ENGINE).runKernel(a.Diag,{x:t})}})},{"../engine":"6eJyD","../kernel_names":"aqvy4","../tensor_util_env":"g1Qlv","./operation":"2kGjz","@parcel/transformer-js/src/esmodule-helpers.js":"9pCYc"}],izYym:[function(e,t,r){/** * @license * Copyright 2020 Google LLC. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. * ============================================================================= */var n=e("@parcel/transformer-js/src/esmodule-helpers.js");n.defineInteropFlag(r),n.export(r,"dilation2d",()=>p);var s=e("../engine"),a=e("../kernel_names"),o=e("../tensor_util_env"),l=e("../util"),i=e("./operation"),u=e("./reshape");let p=/* @__PURE__ */(0,i.op)({dilation2d_:function(e,t,r,n,i=[1,1],p="NHWC"){let c=(0,o.convertToTensor)(e,"x","dilation2d"),d=(0,o.convertToTensor)(t,"filter","dilation2d");l.assert(3===c.rank||4===c.rank,()=>`Error in dilation2d: input must be rank 3 or 4, but got rank ${c.rank}.`),l.assert(3===d.rank,()=>`Error in dilation2d: filter must be rank 3, but got rank ${d.rank}.`),l.assert("NHWC"===p,()=>`Error in dilation2d: Only NHWC is currently supported, but got dataFormat of ${p}`);let f=c,h=!1;3===c.rank&&(f=(0,u.reshape)(c,[1,c.shape[0],c.shape[1],c.shape[2]]),h=!0),l.assert(f.shape[3]===d.shape[2],()=>`Error in dilation2d: input and filter must have the same depth: ${f.shape[3]} vs ${d.shape[2]}`);let m={x:f,filter:d},g=(0,s.ENGINE).runKernel(a.Dilation2D,m,{strides:r,pad:n,dilations:i});return h?(0,u.reshape)(g,[g.shape[1],g.shape[2],g.shape[3]]):g}})},{"../engine":"6eJyD","../kernel_names":"aqvy4","../tensor_util_env":"g1Qlv","../util":"gBRMK","./operation":"2kGjz","./reshape":"VuY4S","@parcel/transformer-js/src/esmodule-helpers.js":"9pCYc"}],jI2z6:[function(e,t,r){/** * @license * Copyright 2020 Google LLC. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. * ============================================================================= */var n=e("@parcel/transformer-js/src/esmodule-helpers.js");n.defineInteropFlag(r),n.export(r,"divNoNan",()=>c);var s=e("../tensor_util"),a=e("../tensor_util_env"),o=e("./div"),l=e("./equal"),i=e("./operation"),u=e("./where"),p=e("./zeros_like");let c=/* @__PURE__ */(0,i.op)({divNoNan_:function(e,t){let r=(0,a.convertToTensor)(e,"a","div"),n=(0,a.convertToTensor)(t,"b","div");[r,n]=(0,s.makeTypesMatch)(r,n);let i=(0,o.div)(r,n),c=(0,p.zerosLike)(i),d=(0,l.equal)(n,c);return(0,u.where)(d,c,i)}})},{"../tensor_util":"jgr40","../tensor_util_env":"g1Qlv","./div":"f7E5D","./equal":"8cA6U","./operation":"2kGjz","./where":"4ZjiT","./zeros_like":"gjKam","@parcel/transformer-js/src/esmodule-helpers.js":"9pCYc"}],"8cA6U":[function(e,t,r){/** * @license * Copyright 2020 Google LLC. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. * ============================================================================= */var n=e("@parcel/transformer-js/src/esmodule-helpers.js");n.defineInteropFlag(r),n.export(r,"equal",()=>u);var s=e("../engine"),a=e("../kernel_names"),o=e("../tensor_util"),l=e("../tensor_util_env"),i=e("./broadcast_util");let u=/* @__PURE__ */(0,e("./operation").op)({equal_:function(e,t){let r=(0,l.convertToTensor)(e,"a","equal","string_or_numeric"),n=(0,l.convertToTensor)(t,"b","equal","string_or_numeric");[r,n]=(0,o.makeTypesMatch)(r,n),(0,i.assertAndGetBroadcastShape)(r.shape,n.shape);let u={a:r,b:n};return(0,s.ENGINE).runKernel(a.Equal,u)}})},{"../engine":"6eJyD","../kernel_names":"aqvy4","../tensor_util":"jgr40","../tensor_util_env":"g1Qlv","./broadcast_util":"aouH8","./operation":"2kGjz","@parcel/transformer-js/src/esmodule-helpers.js":"9pCYc"}],aouH8:[function(e,t,r){/** * @license * Copyright 2017 Google LLC. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. * ============================================================================= */var n=e("@parcel/transformer-js/src/esmodule-helpers.js");function s(e,t){let r=e.length,n=[];for(let s=0;s1&&1===o&&n.unshift(a)}return n}function a(e,t){let r=[];for(let n=0;n1)&&r.unshift(a)}return r}function o(e,t){let r=Math.max(e.length,t.length),n=Array(r);for(let s=0;ss),n.export(r,"getReductionAxes",()=>a),n.export(r,"assertAndGetBroadcastShape",()=>o)},{"@parcel/transformer-js/src/esmodule-helpers.js":"9pCYc"}],"4ZjiT":[function(e,t,r){/** * @license * Copyright 2020 Google LLC. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. * ============================================================================= */var n=e("@parcel/transformer-js/src/esmodule-helpers.js");n.defineInteropFlag(r),n.export(r,"where",()=>u);var s=e("../engine"),a=e("../kernel_names"),o=e("../tensor_util_env"),l=e("./broadcast_to"),i=e("./broadcast_util");let u=/* @__PURE__ */(0,e("./operation").op)({where_:function(e,t,r){let n=(0,o.convertToTensor)(t,"a","where"),u=(0,o.convertToTensor)(r,"b","where"),p=(0,o.convertToTensor)(e,"condition","where","bool"),c=(0,i.assertAndGetBroadcastShape)((0,i.assertAndGetBroadcastShape)(p.shape,n.shape),u.shape),d=(0,l.broadcastTo)(p,c),f=(0,l.broadcastTo)(n,c),h=(0,l.broadcastTo)(u,c);return(0,s.ENGINE).runKernel(a.Select,{condition:d,t:f,e:h})}})},{"../engine":"6eJyD","../kernel_names":"aqvy4","../tensor_util_env":"g1Qlv","./broadcast_to":"3fEHu","./broadcast_util":"aouH8","./operation":"2kGjz","@parcel/transformer-js/src/esmodule-helpers.js":"9pCYc"}],gjKam:[function(e,t,r){/** * @license * Copyright 2018 Google LLC. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. * ============================================================================= */var n=e("@parcel/transformer-js/src/esmodule-helpers.js");n.defineInteropFlag(r),n.export(r,"zerosLike",()=>l);var s=e("../engine"),a=e("../kernel_names"),o=e("../tensor_util_env");let l=/* @__PURE__ */(0,e("./operation").op)({zerosLike_:function(e){let t=(0,o.convertToTensor)(e,"x","zerosLike");return(0,s.ENGINE).runKernel(a.ZerosLike,{x:t})}})},{"../engine":"6eJyD","../kernel_names":"aqvy4","../tensor_util_env":"g1Qlv","./operation":"2kGjz","@parcel/transformer-js/src/esmodule-helpers.js":"9pCYc"}],bsMUo:[function(e,t,r){/** * @license * Copyright 2020 Google LLC. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. * ============================================================================= */var n=e("@parcel/transformer-js/src/esmodule-helpers.js");n.defineInteropFlag(r),n.export(r,"dot",()=>u);var s=e("../tensor_util_env"),a=e("../util"),o=e("./mat_mul"),l=e("./operation"),i=e("./reshape");let u=/* @__PURE__ */(0,l.op)({dot_:function(e,t){let r=(0,s.convertToTensor)(e,"t1","dot"),n=(0,s.convertToTensor)(t,"t2","dot");a.assert((1===r.rank||2===r.rank)&&(1===n.rank||2===n.rank),()=>`Error in dot: inputs must all be rank 1 or 2, but got ranks ${r.rank} and ${n.rank}.`);let l=1===r.rank?r.size:r.shape[1],u=1===n.rank?n.size:n.shape[0];if(a.assert(l===u,()=>`Error in dot: inner dimensions of inputs must match, but got ${l} and ${u}.`),1===r.rank&&1===n.rank){let e=(0,i.reshape)(r,[1,-1]),t=(0,i.reshape)(n,[-1,1]),s=(0,o.matMul)(e,t);return(0,i.reshape)(s,[])}if(1===r.rank&&2===n.rank){let e=(0,i.reshape)(r,[1,-1]),t=(0,i.reshape)(n,[n.shape[0],n.shape[1]]),s=(0,o.matMul)(e,t);return(0,i.reshape)(s,[s.size])}if(2===r.rank&&1===n.rank){let e=(0,i.reshape)(n,[-1,1]),t=(0,o.matMul)(r,e);return(0,i.reshape)(t,[t.size])}{let e=(0,i.reshape)(n,[n.shape[0],n.shape[1]]);return(0,o.matMul)(r,e)}}})},{"../tensor_util_env":"g1Qlv","../util":"gBRMK","./mat_mul":"9ZocJ","./operation":"2kGjz","./reshape":"VuY4S","@parcel/transformer-js/src/esmodule-helpers.js":"9pCYc"}],iHV90:[function(e,t,r){/** * @license * Copyright 2021 Google LLC. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. * ============================================================================= */var n=e("@parcel/transformer-js/src/esmodule-helpers.js");n.defineInteropFlag(r),n.export(r,"einsum_",()=>l),n.export(r,"einsum",()=>i);var s=e("../engine"),a=e("../kernel_names"),o=e("../tensor_util_env");function l(e,...t){let r=t.map((e,t)=>(0,o.convertToTensor)(e,`tensors${t}`,"einsum"));return(0,s.ENGINE).runKernel(a.Einsum,r,{equation:e})}let i=/* @__PURE__ */(0,e("./operation").op)({einsum_:l})},{"../engine":"6eJyD","../kernel_names":"aqvy4","../tensor_util_env":"g1Qlv","./operation":"2kGjz","@parcel/transformer-js/src/esmodule-helpers.js":"9pCYc"}],gTKMF:[function(e,t,r){/** * @license * Copyright 2020 Google LLC. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. * ============================================================================= */var n=e("@parcel/transformer-js/src/esmodule-helpers.js");n.defineInteropFlag(r),n.export(r,"elu",()=>l);var s=e("../engine"),a=e("../kernel_names"),o=e("../tensor_util_env");let l=/* @__PURE__ */(0,e("./operation").op)({elu_:function(e){let t=(0,o.convertToTensor)(e,"x","elu","float32");return(0,s.ENGINE).runKernel(a.Elu,{x:t})}})},{"../engine":"6eJyD","../kernel_names":"aqvy4","../tensor_util_env":"g1Qlv","./operation":"2kGjz","@parcel/transformer-js/src/esmodule-helpers.js":"9pCYc"}],"7skYx":[function(e,t,r){/** * @license * Copyright 2023 Google LLC. * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. * ============================================================================= */var n=e("@parcel/transformer-js/src/esmodule-helpers.js");n.defineInteropFlag(r),n.export(r,"ensureShape",()=>o);var s=e("../tensor_util_env"),a=e("../util_base");let o=/* @__PURE__ */(0,e("./operation").op)({ensureShape_:function(e,t){let r=(0,s.convertToTensor)(e,"x","ensureShape","string_or_numeric");if(!(0,a.arraysEqualWithNull)(r.shape,t))throw Error(`EnsureShape: Shape of tensor ${r.shape} is not compatible with expected shape ${t}`);return e}})},{"../tensor_util_env":"g1Qlv","../util_base":"8U7kO","./operation":"2kGjz","@parcel/transformer-js/src/esmodule-helpers.js":"9pCYc"}],exYkO:[function(e,t,r){/** * @license * Copyright 2018 Google LLC. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. * ============================================================================= */var n=e("@parcel/transformer-js/src/esmodule-helpers.js");n.defineInteropFlag(r),n.export(r,"erf",()=>u);var s=e("../engine"),a=e("../kernel_names"),o=e("../tensor_util_env"),l=e("../util"),i=e("./cast");let u=/* @__PURE__ */(0,e("./operation").op)({erf_:function(e){let t=(0,o.convertToTensor)(e,"x","erf");l.assert("int32"===t.dtype||"float32"===t.dtype,()=>"Input dtype must be `int32` or `float32`."),"int32"===t.dtype&&(t=(0,i.cast)(t,"float32"));let r={x:t};return(0,s.ENGINE).runKernel(a.Erf,r)}})},{"../engine":"6eJyD","../kernel_names":"aqvy4","../tensor_util_env":"g1Qlv","../util":"gBRMK","./cast":"ekSnT","./operation":"2kGjz","@parcel/transformer-js/src/esmodule-helpers.js":"9pCYc"}],"7T6br":[function(e,t,r){/** * @license * Copyright 2022 Google LLC. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. * ============================================================================= */var n=e("@parcel/transformer-js/src/esmodule-helpers.js");n.defineInteropFlag(r),n.export(r,"euclideanNorm",()=>a);var s=e("./norm");let a=/* @__PURE__ */(0,e("./operation").op)({euclideanNorm_:function(e,t=null,r=!1){return(0,s.norm)(e,"euclidean",t,r)}})},{"./norm":"auMxT","./operation":"2kGjz","@parcel/transformer-js/src/esmodule-helpers.js":"9pCYc"}],auMxT:[function(e,t,r){/** * @license * Copyright 2018 Google LLC. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. * ============================================================================= */var n=e("@parcel/transformer-js/src/esmodule-helpers.js");n.defineInteropFlag(r),n.export(r,"norm",()=>x);var s=e("../tensor_util_env"),a=e("../util"),o=e("./abs"),l=e("./axis_util"),i=e("./max"),u=e("./min"),p=e("./operation"),c=e("./pow"),d=e("./reshape"),f=e("./scalar"),h=e("./sqrt"),m=e("./square"),g=e("./sum");let x=/* @__PURE__ */(0,p.op)({norm_:function(e,t="euclidean",r=null,n=!1){let p=function e(t,r,n=null){if(0===t.rank)return(0,o.abs)(t);if(1!==t.rank&&null===n)return e((0,d.reshape)(t,[-1]),r,n);if(1===t.rank||"number"==typeof n||Array.isArray(n)&&1===n.length){if(1===r)return(0,g.sum)((0,o.abs)(t),n);if(r===1/0)return(0,i.max)((0,o.abs)(t),n);if(r===-1/0)return(0,u.min)((0,o.abs)(t),n);if("euclidean"===r||2===r)return(0,h.sqrt)((0,g.sum)((0,c.pow)((0,o.abs)(t),(0,f.scalar)(2,"int32")),n));throw Error(`Error in norm: invalid ord value: ${r}`)}if(Array.isArray(n)&&2===n.length){if(1===r)return(0,i.max)((0,g.sum)((0,o.abs)(t),n[0]),n[1]-1);if(r===1/0)return(0,i.max)((0,g.sum)((0,o.abs)(t),n[1]),n[0]);if(r===-1/0)return(0,u.min)((0,g.sum)((0,o.abs)(t),n[1]),n[0]);if("fro"===r||"euclidean"===r)return(0,h.sqrt)((0,g.sum)((0,m.square)(t),n));throw Error(`Error in norm: invalid ord value: ${r}`)}throw Error(`Error in norm: invalid axis: ${n}`)}(e=(0,s.convertToTensor)(e,"x","norm"),t,r),x=p.shape;if(n){let t=(0,a.parseAxisParam)(r,e.shape);x=l.expandShapeToKeepDim(p.shape,t)}return(0,d.reshape)(p,x)}})},{"../tensor_util_env":"g1Qlv","../util":"gBRMK","./abs":"3JIEu","./axis_util":"3ROd2","./max":"6JsYy","./min":"k9ZaF","./operation":"2kGjz","./pow":"cL5Hc","./reshape":"VuY4S","./scalar":"53j04","./sqrt":"kl1Ie","./square":"1Qqi7","./sum":"gsfPR","@parcel/transformer-js/src/esmodule-helpers.js":"9pCYc"}],"3ROd2":[function(e,t,r){/** * @license * Copyright 2017 Google LLC. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. * ============================================================================= */var n=e("@parcel/transformer-js/src/esmodule-helpers.js");n.defineInteropFlag(r),n.export(r,"axesAreInnerMostDims",()=>a),n.export(r,"combineLocations",()=>o),n.export(r,"computeOutAndReduceShapes",()=>l),n.export(r,"expandShapeToKeepDim",()=>i),n.export(r,"assertAxesAreInnerMostDims",()=>u),n.export(r,"getAxesPermutation",()=>p),n.export(r,"getUndoAxesPermutation",()=>c),n.export(r,"getInnerMostAxes",()=>d);var s=e("../util");function a(e,t){for(let r=0;re[t])]}function i(e,t){return o(e,t.map(e=>1),t)}function u(e,t,r){s.assert(a(t,r),()=>`${e} supports only inner-most axes for now. Got axes ${t} and rank-${r} input.`)}function p(e,t){if(a(e,t))return null;let r=[];for(let n=0;nr.push(e)),r}function c(e){return e.map((e,t)=>[t,e]).sort((e,t)=>e[1]-t[1]).map(e=>e[0])}function d(e,t){let r=[];for(let n=t-e;nl);var s=e("../engine"),a=e("../kernel_names"),o=e("../tensor_util_env");let l=/* @__PURE__ */(0,e("./operation").op)({max_:function(e,t=null,r=!1){let n=(0,o.convertToTensor)(e,"x","max");return(0,s.ENGINE).runKernel(a.Max,{x:n},{reductionIndices:t,keepDims:r})}})},{"../engine":"6eJyD","../kernel_names":"aqvy4","../tensor_util_env":"g1Qlv","./operation":"2kGjz","@parcel/transformer-js/src/esmodule-helpers.js":"9pCYc"}],k9ZaF:[function(e,t,r){/** * @license * Copyright 2020 Google Inc. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. * ============================================================================= */var n=e("@parcel/transformer-js/src/esmodule-helpers.js");n.defineInteropFlag(r),n.export(r,"min",()=>l);var s=e("../engine"),a=e("../kernel_names"),o=e("../tensor_util_env");let l=/* @__PURE__ */(0,e("./operation").op)({min_:function(e,t=null,r=!1){let n=(0,o.convertToTensor)(e,"x","min");return(0,s.ENGINE).runKernel(a.Min,{x:n},{axis:t,keepDims:r})}})},{"../engine":"6eJyD","../kernel_names":"aqvy4","../tensor_util_env":"g1Qlv","./operation":"2kGjz","@parcel/transformer-js/src/esmodule-helpers.js":"9pCYc"}],cL5Hc:[function(e,t,r){/** * @license * Copyright 2020 Google LLC. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. * ============================================================================= */var n=e("@parcel/transformer-js/src/esmodule-helpers.js");n.defineInteropFlag(r),n.export(r,"pow",()=>i);var s=e("../engine"),a=e("../kernel_names"),o=e("../tensor_util"),l=e("../tensor_util_env");let i=/* @__PURE__ */(0,e("./operation").op)({pow_:function(e,t){let r=(0,l.convertToTensor)(e,"base","pow"),n=(0,l.convertToTensor)(t,"exp","pow");[r,n]=(0,o.makeTypesMatch)(r,n);let i={a:r,b:n};return(0,s.ENGINE).runKernel(a.Pow,i)}})},{"../engine":"6eJyD","../kernel_names":"aqvy4","../tensor_util":"jgr40","../tensor_util_env":"g1Qlv","./operation":"2kGjz","@parcel/transformer-js/src/esmodule-helpers.js":"9pCYc"}],"53j04":[function(e,t,r){/** * @license * Copyright 2018 Google LLC. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. * ============================================================================= */var n=e("@parcel/transformer-js/src/esmodule-helpers.js");n.defineInteropFlag(r),n.export(r,"scalar",()=>o);var s=e("../util"),a=e("./tensor_ops_util");function o(e,t){if(((0,s.isTypedArray)(e)&&"string"!==t||Array.isArray(e))&&"complex64"!==t)throw Error("Error creating a new Scalar: value must be a primitive (number|boolean|string)");if("string"===t&&(0,s.isTypedArray)(e)&&!(e instanceof Uint8Array))throw Error("When making a scalar from encoded string, the value must be `Uint8Array`.");return(0,a.makeTensor)(e,[],[],t)}},{"../util":"gBRMK","./tensor_ops_util":"c7cet","@parcel/transformer-js/src/esmodule-helpers.js":"9pCYc"}],kl1Ie:[function(e,t,r){/** * @license * Copyright 2018 Google LLC. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. * ============================================================================= */var n=e("@parcel/transformer-js/src/esmodule-helpers.js");n.defineInteropFlag(r),n.export(r,"sqrt",()=>l);var s=e("../engine"),a=e("../kernel_names"),o=e("../tensor_util_env");let l=/* @__PURE__ */(0,e("./operation").op)({sqrt_:function(e){let t=(0,o.convertToTensor)(e,"x","sqrt","float32");return(0,s.ENGINE).runKernel(a.Sqrt,{x:t})}})},{"../engine":"6eJyD","../kernel_names":"aqvy4","../tensor_util_env":"g1Qlv","./operation":"2kGjz","@parcel/transformer-js/src/esmodule-helpers.js":"9pCYc"}],"1Qqi7":[function(e,t,r){/** * @license * Copyright 2019 Google LLC. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. * ============================================================================= */var n=e("@parcel/transformer-js/src/esmodule-helpers.js");n.defineInteropFlag(r),n.export(r,"square",()=>o);var s=e("../engine"),a=e("../tensor_util_env");let o=/* @__PURE__ */(0,e("./operation").op)({square_:function(e){let t=(0,a.convertToTensor)(e,"x","square");return(0,s.ENGINE).runKernel("Square",{x:t},{})}})},{"../engine":"6eJyD","../tensor_util_env":"g1Qlv","./operation":"2kGjz","@parcel/transformer-js/src/esmodule-helpers.js":"9pCYc"}],gsfPR:[function(e,t,r){/** * @license * Copyright 2018 Google LLC. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. * ============================================================================= */var n=e("@parcel/transformer-js/src/esmodule-helpers.js");n.defineInteropFlag(r),n.export(r,"sum",()=>i);var s=e("../engine"),a=e("../kernel_names"),o=e("../tensor_util_env"),l=e("./cast");let i=/* @__PURE__ */(0,e("./operation").op)({sum_:function(e,t=null,r=!1){let n=(0,o.convertToTensor)(e,"x","sum");"bool"===n.dtype&&(n=(0,l.cast)(n,"int32"));let i={x:n};return(0,s.ENGINE).runKernel(a.Sum,i,{axis:t,keepDims:r})}})},{"../engine":"6eJyD","../kernel_names":"aqvy4","../tensor_util_env":"g1Qlv","./cast":"ekSnT","./operation":"2kGjz","@parcel/transformer-js/src/esmodule-helpers.js":"9pCYc"}],g4QHY:[function(e,t,r){/** * @license * Copyright 2018 Google LLC. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. * ============================================================================= */var n=e("@parcel/transformer-js/src/esmodule-helpers.js");n.defineInteropFlag(r),n.export(r,"exp",()=>l);var s=e("../engine"),a=e("../kernel_names"),o=e("../tensor_util_env");let l=/* @__PURE__ */(0,e("./operation").op)({exp_:function(e){let t=(0,o.convertToTensor)(e,"x","exp");return(0,s.ENGINE).runKernel(a.Exp,{x:t})}})},{"../engine":"6eJyD","../kernel_names":"aqvy4","../tensor_util_env":"g1Qlv","./operation":"2kGjz","@parcel/transformer-js/src/esmodule-helpers.js":"9pCYc"}],bkwaY:[function(e,t,r){/** * @license * Copyright 2020 Google LLC. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. * ============================================================================= */var n=e("@parcel/transformer-js/src/esmodule-helpers.js");n.defineInteropFlag(r),n.export(r,"expandDims",()=>i);var s=e("../engine"),a=e("../kernel_names"),o=e("../tensor_util_env"),l=e("../util");let i=/* @__PURE__ */(0,e("./operation").op)({expandDims_:function(e,t=0){let r=(0,o.convertToTensor)(e,"x","expandDims","string_or_numeric");return l.assert(t<=r.rank,()=>"Axis must be<= rank of the tensor"),(0,s.ENGINE).runKernel(a.ExpandDims,{input:r},{dim:t})}})},{"../engine":"6eJyD","../kernel_names":"aqvy4","../tensor_util_env":"g1Qlv","../util":"gBRMK","./operation":"2kGjz","@parcel/transformer-js/src/esmodule-helpers.js":"9pCYc"}],dwa81:[function(e,t,r){/** * @license * Copyright 2018 Google LLC. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. * ============================================================================= */var n=e("@parcel/transformer-js/src/esmodule-helpers.js");n.defineInteropFlag(r),n.export(r,"expm1",()=>l);var s=e("../engine"),a=e("../kernel_names"),o=e("../tensor_util_env");let l=/* @__PURE__ */(0,e("./operation").op)({expm1_:function(e){let t=(0,o.convertToTensor)(e,"x","expm1");return(0,s.ENGINE).runKernel(a.Expm1,{x:t})}})},{"../engine":"6eJyD","../kernel_names":"aqvy4","../tensor_util_env":"g1Qlv","./operation":"2kGjz","@parcel/transformer-js/src/esmodule-helpers.js":"9pCYc"}],"1q7xZ":[function(e,t,r){/** * @license * Copyright 2020 Google LLC. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. * ============================================================================= */var n=e("@parcel/transformer-js/src/esmodule-helpers.js");n.defineInteropFlag(r),n.export(r,"eye",()=>u);var s=e("./buffer"),a=e("./expand_dims"),o=e("./operation"),l=e("./reshape"),i=e("./tile");let u=/* @__PURE__ */(0,o.op)({eye_:function(e,t,r,n="float32"){null==t&&(t=e);let o=(0,s.buffer)([e,t],n),u=e<=t?e:t;for(let e=0;ei);var s=e("../engine"),a=e("../kernel_names"),o=e("../tensor_util_env"),l=e("../util");let i=/* @__PURE__ */(0,e("./operation").op)({tile_:function(e,t){let r=(0,o.convertToTensor)(e,"x","tile","string_or_numeric");return l.assert(r.rank===t.length,()=>`Error in transpose: rank of input ${r.rank} must match length of reps ${t}.`),(0,s.ENGINE).runKernel(a.Tile,{x:r},{reps:t})}})},{"../engine":"6eJyD","../kernel_names":"aqvy4","../tensor_util_env":"g1Qlv","../util":"gBRMK","./operation":"2kGjz","@parcel/transformer-js/src/esmodule-helpers.js":"9pCYc"}],"29qAJ":[function(e,t,r){/** * @license * Copyright 2018 Google LLC. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. * ============================================================================= */var n=e("@parcel/transformer-js/src/esmodule-helpers.js");n.defineInteropFlag(r),n.export(r,"floor",()=>l);var s=e("../engine"),a=e("../kernel_names"),o=e("../tensor_util_env");let l=/* @__PURE__ */(0,e("./operation").op)({floor_:function(e){let t=(0,o.convertToTensor)(e,"x","floor","float32");return(0,s.ENGINE).runKernel(a.Floor,{x:t})}})},{"../engine":"6eJyD","../kernel_names":"aqvy4","../tensor_util_env":"g1Qlv","./operation":"2kGjz","@parcel/transformer-js/src/esmodule-helpers.js":"9pCYc"}],bVuYh:[function(e,t,r){/** * @license * Copyright 2018 Google LLC. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. * ============================================================================= */var n=e("@parcel/transformer-js/src/esmodule-helpers.js");n.defineInteropFlag(r),n.export(r,"gather",()=>l);var s=e("../engine"),a=e("../kernel_names"),o=e("../tensor_util_env");let l=/* @__PURE__ */(0,e("./operation").op)({gather_:function(e,t,r=0,n=0){let l=(0,o.convertToTensor)(e,"x","gather"),i=(0,o.convertToTensor)(t,"indices","gather","int32");return(0,s.ENGINE).runKernel(a.GatherV2,{x:l,indices:i},{axis:r,batchDims:n})}})},{"../engine":"6eJyD","../kernel_names":"aqvy4","../tensor_util_env":"g1Qlv","./operation":"2kGjz","@parcel/transformer-js/src/esmodule-helpers.js":"9pCYc"}],auCuN:[function(e,t,r){/** * @license * Copyright 2020 Google LLC. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. * ============================================================================= */var n=e("@parcel/transformer-js/src/esmodule-helpers.js");n.defineInteropFlag(r),n.export(r,"greater",()=>u);var s=e("../engine"),a=e("../kernel_names"),o=e("../tensor_util"),l=e("../tensor_util_env"),i=e("./broadcast_util");let u=/* @__PURE__ */(0,e("./operation").op)({greater_:function(e,t){let r=(0,l.convertToTensor)(e,"a","greater","string_or_numeric"),n=(0,l.convertToTensor)(t,"b","greater","string_or_numeric");[r,n]=(0,o.makeTypesMatch)(r,n),(0,i.assertAndGetBroadcastShape)(r.shape,n.shape);let u={a:r,b:n};return(0,s.ENGINE).runKernel(a.Greater,u)}})},{"../engine":"6eJyD","../kernel_names":"aqvy4","../tensor_util":"jgr40","../tensor_util_env":"g1Qlv","./broadcast_util":"aouH8","./operation":"2kGjz","@parcel/transformer-js/src/esmodule-helpers.js":"9pCYc"}],"5jRVD":[function(e,t,r){/** * @license * Copyright 2020 Google LLC. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. * ============================================================================= */var n=e("@parcel/transformer-js/src/esmodule-helpers.js");n.defineInteropFlag(r),n.export(r,"greaterEqual",()=>u);var s=e("../engine"),a=e("../kernel_names"),o=e("../tensor_util"),l=e("../tensor_util_env"),i=e("./broadcast_util");let u=/* @__PURE__ */(0,e("./operation").op)({greaterEqual_:function(e,t){let r=(0,l.convertToTensor)(e,"a","greaterEqual","string_or_numeric"),n=(0,l.convertToTensor)(t,"b","greaterEqual","string_or_numeric");[r,n]=(0,o.makeTypesMatch)(r,n),(0,i.assertAndGetBroadcastShape)(r.shape,n.shape);let u={a:r,b:n};return(0,s.ENGINE).runKernel(a.GreaterEqual,u)}})},{"../engine":"6eJyD","../kernel_names":"aqvy4","../tensor_util":"jgr40","../tensor_util_env":"g1Qlv","./broadcast_util":"aouH8","./operation":"2kGjz","@parcel/transformer-js/src/esmodule-helpers.js":"9pCYc"}],"2YwxX":[function(e,t,r){/** * @license * Copyright 2020 Google LLC. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. * ============================================================================= */var n=e("@parcel/transformer-js/src/esmodule-helpers.js");n.defineInteropFlag(r),n.export(r,"imag",()=>l);var s=e("../engine"),a=e("../kernel_names"),o=e("../tensor_util_env");let l=/* @__PURE__ */(0,e("./operation").op)({imag_:function(e){let t=(0,o.convertToTensor)(e,"input","imag");return(0,s.ENGINE).runKernel(a.Imag,{input:t})}})},{"../engine":"6eJyD","../kernel_names":"aqvy4","../tensor_util_env":"g1Qlv","./operation":"2kGjz","@parcel/transformer-js/src/esmodule-helpers.js":"9pCYc"}],"9pYlX":[function(e,t,r){/** * @license * Copyright 2018 Google LLC. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. * ============================================================================= */var n=e("@parcel/transformer-js/src/esmodule-helpers.js");n.defineInteropFlag(r),n.export(r,"isFinite",()=>l);var s=e("../engine"),a=e("../kernel_names"),o=e("../tensor_util_env");let l=/* @__PURE__ */(0,e("./operation").op)({isFinite_:function(e){let t=(0,o.convertToTensor)(e,"x","isFinite");return(0,s.ENGINE).runKernel(a.IsFinite,{x:t})}})},{"../engine":"6eJyD","../kernel_names":"aqvy4","../tensor_util_env":"g1Qlv","./operation":"2kGjz","@parcel/transformer-js/src/esmodule-helpers.js":"9pCYc"}],cXc8F:[function(e,t,r){/** * @license * Copyright 2018 Google LLC. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. * ============================================================================= */var n=e("@parcel/transformer-js/src/esmodule-helpers.js");n.defineInteropFlag(r),n.export(r,"isInf",()=>l);var s=e("../engine"),a=e("../kernel_names"),o=e("../tensor_util_env");let l=/* @__PURE__ */(0,e("./operation").op)({isInf_:function(e){let t=(0,o.convertToTensor)(e,"x","isInf");return(0,s.ENGINE).runKernel(a.IsInf,{x:t})}})},{"../engine":"6eJyD","../kernel_names":"aqvy4","../tensor_util_env":"g1Qlv","./operation":"2kGjz","@parcel/transformer-js/src/esmodule-helpers.js":"9pCYc"}],kIDze:[function(e,t,r){/** * @license * Copyright 2018 Google LLC. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. * ============================================================================= */var n=e("@parcel/transformer-js/src/esmodule-helpers.js");n.defineInteropFlag(r),n.export(r,"isNaN",()=>l);var s=e("../engine"),a=e("../kernel_names"),o=e("../tensor_util_env");let l=/* @__PURE__ */(0,e("./operation").op)({isNaN_:function(e){let t=(0,o.convertToTensor)(e,"x","isNaN");return(0,s.ENGINE).runKernel(a.IsNan,{x:t})}})},{"../engine":"6eJyD","../kernel_names":"aqvy4","../tensor_util_env":"g1Qlv","./operation":"2kGjz","@parcel/transformer-js/src/esmodule-helpers.js":"9pCYc"}],"4La0e":[function(e,t,r){/** * @license * Copyright 2020 Google LLC. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. * ============================================================================= */var n=e("@parcel/transformer-js/src/esmodule-helpers.js");n.defineInteropFlag(r),n.export(r,"leakyRelu",()=>l);var s=e("../engine"),a=e("../kernel_names"),o=e("../tensor_util_env");let l=/* @__PURE__ */(0,e("./operation").op)({leakyRelu_:function(e,t=.2){let r=(0,o.convertToTensor)(e,"x","leakyRelu");return(0,s.ENGINE).runKernel(a.LeakyRelu,{x:r},{alpha:t})}})},{"../engine":"6eJyD","../kernel_names":"aqvy4","../tensor_util_env":"g1Qlv","./operation":"2kGjz","@parcel/transformer-js/src/esmodule-helpers.js":"9pCYc"}],kyWc5:[function(e,t,r){/** * @license * Copyright 2020 Google LLC. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. * ============================================================================= */var n=e("@parcel/transformer-js/src/esmodule-helpers.js");n.defineInteropFlag(r),n.export(r,"less",()=>u);var s=e("../engine"),a=e("../kernel_names"),o=e("../tensor_util"),l=e("../tensor_util_env"),i=e("./broadcast_util");let u=/* @__PURE__ */(0,e("./operation").op)({less_:function(e,t){let r=(0,l.convertToTensor)(e,"a","less","string_or_numeric"),n=(0,l.convertToTensor)(t,"b","less","string_or_numeric");[r,n]=(0,o.makeTypesMatch)(r,n),(0,i.assertAndGetBroadcastShape)(r.shape,n.shape);let u={a:r,b:n};return(0,s.ENGINE).runKernel(a.Less,u)}})},{"../engine":"6eJyD","../kernel_names":"aqvy4","../tensor_util":"jgr40","../tensor_util_env":"g1Qlv","./broadcast_util":"aouH8","./operation":"2kGjz","@parcel/transformer-js/src/esmodule-helpers.js":"9pCYc"}],bqBgL:[function(e,t,r){/** * @license * Copyright 2020 Google LLC. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. * ============================================================================= */var n=e("@parcel/transformer-js/src/esmodule-helpers.js");n.defineInteropFlag(r),n.export(r,"lessEqual",()=>u);var s=e("../engine"),a=e("../kernel_names"),o=e("../tensor_util"),l=e("../tensor_util_env"),i=e("./broadcast_util");let u=/* @__PURE__ */(0,e("./operation").op)({lessEqual_:function(e,t){let r=(0,l.convertToTensor)(e,"a","lessEqual","string_or_numeric"),n=(0,l.convertToTensor)(t,"b","lessEqual","string_or_numeric");[r,n]=(0,o.makeTypesMatch)(r,n),(0,i.assertAndGetBroadcastShape)(r.shape,n.shape);let u={a:r,b:n};return(0,s.ENGINE).runKernel(a.LessEqual,u)}})},{"../engine":"6eJyD","../kernel_names":"aqvy4","../tensor_util":"jgr40","../tensor_util_env":"g1Qlv","./broadcast_util":"aouH8","./operation":"2kGjz","@parcel/transformer-js/src/esmodule-helpers.js":"9pCYc"}],"4oO8G":[function(e,t,r){/** * @license * Copyright 2018 Google LLC. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. * ============================================================================= */var n=e("@parcel/transformer-js/src/esmodule-helpers.js");n.defineInteropFlag(r),n.export(r,"linspace",()=>o);var s=e("../engine"),a=e("../kernel_names");function o(e,t,r){if(r<=0)throw Error("The number of values should be positive.");return(0,s.ENGINE).runKernel(a.LinSpace,{},{start:e,stop:t,num:r})}},{"../engine":"6eJyD","../kernel_names":"aqvy4","@parcel/transformer-js/src/esmodule-helpers.js":"9pCYc"}],PXpCA:[function(e,t,r){/** * @license * Copyright 2020 Google LLC. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. * ============================================================================= */var n=e("@parcel/transformer-js/src/esmodule-helpers.js");n.defineInteropFlag(r),n.export(r,"localResponseNormalization",()=>p);var s=e("../engine"),a=e("../kernel_names"),o=e("../tensor_util_env"),l=e("../util"),i=e("./operation"),u=e("./reshape");let p=/* @__PURE__ */(0,i.op)({localResponseNormalization_:function(e,t=5,r=1,n=1,i=.5){let p=(0,o.convertToTensor)(e,"x","localResponseNormalization");l.assert(4===p.rank||3===p.rank,()=>`Error in localResponseNormalization: x must be rank 3 or 4 but got rank ${p.rank}.`),l.assert(l.isInt(t),()=>`Error in localResponseNormalization: depthRadius must be an integer but got depthRadius ${t}.`);let c=p,d=!1;3===p.rank&&(d=!0,c=(0,u.reshape)(p,[1,p.shape[0],p.shape[1],p.shape[2]]));let f={x:c},h=(0,s.ENGINE).runKernel(a.LRN,f,{depthRadius:t,bias:r,alpha:n,beta:i});return d?(0,u.reshape)(h,[h.shape[1],h.shape[2],h.shape[3]]):h}})},{"../engine":"6eJyD","../kernel_names":"aqvy4","../tensor_util_env":"g1Qlv","../util":"gBRMK","./operation":"2kGjz","./reshape":"VuY4S","@parcel/transformer-js/src/esmodule-helpers.js":"9pCYc"}],jzL0E:[function(e,t,r){/** * @license * Copyright 2018 Google LLC. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. * ============================================================================= */var n=e("@parcel/transformer-js/src/esmodule-helpers.js");n.defineInteropFlag(r),n.export(r,"log",()=>l);var s=e("../engine"),a=e("../kernel_names"),o=e("../tensor_util_env");let l=/* @__PURE__ */(0,e("./operation").op)({log_:function(e){let t=(0,o.convertToTensor)(e,"x","log","float32");return(0,s.ENGINE).runKernel(a.Log,{x:t})}})},{"../engine":"6eJyD","../kernel_names":"aqvy4","../tensor_util_env":"g1Qlv","./operation":"2kGjz","@parcel/transformer-js/src/esmodule-helpers.js":"9pCYc"}],"3kse5":[function(e,t,r){/** * @license * Copyright 2018 Google LLC. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. * ============================================================================= */var n=e("@parcel/transformer-js/src/esmodule-helpers.js");n.defineInteropFlag(r),n.export(r,"log1p",()=>l);var s=e("../engine"),a=e("../kernel_names"),o=e("../tensor_util_env");let l=/* @__PURE__ */(0,e("./operation").op)({log1p_:function(e){let t=(0,o.convertToTensor)(e,"x","log1p");return(0,s.ENGINE).runKernel(a.Log1p,{x:t})}})},{"../engine":"6eJyD","../kernel_names":"aqvy4","../tensor_util_env":"g1Qlv","./operation":"2kGjz","@parcel/transformer-js/src/esmodule-helpers.js":"9pCYc"}],"6s8Zj":[function(e,t,r){/** * @license * Copyright 2018 Google LLC. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. * ============================================================================= */var n=e("@parcel/transformer-js/src/esmodule-helpers.js");n.defineInteropFlag(r),n.export(r,"logSigmoid",()=>c);var s=e("../gradients"),a=e("../tensor_util_env"),o=e("./mul"),l=e("./neg"),i=e("./operation"),u=e("./sigmoid"),p=e("./softplus");let c=/* @__PURE__ */(0,i.op)({logSigmoid_:function(e){let t=(0,a.convertToTensor)(e,"x","logSigmoid");return(0,s.customGrad)(e=>({value:(0,l.neg)((0,p.softplus)((0,l.neg)(e))),gradFunc:t=>(0,o.mul)(t,(0,u.sigmoid)((0,l.neg)(e)))}))(t)}})},{"../gradients":"ab8zU","../tensor_util_env":"g1Qlv","./mul":"gPetX","./neg":"7zXw5","./operation":"2kGjz","./sigmoid":"gGNpa","./softplus":"9FSsO","@parcel/transformer-js/src/esmodule-helpers.js":"9pCYc"}],ab8zU:[function(e,t,r){/** * @license * Copyright 2018 Google LLC. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. * ============================================================================= */var n=e("@parcel/transformer-js/src/esmodule-helpers.js");n.defineInteropFlag(r),n.export(r,"customGrad",()=>f),n.export(r,"variableGrads",()=>d),n.export(r,"valueAndGrad",()=>p),n.export(r,"valueAndGrads",()=>c),n.export(r,"grad",()=>i),n.export(r,"grads",()=>u);var s=e("./engine"),a=e("./tensor"),o=e("./tensor_util_env"),l=e("./util");function i(e){return l.assert(l.isFunction(e),()=>"The f passed in grad(f) must be a function"),(t,r)=>{let n=(0,o.convertToTensor)(t,"x","tf.grad","string_or_numeric"),a=null!=r?(0,o.convertToTensor)(r,"dy","tf.grad"):null;return(0,s.ENGINE).tidy(()=>{let{value:t,grads:r}=(0,s.ENGINE).gradients(()=>e(n),[n],a);return null!=a&&l.assertShapesMatch(t.shape,a.shape,"The shape of dy passed in grad(f)(x, dy) must match the shape returned by f(x)"),h(r),r[0]})}}function u(e){return l.assert(l.isFunction(e),()=>"The f passed in grads(f) must be a function"),(t,r)=>{l.assert(Array.isArray(t),()=>"The args passed in grads(f)(args) must be an array of `Tensor`s or `TensorLike`s");let n=(0,o.convertToTensorArray)(t,"args","tf.grads","string_or_numeric"),a=null!=r?(0,o.convertToTensor)(r,"dy","tf.grads"):null;return(0,s.ENGINE).tidy(()=>{let{value:t,grads:r}=(0,s.ENGINE).gradients(()=>e(...n),n,a);return null!=a&&l.assertShapesMatch(t.shape,a.shape,"The shape of dy passed in grads(f)([x1,...], dy) must match the shape returned by f([x1,...])"),h(r),r})}}function p(e){return l.assert(l.isFunction(e),()=>"The f passed in valueAndGrad(f) must be a function"),(t,r)=>{l.assert(t instanceof a.Tensor,()=>"The x passed in valueAndGrad(f)(x) must be a tensor"),l.assert(null==r||r instanceof a.Tensor,()=>"The dy passed in valueAndGrad(f)(x, dy) must be a tensor");let{grads:n,value:o}=(0,s.ENGINE).gradients(()=>e(t),[t],r);return h(n),{grad:n[0],value:o}}}function c(e){return l.assert(l.isFunction(e),()=>"The f passed in valueAndGrads(f) must be a function"),(t,r)=>{l.assert(Array.isArray(t)&&t.every(e=>e instanceof a.Tensor),()=>"The args passed in valueAndGrads(f)(args) must be array of tensors"),l.assert(null==r||r instanceof a.Tensor,()=>"The dy passed in valueAndGrads(f)(args, dy) must be a tensor");let n=(0,s.ENGINE).gradients(()=>e(...t),t,r);return null!=r&&l.assertShapesMatch(n.value.shape,r.shape,"The shape of dy passed in valueAndGrads(f)([x1,...], dy) must match the shape returned by f([x1,...])"),h(n.grads),n}}function d(e,t){l.assert(l.isFunction(e),()=>"The f passed in variableGrads(f) must be a function"),l.assert(null==t||Array.isArray(t)&&t.every(e=>e instanceof a.Variable),()=>"The varList passed in variableGrads(f, varList) must be an array of variables");let r=null!=t;if(!r)for(let e in t=[],s.ENGINE.registeredVariables)t.push(s.ENGINE.registeredVariables[e]);let n=r?t.filter(e=>!e.trainable):null,o=t.length;t=t.filter(e=>e.trainable),l.assert(t.length>0,()=>`variableGrads() expects at least one of the input variables to be trainable, but none of the ${o} variables is trainable.`);let{value:i,grads:u}=(0,s.ENGINE).gradients(e,t,null,!0);l.assert(u.some(e=>null!=e),()=>"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()."),l.assert(0===i.rank,()=>`The f passed in variableGrads(f) must return a scalar, but it returned a rank-${i.rank} tensor`);let p={};return t.forEach((e,t)=>{null!=u[t]&&(p[e.name]=u[t])}),null!=n&&n.forEach(e=>p[e.name]=null),{value:i,grads:p}}function f(e){return(0,s.ENGINE).customGrad(e)}function h(e){if(e.filter(e=>null==e).length>0)throw 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.`)}},{"./engine":"6eJyD","./tensor":"cZ8UW","./tensor_util_env":"g1Qlv","./util":"gBRMK","@parcel/transformer-js/src/esmodule-helpers.js":"9pCYc"}],"7zXw5":[function(e,t,r){/** * @license * Copyright 2018 Google LLC. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. * ============================================================================= */var n=e("@parcel/transformer-js/src/esmodule-helpers.js");n.defineInteropFlag(r),n.export(r,"neg",()=>l);var s=e("../engine"),a=e("../kernel_names"),o=e("../tensor_util_env");let l=/* @__PURE__ */(0,e("./operation").op)({neg_:function(e){let t=(0,o.convertToTensor)(e,"x","neg");return(0,s.ENGINE).runKernel(a.Neg,{x:t})}})},{"../engine":"6eJyD","../kernel_names":"aqvy4","../tensor_util_env":"g1Qlv","./operation":"2kGjz","@parcel/transformer-js/src/esmodule-helpers.js":"9pCYc"}],"9FSsO":[function(e,t,r){/** * @license * Copyright 2018 Google LLC. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. * ============================================================================= */var n=e("@parcel/transformer-js/src/esmodule-helpers.js");n.defineInteropFlag(r),n.export(r,"softplus",()=>l);var s=e("../engine"),a=e("../kernel_names"),o=e("../tensor_util_env");let l=/* @__PURE__ */(0,e("./operation").op)({softplus_:function(e){let t=(0,o.convertToTensor)(e,"x","softplus");return(0,s.ENGINE).runKernel(a.Softplus,{x:t})}})},{"../engine":"6eJyD","../kernel_names":"aqvy4","../tensor_util_env":"g1Qlv","./operation":"2kGjz","@parcel/transformer-js/src/esmodule-helpers.js":"9pCYc"}],"7hcJP":[function(e,t,r){/** * @license * Copyright 2020 Google Inc. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. * ============================================================================= */var n=e("@parcel/transformer-js/src/esmodule-helpers.js");n.defineInteropFlag(r),n.export(r,"logSoftmax",()=>h);var s=e("../gradients"),a=e("../tensor_util_env"),o=e("./cast"),l=e("./exp"),i=e("./log"),u=e("./max"),p=e("./mul"),c=e("./operation"),d=e("./sub"),f=e("./sum");let h=/* @__PURE__ */(0,c.op)({logSoftmax_:function(e,t=-1){let r=(0,a.convertToTensor)(e,"logits","logSoftmax");if(-1===t&&(t=r.rank-1),t!==r.rank-1)throw Error(`Log Softmax along a non-last dimension is not yet supported. Logits was rank ${r.rank} and axis was ${t}`);return(0,s.customGrad)((e,r)=>{let n=(0,u.max)(e,t,!0),s=(0,d.sub)(e,n),a=(0,d.sub)((0,o.cast)(s,"float32"),(0,i.log)((0,f.sum)((0,l.exp)(s),t,!0)));return r([a]),{value:a,gradFunc:(e,r)=>{let[n]=r,s=(0,l.exp)(n);return(0,d.sub)(e,(0,p.mul)((0,f.sum)(e,t,!0),s))}}})(r)}})},{"../gradients":"ab8zU","../tensor_util_env":"g1Qlv","./cast":"ekSnT","./exp":"g4QHY","./log":"jzL0E","./max":"6JsYy","./mul":"gPetX","./operation":"2kGjz","./sub":"cQqL3","./sum":"gsfPR","@parcel/transformer-js/src/esmodule-helpers.js":"9pCYc"}],cQqL3:[function(e,t,r){/** * @license * Copyright 2020 Google LLC. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. * ============================================================================= */var n=e("@parcel/transformer-js/src/esmodule-helpers.js");n.defineInteropFlag(r),n.export(r,"sub",()=>i);var s=e("../engine"),a=e("../kernel_names"),o=e("../tensor_util"),l=e("../tensor_util_env");let i=/* @__PURE__ */(0,e("./operation").op)({sub_:function(e,t){let r=(0,l.convertToTensor)(e,"a","sub"),n=(0,l.convertToTensor)(t,"b","sub");[r,n]=(0,o.makeTypesMatch)(r,n);let i={a:r,b:n};return(0,s.ENGINE).runKernel(a.Sub,i)}})},{"../engine":"6eJyD","../kernel_names":"aqvy4","../tensor_util":"jgr40","../tensor_util_env":"g1Qlv","./operation":"2kGjz","@parcel/transformer-js/src/esmodule-helpers.js":"9pCYc"}],"9LKqV":[function(e,t,r){/** * @license * Copyright 2020 Google LLC. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. * ============================================================================= */var n=e("@parcel/transformer-js/src/esmodule-helpers.js");n.defineInteropFlag(r),n.export(r,"logSumExp",()=>m);var s=e("../tensor_util_env"),a=e("../util"),o=e("./add"),l=e("./axis_util"),i=e("./exp"),u=e("./log"),p=e("./max"),c=e("./operation"),d=e("./reshape"),f=e("./sub"),h=e("./sum");let m=/* @__PURE__ */(0,c.op)({logSumExp_:function(e,t=null,r=!1){let n=(0,s.convertToTensor)(e,"x","logSumExp"),c=(0,a.parseAxisParam)(t,n.shape),m=(0,p.max)(n,c,!0),g=(0,f.sub)(n,m),x=(0,i.exp)(g),v=(0,h.sum)(x,c),y=(0,u.log)(v),b=(0,o.add)((0,d.reshape)(m,y.shape),y);if(r){let e=(0,l.expandShapeToKeepDim)(b.shape,c);return(0,d.reshape)(b,e)}return b}})},{"../tensor_util_env":"g1Qlv","../util":"gBRMK","./add":"g9v2X","./axis_util":"3ROd2","./exp":"g4QHY","./log":"jzL0E","./max":"6JsYy","./operation":"2kGjz","./reshape":"VuY4S","./sub":"cQqL3","./sum":"gsfPR","@parcel/transformer-js/src/esmodule-helpers.js":"9pCYc"}],eVMNJ:[function(e,t,r){/** * @license * Copyright 2020 Google LLC. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. * ============================================================================= */var n=e("@parcel/transformer-js/src/esmodule-helpers.js");n.defineInteropFlag(r),n.export(r,"logicalAnd",()=>i);var s=e("../engine"),a=e("../kernel_names"),o=e("../tensor_util_env"),l=e("./broadcast_util");let i=/* @__PURE__ */(0,e("./operation").op)({logicalAnd_:function(e,t){let r=(0,o.convertToTensor)(e,"a","logicalAnd","bool"),n=(0,o.convertToTensor)(t,"b","logicalAnd","bool");return(0,l.assertAndGetBroadcastShape)(r.shape,n.shape),(0,s.ENGINE).runKernel(a.LogicalAnd,{a:r,b:n})}})},{"../engine":"6eJyD","../kernel_names":"aqvy4","../tensor_util_env":"g1Qlv","./broadcast_util":"aouH8","./operation":"2kGjz","@parcel/transformer-js/src/esmodule-helpers.js":"9pCYc"}],hWzRt:[function(e,t,r){/** * @license * Copyright 2020 Google LLC. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. * ============================================================================= */var n=e("@parcel/transformer-js/src/esmodule-helpers.js");n.defineInteropFlag(r),n.export(r,"logicalNot",()=>l);var s=e("../engine"),a=e("../kernel_names"),o=e("../tensor_util_env");let l=/* @__PURE__ */(0,e("./operation").op)({logicalNot_:function(e){let t=(0,o.convertToTensor)(e,"x","logicalNot","bool");return(0,s.ENGINE).runKernel(a.LogicalNot,{x:t})}})},{"../engine":"6eJyD","../kernel_names":"aqvy4","../tensor_util_env":"g1Qlv","./operation":"2kGjz","@parcel/transformer-js/src/esmodule-helpers.js":"9pCYc"}],"7uYz3":[function(e,t,r){/** * @license * Copyright 2020 Google LLC. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. * ============================================================================= */var n=e("@parcel/transformer-js/src/esmodule-helpers.js");n.defineInteropFlag(r),n.export(r,"logicalOr",()=>i);var s=e("../engine"),a=e("../kernel_names"),o=e("../tensor_util_env"),l=e("./broadcast_util");let i=/* @__PURE__ */(0,e("./operation").op)({logicalOr_:function(e,t){let r=(0,o.convertToTensor)(e,"a","logicalOr","bool"),n=(0,o.convertToTensor)(t,"b","logicalOr","bool");return(0,l.assertAndGetBroadcastShape)(r.shape,n.shape),(0,s.ENGINE).runKernel(a.LogicalOr,{a:r,b:n})}})},{"../engine":"6eJyD","../kernel_names":"aqvy4","../tensor_util_env":"g1Qlv","./broadcast_util":"aouH8","./operation":"2kGjz","@parcel/transformer-js/src/esmodule-helpers.js":"9pCYc"}],"9Bill":[function(e,t,r){/** * @license * Copyright 2020 Google LLC. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. * ============================================================================= */var n=e("@parcel/transformer-js/src/esmodule-helpers.js");n.defineInteropFlag(r),n.export(r,"logicalXor",()=>u);var s=e("../tensor_util_env"),a=e("./broadcast_util"),o=e("./logical_and"),l=e("./logical_not"),i=e("./logical_or");let u=/* @__PURE__ */(0,e("./operation").op)({logicalXor_:function(e,t){let r=(0,s.convertToTensor)(e,"a","logicalXor","bool"),n=(0,s.convertToTensor)(t,"b","logicalXor","bool");return(0,a.assertAndGetBroadcastShape)(r.shape,n.shape),(0,o.logicalAnd)((0,i.logicalOr)(e,t),(0,l.logicalNot)((0,o.logicalAnd)(e,t)))}})},{"../tensor_util_env":"g1Qlv","./broadcast_util":"aouH8","./logical_and":"eVMNJ","./logical_not":"hWzRt","./logical_or":"7uYz3","./operation":"2kGjz","@parcel/transformer-js/src/esmodule-helpers.js":"9pCYc"}],db0zS:[function(e,t,r){/** * @license * Copyright 2022 Google LLC. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. * ============================================================================= */var n=e("@parcel/transformer-js/src/esmodule-helpers.js");n.defineInteropFlag(r),n.export(r,"lowerBound",()=>a);var s=e("./search_sorted");function a(e,t){return(0,s.searchSorted)(e,t,"left")}},{"./search_sorted":"2Y7bB","@parcel/transformer-js/src/esmodule-helpers.js":"9pCYc"}],"2Y7bB":[function(e,t,r){/** * @license * Copyright 2022 Google LLC. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. * ============================================================================= */var n=e("@parcel/transformer-js/src/esmodule-helpers.js");n.defineInteropFlag(r),n.export(r,"searchSorted",()=>p);var s=e("../engine"),a=e("../kernel_names"),o=e("../tensor_util_env"),l=e("../util_base"),i=e("./operation"),u=e("./reshape");let p=/* @__PURE__ */(0,i.op)({searchSorted_:function(e,t,r="left"){let n=(0,o.convertToTensor)(e,"sortedSequence","searchSorted"),i=(0,o.convertToTensor)(t,"values","searchSorted"),p=n.shape[n.shape.length-1],c=i.shape[i.shape.length-1],d=(0,u.reshape)(n,[-1,p]),f=(0,u.reshape)(i,[-1,c]);if(d.rank<2)throw Error("Sorted input argument must be at least 2-dimensional");if(d.shape[0]!==f.shape[0])throw Error("Leading dimension of 'sortedSequence' and 'values' must match.");if((0,l.sizeFromShape)(f.shape)>=0x80000000)throw Error("values tensor size must less than 2147483648");if(d.shape[1]>=0x80000000)throw Error(`trailing dim_size must less than 2147483648 for int32 output type, was ${d.shape[1]}`);return(0,s.ENGINE).runKernel(a.SearchSorted,{sortedSequence:d,values:f},{side:r})}})},{"../engine":"6eJyD","../kernel_names":"aqvy4","../tensor_util_env":"g1Qlv","../util_base":"8U7kO","./operation":"2kGjz","./reshape":"VuY4S","@parcel/transformer-js/src/esmodule-helpers.js":"9pCYc"}],eWrIA:[function(e,t,r){/** * @license * Copyright 2020 Google LLC. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. * ============================================================================= */var n=e("@parcel/transformer-js/src/esmodule-helpers.js");n.defineInteropFlag(r),n.export(r,"maxPool",()=>c);var s=e("../engine"),a=e("../kernel_names"),o=e("../tensor_util_env"),l=e("../util"),i=e("./conv_util"),u=e("./operation"),p=e("./reshape");let c=/* @__PURE__ */(0,u.op)({maxPool_:function(e,t,r,n,u){let c=(0,o.convertToTensor)(e,"x","maxPool"),d=c,f=!1;3===c.rank&&(f=!0,d=(0,p.reshape)(c,[1,c.shape[0],c.shape[1],c.shape[2]])),l.assert(4===d.rank,()=>`Error in maxPool: input must be rank 4 but got rank ${d.rank}.`),l.assert(i.eitherStridesOrDilationsAreOne(r,1),()=>`Error in maxPool: Either strides or dilations must be 1. Got strides ${r} and dilations '1'`),i.checkPadOnDimRoundingMode("maxPool",n,u);let h={x:d},m=(0,s.ENGINE).runKernel(a.MaxPool,h,{filterSize:t,strides:r,pad:n,dimRoundingMode:u});return f?(0,p.reshape)(m,[m.shape[1],m.shape[2],m.shape[3]]):m}})},{"../engine":"6eJyD","../kernel_names":"aqvy4","../tensor_util_env":"g1Qlv","../util":"gBRMK","./conv_util":"kmOtb","./operation":"2kGjz","./reshape":"VuY4S","@parcel/transformer-js/src/esmodule-helpers.js":"9pCYc"}],as7ZM:[function(e,t,r){/** * @license * Copyright 2020 Google LLC. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. * ============================================================================= */var n=e("@parcel/transformer-js/src/esmodule-helpers.js");n.defineInteropFlag(r),n.export(r,"maxPool3d",()=>c);var s=e("../engine"),a=e("../kernel_names"),o=e("../tensor_util_env"),l=e("../util"),i=e("./conv_util"),u=e("./operation"),p=e("./reshape");let c=/* @__PURE__ */(0,u.op)({maxPool3d_:function(e,t=[1,1,1],r,n,u,c="NDHWC"){let d=(0,o.convertToTensor)(e,"x","maxPool3d"),f=d,h=!1;4===d.rank&&(h=!0,f=(0,p.reshape)(d,[1,d.shape[0],d.shape[1],d.shape[2],d.shape[3]])),l.assert(5===f.rank,()=>`Error in maxPool3d: x must be rank 5 but got rank ${f.rank}.`),l.assert("NDHWC"===c,()=>`Error in maxPool3d: Only NDHWC is currently supported, but got dataFormat of ${c}`),(0,i.checkPadOnDimRoundingMode)("maxPool3d",n,u);let m={x:f},g=(0,s.ENGINE).runKernel(a.MaxPool3D,m,{filterSize:t,strides:r,pad:n,dimRoundingMode:u,dataFormat:c});return h?(0,p.reshape)(g,[g.shape[1],g.shape[2],g.shape[3],g.shape[4]]):g}})},{"../engine":"6eJyD","../kernel_names":"aqvy4","../tensor_util_env":"g1Qlv","../util":"gBRMK","./conv_util":"kmOtb","./operation":"2kGjz","./reshape":"VuY4S","@parcel/transformer-js/src/esmodule-helpers.js":"9pCYc"}],bXdzQ:[function(e,t,r){/** * @license * Copyright 2018 Google LLC. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. * ============================================================================= */var n=e("@parcel/transformer-js/src/esmodule-helpers.js");n.defineInteropFlag(r),n.export(r,"maxPoolWithArgmax",()=>l);var s=e("../engine"),a=e("../kernel_names"),o=e("../tensor_util_env");let l=/* @__PURE__ */(0,e("./operation").op)({maxPoolWithArgmax_:function(e,t,r,n,l=!1){let i=(0,o.convertToTensor)(e,"x","maxPoolWithArgmax"),u=(0,s.ENGINE).runKernel(a.MaxPoolWithArgmax,{x:i},{filterSize:t,strides:r,pad:n,includeBatchInIndex:l});return{result:u[0],indexes:u[1]}}})},{"../engine":"6eJyD","../kernel_names":"aqvy4","../tensor_util_env":"g1Qlv","./operation":"2kGjz","@parcel/transformer-js/src/esmodule-helpers.js":"9pCYc"}],dq98s:[function(e,t,r){/** * @license * Copyright 2020 Google LLC. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. * ============================================================================= */var n=e("@parcel/transformer-js/src/esmodule-helpers.js");n.defineInteropFlag(r),n.export(r,"maximum",()=>p);var s=e("../engine"),a=e("../kernel_names"),o=e("../tensor_util"),l=e("../tensor_util_env"),i=e("./broadcast_util"),u=e("./cast");let p=/* @__PURE__ */(0,e("./operation").op)({maximum_:function(e,t){let r=(0,l.convertToTensor)(e,"a","maximum"),n=(0,l.convertToTensor)(t,"b","maximum");[r,n]=(0,o.makeTypesMatch)(r,n),"bool"===r.dtype&&(r=(0,u.cast)(r,"int32"),n=(0,u.cast)(n,"int32")),(0,i.assertAndGetBroadcastShape)(r.shape,n.shape);let p={a:r,b:n};return(0,s.ENGINE).runKernel(a.Maximum,p)}})},{"../engine":"6eJyD","../kernel_names":"aqvy4","../tensor_util":"jgr40","../tensor_util_env":"g1Qlv","./broadcast_util":"aouH8","./cast":"ekSnT","./operation":"2kGjz","@parcel/transformer-js/src/esmodule-helpers.js":"9pCYc"}],ddOHD:[function(e,t,r){/** * @license * Copyright 2020 Google Inc. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. * ============================================================================= */var n=e("@parcel/transformer-js/src/esmodule-helpers.js");n.defineInteropFlag(r),n.export(r,"mean",()=>l);var s=e("../engine"),a=e("../kernel_names"),o=e("../tensor_util_env");let l=/* @__PURE__ */(0,e("./operation").op)({mean_:function(e,t=null,r=!1){let n=(0,o.convertToTensor)(e,"x","mean");return(0,s.ENGINE).runKernel(a.Mean,{x:n},{axis:t,keepDims:r})}})},{"../engine":"6eJyD","../kernel_names":"aqvy4","../tensor_util_env":"g1Qlv","./operation":"2kGjz","@parcel/transformer-js/src/esmodule-helpers.js":"9pCYc"}],gelPo:[function(e,t,r){/** * @license * Copyright 2021 Google LLC. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. * ============================================================================= */var n=e("@parcel/transformer-js/src/esmodule-helpers.js");n.defineInteropFlag(r),n.export(r,"meshgrid",()=>p);var s=e("./mat_mul"),a=e("./ones"),o=e("./reshape"),l=e("../tensor"),i=e("../tensor_util_env"),u=e("../util_base");function p(e,t,{indexing:r="xy"}={}){if("xy"!==r&&"ij"!==r)throw TypeError(`${r} is not a valid third argument to meshgrid`);if(void 0===e)return[];let n=(0,i.convertToTensor)(e,"x","meshgrid",e instanceof l.Tensor?e.dtype:"float32");if(void 0===t)return[n];let c=(0,i.convertToTensor)(t,"y","meshgrid",t instanceof l.Tensor?t.dtype:"float32"),d=(0,u.sizeFromShape)(n.shape),f=(0,u.sizeFromShape)(c.shape);return"xy"===r?(n=(0,o.reshape)(n,[1,-1]),c=(0,o.reshape)(c,[-1,1]),[(0,s.matMul)((0,a.ones)([f,1],n.dtype),n),(0,s.matMul)(c,(0,a.ones)([1,d],c.dtype))]):(n=(0,o.reshape)(n,[-1,1]),c=(0,o.reshape)(c,[1,-1]),[(0,s.matMul)(n,(0,a.ones)([1,f],n.dtype)),(0,s.matMul)((0,a.ones)([d,1],c.dtype),c)])}},{"./mat_mul":"9ZocJ","./ones":"bs1MK","./reshape":"VuY4S","../tensor":"cZ8UW","../tensor_util_env":"g1Qlv","../util_base":"8U7kO","@parcel/transformer-js/src/esmodule-helpers.js":"9pCYc"}],bs1MK:[function(e,t,r){/** * @license * Copyright 2018 Google LLC. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. * ============================================================================= */var n=e("@parcel/transformer-js/src/esmodule-helpers.js");n.defineInteropFlag(r),n.export(r,"ones",()=>function e(t,r="float32"){if((0,o.assertNonNegativeIntegerDimensions)(t),"complex64"===r){let r=e(t,"float32"),n=(0,i.zeros)(t,"float32");return(0,l.complex)(r,n)}let n=(0,a.makeOnesTypedArray)((0,a.sizeFromShape)(t),r);return(0,s.ENGINE).makeTensor(n,t,r)});var s=e("../engine"),a=e("../util"),o=e("../util_base"),l=e("./complex"),i=e("./zeros")},{"../engine":"6eJyD","../util":"gBRMK","../util_base":"8U7kO","./complex":"98mI6","./zeros":"1YDK1","@parcel/transformer-js/src/esmodule-helpers.js":"9pCYc"}],"1YDK1":[function(e,t,r){/** * @license * Copyright 2018 Google LLC. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. * ============================================================================= */var n=e("@parcel/transformer-js/src/esmodule-helpers.js");n.defineInteropFlag(r),n.export(r,"zeros",()=>function e(t,r="float32"){if((0,a.assertNonNegativeIntegerDimensions)(t),"complex64"===r){let r=e(t,"float32"),n=e(t,"float32");return(0,o.complex)(r,n)}let n=(0,a.makeZerosTypedArray)((0,a.sizeFromShape)(t),r);return(0,s.ENGINE).makeTensor(n,t,r)});var s=e("../engine"),a=e("../util"),o=e("./complex")},{"../engine":"6eJyD","../util":"gBRMK","./complex":"98mI6","@parcel/transformer-js/src/esmodule-helpers.js":"9pCYc"}],jeIQ1:[function(e,t,r){/** * @license * Copyright 2020 Google LLC. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. * ============================================================================= */var n=e("@parcel/transformer-js/src/esmodule-helpers.js");n.defineInteropFlag(r),n.export(r,"minimum",()=>p);var s=e("../engine"),a=e("../kernel_names"),o=e("../tensor_util"),l=e("../tensor_util_env"),i=e("./broadcast_util"),u=e("./cast");let p=/* @__PURE__ */(0,e("./operation").op)({minimum_:function(e,t){let r=(0,l.convertToTensor)(e,"a","minimum"),n=(0,l.convertToTensor)(t,"b","minimum");[r,n]=(0,o.makeTypesMatch)(r,n),"bool"===r.dtype&&(r=(0,u.cast)(r,"int32"),n=(0,u.cast)(n,"int32")),(0,i.assertAndGetBroadcastShape)(r.shape,n.shape);let p={a:r,b:n};return(0,s.ENGINE).runKernel(a.Minimum,p)}})},{"../engine":"6eJyD","../kernel_names":"aqvy4","../tensor_util":"jgr40","../tensor_util_env":"g1Qlv","./broadcast_util":"aouH8","./cast":"ekSnT","./operation":"2kGjz","@parcel/transformer-js/src/esmodule-helpers.js":"9pCYc"}],hDICJ:[function(e,t,r){/** * @license * Copyright 2020 Google LLC. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. * ============================================================================= */var n=e("@parcel/transformer-js/src/esmodule-helpers.js");n.defineInteropFlag(r),n.export(r,"mirrorPad",()=>i);var s=e("../engine"),a=e("../kernel_names"),o=e("../tensor_util_env"),l=e("../util");let i=/* @__PURE__ */(0,e("./operation").op)({mirrorPad_:function(e,t,r){l.assert("reflect"===r||"symmetric"===r,()=>`Invalid mode. Mode must be either reflect or symmetric. Got ${r}.`);let n=(0,o.convertToTensor)(e,"x","mirrorPad");if(0===n.rank)throw Error("mirrorPad(scalar) is not defined. Pass non-scalar to mirrorPad");l.assert(t.length===n.rank,()=>`Padding doesn't match input. Must be ${n.rank}. Got ${t.length}.`);let i="reflect"===r?1:0;for(let e=0;e"Invalid number of paddings. Must be length of 2 each."),l.assert(t[e][0]>=0&&t[e][0]<=n.shape[e]-i&&t[e][1]>=0&&t[e][1]<=n.shape[e]-i,()=>`Padding in dimension ${e} cannot be greater than or equal to ${n.shape[e]-i} or less than 0 for input of shape ${n.shape}`);return(0,s.ENGINE).runKernel(a.MirrorPad,{x:n},{paddings:t,mode:r})}})},{"../engine":"6eJyD","../kernel_names":"aqvy4","../tensor_util_env":"g1Qlv","../util":"gBRMK","./operation":"2kGjz","@parcel/transformer-js/src/esmodule-helpers.js":"9pCYc"}],ekS4m:[function(e,t,r){/** * @license * Copyright 2020 Google LLC. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. * ============================================================================= */var n=e("@parcel/transformer-js/src/esmodule-helpers.js");n.defineInteropFlag(r),n.export(r,"mod",()=>i);var s=e("../engine"),a=e("../kernel_names"),o=e("../tensor_util"),l=e("../tensor_util_env");let i=/* @__PURE__ */(0,e("./operation").op)({mod_:function(e,t){let r=(0,l.convertToTensor)(e,"a","mod"),n=(0,l.convertToTensor)(t,"b","mod");[r,n]=(0,o.makeTypesMatch)(r,n);let i={a:r,b:n};return(0,s.ENGINE).runKernel(a.Mod,i)}})},{"../engine":"6eJyD","../kernel_names":"aqvy4","../tensor_util":"jgr40","../tensor_util_env":"g1Qlv","./operation":"2kGjz","@parcel/transformer-js/src/esmodule-helpers.js":"9pCYc"}],hG4nU:[function(e,t,r){/** * @license * Copyright 2020 Google LLC. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. * ============================================================================= */var n=e("@parcel/transformer-js/src/esmodule-helpers.js");n.defineInteropFlag(r),n.export(r,"moments",()=>f);var s=e("../tensor_util_env"),a=e("../util"),o=e("./axis_util"),l=e("./cast"),i=e("./mean"),u=e("./operation"),p=e("./reshape"),c=e("./square"),d=e("./sub");let f=/* @__PURE__ */(0,u.op)({moments_:function(e,t=null,r=!1){e=(0,s.convertToTensor)(e,"x","moments");let n=(0,a.parseAxisParam)(t,e.shape),u=(0,i.mean)(e,n,r),f=u.shape;r||(f=(0,o.expandShapeToKeepDim)(u.shape,n));let h=(0,c.square)((0,d.sub)((0,l.cast)(e,"float32"),(0,p.reshape)(u,f)));return{mean:u,variance:(0,i.mean)(h,n,r)}}})},{"../tensor_util_env":"g1Qlv","../util":"gBRMK","./axis_util":"3ROd2","./cast":"ekSnT","./mean":"ddOHD","./operation":"2kGjz","./reshape":"VuY4S","./square":"1Qqi7","./sub":"cQqL3","@parcel/transformer-js/src/esmodule-helpers.js":"9pCYc"}],"7gbfg":[function(e,t,r){var n=e("@parcel/transformer-js/src/esmodule-helpers.js");n.defineInteropFlag(r),n.export(r,"multiRNNCell",()=>a);var s=e("../tensor_util_env");let a=/* @__PURE__ */(0,e("./operation").op)({multiRNNCell_:function(e,t,r,n){let a=(0,s.convertToTensor)(t,"data","multiRNNCell"),o=(0,s.convertToTensorArray)(r,"c","multiRNNCell"),l=(0,s.convertToTensorArray)(n,"h","multiRNNCell"),i=a,u=[];for(let t=0;tu);var s=e("../engine"),a=e("../kernel_names"),o=e("../tensor_util_env"),l=e("./operation"),i=e("./reshape");let u=/* @__PURE__ */(0,l.op)({multinomial_:function(e,t,r,n=!1){let l=(0,o.convertToTensor)(e,"logits","multinomial"),u=l.size,p=l.rank;if(u<2)throw Error(`Error in multinomial: you need at least 2 outcomes, but got ${u}.`);if(p>2)throw Error(`Rank of probabilities must be 1 or 2, but is ${p}`);r=r||Math.random();let c=1===p?(0,i.reshape)(l,[1,-1]):l,d={numSamples:t,seed:r,normalized:n},f=(0,s.ENGINE).runKernel(a.Multinomial,{logits:c},d);return 1===p?(0,i.reshape)(f,[f.size]):f}})},{"../engine":"6eJyD","../kernel_names":"aqvy4","../tensor_util_env":"g1Qlv","./operation":"2kGjz","./reshape":"VuY4S","@parcel/transformer-js/src/esmodule-helpers.js":"9pCYc"}],lDPfv:[function(e,t,r){/** * @license * Copyright 2020 Google LLC. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. * ============================================================================= */var n=e("@parcel/transformer-js/src/esmodule-helpers.js");n.defineInteropFlag(r),n.export(r,"notEqual",()=>u);var s=e("../engine"),a=e("../kernel_names"),o=e("../tensor_util"),l=e("../tensor_util_env"),i=e("./broadcast_util");let u=/* @__PURE__ */(0,e("./operation").op)({notEqual_:function(e,t){let r=(0,l.convertToTensor)(e,"a","notEqual","string_or_numeric"),n=(0,l.convertToTensor)(t,"b","notEqual","string_or_numeric");[r,n]=(0,o.makeTypesMatch)(r,n),(0,i.assertAndGetBroadcastShape)(r.shape,n.shape);let u={a:r,b:n};return(0,s.ENGINE).runKernel(a.NotEqual,u)}})},{"../engine":"6eJyD","../kernel_names":"aqvy4","../tensor_util":"jgr40","../tensor_util_env":"g1Qlv","./broadcast_util":"aouH8","./operation":"2kGjz","@parcel/transformer-js/src/esmodule-helpers.js":"9pCYc"}],z9rKs:[function(e,t,r){/** * @license * Copyright 2020 Google LLC. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. * ============================================================================= */var n=e("@parcel/transformer-js/src/esmodule-helpers.js");n.defineInteropFlag(r),n.export(r,"oneHot",()=>l);var s=e("../engine"),a=e("../kernel_names"),o=e("../tensor_util_env");let l=/* @__PURE__ */(0,e("./operation").op)({oneHot_:function(e,t,r=1,n=0,l="int32"){if(t<2)throw Error(`Error in oneHot: depth must be >=2, but it is ${t}`);let i=(0,o.convertToTensor)(e,"indices","oneHot","int32");return(0,s.ENGINE).runKernel(a.OneHot,{indices:i},{dtype:l,depth:t,onValue:r,offValue:n})}})},{"../engine":"6eJyD","../kernel_names":"aqvy4","../tensor_util_env":"g1Qlv","./operation":"2kGjz","@parcel/transformer-js/src/esmodule-helpers.js":"9pCYc"}],wfRrw:[function(e,t,r){/** * @license * Copyright 2018 Google LLC. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. * ============================================================================= */var n=e("@parcel/transformer-js/src/esmodule-helpers.js");n.defineInteropFlag(r),n.export(r,"onesLike",()=>l);var s=e("../engine"),a=e("../kernel_names"),o=e("../tensor_util_env");let l=/* @__PURE__ */(0,e("./operation").op)({onesLike_:function(e){let t=(0,o.convertToTensor)(e,"x","onesLike");return(0,s.ENGINE).runKernel(a.OnesLike,{x:t})}})},{"../engine":"6eJyD","../kernel_names":"aqvy4","../tensor_util_env":"g1Qlv","./operation":"2kGjz","@parcel/transformer-js/src/esmodule-helpers.js":"9pCYc"}],as4kd:[function(e,t,r){var n=e("@parcel/transformer-js/src/esmodule-helpers.js");n.defineInteropFlag(r),n.export(r,"outerProduct",()=>u);var s=e("../tensor_util_env"),a=e("../util"),o=e("./mat_mul"),l=e("./operation"),i=e("./reshape");let u=/* @__PURE__ */(0,l.op)({outerProduct_:function(e,t){let r=(0,s.convertToTensor)(e,"v1","outerProduct"),n=(0,s.convertToTensor)(t,"v2","outerProduct");a.assert(1===r.rank&&1===n.rank,()=>`Error in outerProduct: inputs must be rank 1, but got ranks ${r.rank} and ${n.rank}.`);let l=(0,i.reshape)(r,[-1,1]),u=(0,i.reshape)(n,[1,-1]);return(0,o.matMul)(l,u)}})},{"../tensor_util_env":"g1Qlv","../util":"gBRMK","./mat_mul":"9ZocJ","./operation":"2kGjz","./reshape":"VuY4S","@parcel/transformer-js/src/esmodule-helpers.js":"9pCYc"}],ady8n:[function(e,t,r){/** * @license * Copyright 2020 Google LLC. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. * ============================================================================= */var n=e("@parcel/transformer-js/src/esmodule-helpers.js");n.defineInteropFlag(r),n.export(r,"pad",()=>l);var s=e("../engine"),a=e("../kernel_names"),o=e("../tensor_util_env");let l=/* @__PURE__ */(0,e("./operation").op)({pad_:function(e,t,r=0){let n=(0,o.convertToTensor)(e,"x","pad");if(0===n.rank)throw Error("pad(scalar) is not defined. Pass non-scalar to pad");return(0,s.ENGINE).runKernel(a.PadV2,{x:n},{paddings:t,constantValue:r})}})},{"../engine":"6eJyD","../kernel_names":"aqvy4","../tensor_util_env":"g1Qlv","./operation":"2kGjz","@parcel/transformer-js/src/esmodule-helpers.js":"9pCYc"}],Xfx8c:[function(e,t,r){var n=e("@parcel/transformer-js/src/esmodule-helpers.js");n.defineInteropFlag(r),n.export(r,"pad1d",()=>l);var s=e("../util"),a=e("./operation"),o=e("./pad");let l=/* @__PURE__ */(0,a.op)({pad1d_:function(e,t,r=0){return(0,s.assert)(2===t.length,()=>"Invalid number of paddings. Must be length of 2."),(0,o.pad)(e,[t],r)}})},{"../util":"gBRMK","./operation":"2kGjz","./pad":"ady8n","@parcel/transformer-js/src/esmodule-helpers.js":"9pCYc"}],"5deCK":[function(e,t,r){var n=e("@parcel/transformer-js/src/esmodule-helpers.js");n.defineInteropFlag(r),n.export(r,"pad2d",()=>l);var s=e("../util"),a=e("./operation"),o=e("./pad");let l=/* @__PURE__ */(0,a.op)({pad2d_:function(e,t,r=0){return(0,s.assert)(2===t.length&&2===t[0].length&&2===t[1].length,()=>"Invalid number of paddings. Must be length of 2 each."),(0,o.pad)(e,t,r)}})},{"../util":"gBRMK","./operation":"2kGjz","./pad":"ady8n","@parcel/transformer-js/src/esmodule-helpers.js":"9pCYc"}],hd4Cr:[function(e,t,r){var n=e("@parcel/transformer-js/src/esmodule-helpers.js");n.defineInteropFlag(r),n.export(r,"pad3d",()=>l);var s=e("../util"),a=e("./operation"),o=e("./pad");let l=/* @__PURE__ */(0,a.op)({pad3d_:function(e,t,r=0){return(0,s.assert)(3===t.length&&2===t[0].length&&2===t[1].length&&2===t[2].length,()=>"Invalid number of paddings. Must be length of 2 each."),(0,o.pad)(e,t,r)}})},{"../util":"gBRMK","./operation":"2kGjz","./pad":"ady8n","@parcel/transformer-js/src/esmodule-helpers.js":"9pCYc"}],"42UbX":[function(e,t,r){var n=e("@parcel/transformer-js/src/esmodule-helpers.js");n.defineInteropFlag(r),n.export(r,"pad4d",()=>l);var s=e("../util"),a=e("./operation"),o=e("./pad");let l=/* @__PURE__ */(0,a.op)({pad4d_:function(e,t,r=0){return(0,s.assert)(4===t.length&&2===t[0].length&&2===t[1].length&&2===t[2].length&&2===t[3].length,()=>"Invalid number of paddings. Must be length of 2 each."),(0,o.pad)(e,t,r)}})},{"../util":"gBRMK","./operation":"2kGjz","./pad":"ady8n","@parcel/transformer-js/src/esmodule-helpers.js":"9pCYc"}],iU8mp:[function(e,t,r){/** * @license * Copyright 2018 Google LLC. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. * ============================================================================= */var n=e("@parcel/transformer-js/src/esmodule-helpers.js");n.defineInteropFlag(r),n.export(r,"pool",()=>f);var s=e("../tensor_util_env"),a=e("../util"),o=e("./avg_pool"),l=e("./batch_to_space_nd"),i=e("./conv_util"),u=e("./max_pool"),p=e("./operation"),c=e("./reshape"),d=e("./space_to_batch_nd");let f=/* @__PURE__ */(0,p.op)({pool_:function(e,t,r,n,p,f,h){let m;null==p&&(p=[1,1]),null==f&&(f=1),0===n&&(n="valid");let g=(0,s.convertToTensor)(e,"x","maxPool"),x=g,v=!1;3===g.rank&&(v=!0,x=(0,c.reshape)(g,[1,g.shape[0],g.shape[1],g.shape[2]])),a.assert(i.eitherStridesOrDilationsAreOne(f,p),()=>`Error in pool: Either strides or dilations must be 1. Got strides ${f} and dilations '${p}'`);let y=i.computePool2DInfo(x.shape,t,f,p,n),b=[y.dilationHeight,y.dilationWidth];m="same"===n?function(e,t){let r=e.map((e,r)=>e+(e-1)*(t[r]-1)).map(e=>e-1),n=r.map(e=>Math.floor(e/2)),s=r.map((e,t)=>e-n[t]);return r.map((e,t)=>[n[t],s[t]])}([y.filterHeight,y.filterWidth],b):[[0,0],[0,0]];let _=1===b[0]&&1===b[1],[k,j]=function(e,t,r){let n=r.map(e=>e[0]),s=r.map(e=>e[1]),a=e.concat(n,s),o=t.map((e,t)=>(e-a[t]%e)%e),l=s.map((e,t)=>e+o[t]);return[t.map((e,t)=>[n[t],l[t]]),t.map((e,t)=>[0,o[t]])]}([y.inHeight,y.inWidth],b,m),I=_?n:"valid",C=_?x:(0,d.spaceToBatchND)(x,b,k),w=("avg"===r?()=>(0,o.avgPool)(C,t,f,I,h):()=>(0,u.maxPool)(C,t,f,I,h))(),T=_?w:(0,l.batchToSpaceND)(w,b,j);return v?(0,c.reshape)(T,[T.shape[1],T.shape[2],T.shape[3]]):T}})},{"../tensor_util_env":"g1Qlv","../util":"gBRMK","./avg_pool":"ghaN2","./batch_to_space_nd":"h1uzb","./conv_util":"kmOtb","./max_pool":"eWrIA","./operation":"2kGjz","./reshape":"VuY4S","./space_to_batch_nd":"ltsHr","@parcel/transformer-js/src/esmodule-helpers.js":"9pCYc"}],ltsHr:[function(e,t,r){/** * @license * Copyright 2020 Google LLC. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. * ============================================================================= */var n=e("@parcel/transformer-js/src/esmodule-helpers.js");n.defineInteropFlag(r),n.export(r,"spaceToBatchND",()=>i);var s=e("../engine"),a=e("../kernel_names"),o=e("../tensor_util_env"),l=e("../util");let i=/* @__PURE__ */(0,e("./operation").op)({spaceToBatchND_:function(e,t,r){let n=(0,o.convertToTensor)(e,"x","spaceToBatchND");return l.assert(n.rank>=1+t.length,()=>`input rank ${n.rank} should be > than [blockShape] ${t.length}`),l.assert(r.length===t.length,()=>`paddings.shape[0] ${r.length} must be equal to [blockShape] ${t.length}`),l.assert(n.shape.reduce((e,n,s)=>s>0&&s<=t.length?e&&(n+r[s-1][0]+r[s-1][1])%t[s-1]==0:e,!0),()=>`input spatial dimensions ${n.shape.slice(1)} with paddings ${r.toString()} must be divisible by blockShapes ${t.toString()}`),(0,s.ENGINE).runKernel(a.SpaceToBatchND,{x:n},{blockShape:t,paddings:r})}})},{"../engine":"6eJyD","../kernel_names":"aqvy4","../tensor_util_env":"g1Qlv","../util":"gBRMK","./operation":"2kGjz","@parcel/transformer-js/src/esmodule-helpers.js":"9pCYc"}],"9UqPZ":[function(e,t,r){/** * @license * Copyright 2020 Google LLC. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. * ============================================================================= */var n=e("@parcel/transformer-js/src/esmodule-helpers.js");n.defineInteropFlag(r),n.export(r,"prelu",()=>l);var s=e("../engine"),a=e("../kernel_names"),o=e("../tensor_util_env");let l=/* @__PURE__ */(0,e("./operation").op)({prelu_:function(e,t){let r=(0,o.convertToTensor)(e,"x","prelu"),n=(0,o.convertToTensor)(t,"alpha","prelu");return(0,s.ENGINE).runKernel(a.Prelu,{x:r,alpha:n})}})},{"../engine":"6eJyD","../kernel_names":"aqvy4","../tensor_util_env":"g1Qlv","./operation":"2kGjz","@parcel/transformer-js/src/esmodule-helpers.js":"9pCYc"}],fh6nt:[function(e,t,r){/** * @license * Copyright 2020 Google LLC. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. * ============================================================================= */var n=e("@parcel/transformer-js/src/esmodule-helpers.js");n.defineInteropFlag(r),n.export(r,"prod",()=>i);var s=e("../engine"),a=e("../kernel_names"),o=e("../tensor_util_env"),l=e("./cast");let i=/* @__PURE__ */(0,e("./operation").op)({prod_:function(e,t=null,r=!1){let n=(0,o.convertToTensor)(e,"x","prod");"bool"===n.dtype&&(n=(0,l.cast)(n,"int32"));let i={x:n};return(0,s.ENGINE).runKernel(a.Prod,i,{axis:t,keepDims:r})}})},{"../engine":"6eJyD","../kernel_names":"aqvy4","../tensor_util_env":"g1Qlv","./cast":"ekSnT","./operation":"2kGjz","@parcel/transformer-js/src/esmodule-helpers.js":"9pCYc"}],eeYzF:[function(e,t,r){/** * @license * Copyright 2022 Google LLC. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. * ============================================================================= */var n=e("@parcel/transformer-js/src/esmodule-helpers.js");n.defineInteropFlag(r),n.export(r,"raggedGather",()=>l);var s=e("../engine"),a=e("../kernel_names"),o=e("../tensor_util_env");let l=/* @__PURE__ */(0,e("./operation").op)({raggedGather_:function(e,t,r,n){let l=e.map((e,t)=>(0,o.convertToTensor)(e,`tensors${t}`,"raggedGather","int32")),i=(0,o.convertToTensor)(t,"paramsDenseValues","raggedGather"),u=(0,o.convertToTensor)(r,"indices","raggedGather","int32"),p=(0,s.ENGINE).runKernel(a.RaggedGather,{paramsNestedSplits:l,paramsDenseValues:i,indices:u},{outputRaggedRank:n});return{outputNestedSplits:p.slice(0,p.length-1),outputDenseValues:p[p.length-1]}}})},{"../engine":"6eJyD","../kernel_names":"aqvy4","../tensor_util_env":"g1Qlv","./operation":"2kGjz","@parcel/transformer-js/src/esmodule-helpers.js":"9pCYc"}],jEZ32:[function(e,t,r){/** * @license * Copyright 2022 Google LLC. * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. * ============================================================================= */var n=e("@parcel/transformer-js/src/esmodule-helpers.js");n.defineInteropFlag(r),n.export(r,"raggedRange",()=>l);var s=e("../engine"),a=e("../kernel_names"),o=e("../tensor_util_env");let l=/* @__PURE__ */(0,e("./operation").op)({raggedRange_:function(e,t,r){let n=(0,o.convertToTensor)(e,"starts","raggedRange"),l=(0,o.convertToTensor)(t,"limits","raggedRange",n.dtype),i=(0,o.convertToTensor)(r,"deltas","raggedRange",n.dtype),u=(0,s.ENGINE).runKernel(a.RaggedRange,{starts:n,limits:l,deltas:i});return{rtNestedSplits:u[0],rtDenseValues:u[1]}}})},{"../engine":"6eJyD","../kernel_names":"aqvy4","../tensor_util_env":"g1Qlv","./operation":"2kGjz","@parcel/transformer-js/src/esmodule-helpers.js":"9pCYc"}],"9GUiW":[function(e,t,r){/** * @license * Copyright 2022 Google LLC. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. * ============================================================================= */var n=e("@parcel/transformer-js/src/esmodule-helpers.js");n.defineInteropFlag(r),n.export(r,"raggedTensorToTensor",()=>l);var s=e("../engine"),a=e("../kernel_names"),o=e("../tensor_util_env");let l=/* @__PURE__ */(0,e("./operation").op)({raggedTensorToTensor_:function(e,t,r,n,l){let i=(0,o.convertToTensor)(e,"shape","raggedTensorToTensor","int32"),u=(0,o.convertToTensor)(t,"values","raggedTensorToTensor"),p=(0,o.convertToTensor)(r,"defaultValue","raggedTensorToTensor",u.dtype),c=n.map((e,t)=>(0,o.convertToTensor)(e,`tensors${t}`,"raggedTensorToTensor","int32"));return(0,s.ENGINE).runKernel(a.RaggedTensorToTensor,{shape:i,values:u,defaultValue:p,rowPartitionTensors:c},{rowPartitionTypes:l})}})},{"../engine":"6eJyD","../kernel_names":"aqvy4","../tensor_util_env":"g1Qlv","./operation":"2kGjz","@parcel/transformer-js/src/esmodule-helpers.js":"9pCYc"}],"6BhXX":[function(e,t,r){/** * @license * Copyright 2020 Google LLC. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. * ============================================================================= */var n=e("@parcel/transformer-js/src/esmodule-helpers.js");n.defineInteropFlag(r),n.export(r,"rand",()=>l);var s=e("../engine"),a=e("../util"),o=e("../util_base");let l=/* @__PURE__ */(0,e("./operation").op)({rand_:function(e,t,r){(0,o.assertNonNegativeIntegerDimensions)(e);let n=(0,a.sizeFromShape)(e),l=null;if(null==r||"float32"===r)l=new Float32Array(n);else if("int32"===r)l=new Int32Array(n);else if("bool"===r)l=new Uint8Array(n);else throw Error(`Unknown data type ${r}`);for(let e=0;ei);var s=e("../util_base"),a=e("./buffer"),o=e("./operation"),l=e("./rand_util");let i=/* @__PURE__ */(0,o.op)({randomGamma_:function(e,t,r=1,n="float32",o){if((0,s.assertNonNegativeIntegerDimensions)(e),null==r&&(r=1),null==n&&(n="float32"),"float32"!==n&&"int32"!==n)throw Error(`Unsupported data type ${n}`);let i=new l.RandGamma(t,r,n,o),u=(0,a.buffer)(e,n);for(let e=0;eo),n.export(r,"RandGamma",()=>l),n.export(r,"UniformRandom",()=>i),n.export(r,"jarqueBeraNormalityTest",()=>u),n.export(r,"expectArrayInMeanStdRange",()=>p);var s=e("seedrandom"),a=e("../test_util");class o{constructor(e,t,r,n,a){this.mean=e,this.stdDev=t,this.dtype=r,this.nextVal=NaN,this.truncated=n,this.truncated&&(this.upper=this.mean+2*this.stdDev,this.lower=this.mean-2*this.stdDev);let o=a||Math.random();this.random=s.alea(o.toString())}nextValue(){let e,t;if(!isNaN(this.nextVal)){let e=this.nextVal;return this.nextVal=NaN,e}let r=!1;for(;!r;){let n,s,a;do a=(n=2*this.random()-1)*n+(s=2*this.random()-1)*s;while(a>=1||0===a)let o=Math.sqrt(-2*Math.log(a)/a);e=this.mean+this.stdDev*n*o,t=this.mean+this.stdDev*s*o,(!this.truncated||this.isValidTruncated(e))&&(r=!0)}return(!this.truncated||this.isValidTruncated(t))&&(this.nextVal=this.convertValue(t)),this.convertValue(e)}convertValue(e){return null==this.dtype||"float32"===this.dtype?e:Math.round(e)}isValidTruncated(e){return e<=this.upper&&e>=this.lower}}class l{constructor(e,t,r,n){this.alpha=e,this.beta=1/t,this.dtype=r;let a=n||Math.random();this.randu=s.alea(a.toString()),this.randn=new o(0,1,r,!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,r,n,s,a;for(;;){do n=this.randn.nextValue(),a=1+this.c*n;while(a<=0)if(a*=a*a,t=1-.331*(e=n*n)*e,r=.5*e+this.d*(1-a+Math.log(a)),(s=this.randu())null==this.dtype||"float32"===this.dtype,this.min=e,this.range=t-e,this.dtype=r,null==n&&(n=Math.random()),"number"==typeof n&&(n=n.toString()),!this.canReturnFloat()&&this.range<=1)throw Error(`The difference between ${e} - ${t} <= 1 and dtype is not float`);this.random=s.alea(n)}convertValue(e){return this.canReturnFloat()?e:Math.round(e)}nextValue(){return this.convertValue(this.min+this.range*this.random())}}function u(e){let t=e.length/6*(Math.pow(function(e){let t=c(e),r=e.length,n=0,s=0;for(let a=0;a5.991)throw Error(`Invalid p-value for JB: ${t}`)}function p(e,t,r,n){null==n&&(n=(0,a.testEpsilon)());let s=c(e);(0,a.expectNumbersClose)(s,t,n),(0,a.expectNumbersClose)(function(e,t){let r=0;for(let n=0;n>>0,n-=t,n*=t,t=n>>>0,n-=t,t+=0x100000000*n}return(t>>>0)*23283064365386963e-26});r.next=function(){var e=2091639*r.s0+23283064365386963e-26*r.c;return r.s0=r.s1,r.s1=r.s2,r.s2=e-(r.c=0|e)},r.c=1,r.s0=n(" "),r.s1=n(" "),r.s2=n(" "),r.s0-=n(e),r.s0<0&&(r.s0+=1),r.s1-=n(e),r.s1<0&&(r.s1+=1),r.s2-=n(e),r.s2<0&&(r.s2+=1)}function s(e,t){return t.c=e.c,t.s0=e.s0,t.s1=e.s1,t.s2=e.s2,t}function a(e,t){var r=new n(e),a=t&&t.state,o=r.next;return o.int32=function(){return 0x100000000*r.next()|0},o.double=function(){return o()+(2097152*o()|0)*11102230246251565e-32},o.quick=o,a&&("object"==typeof a&&s(a,r),o.state=function(){return s(r,{})}),o}t&&t.exports?t.exports=a:r&&r.amd?r(function(){return a}):this.alea=a}(0,t,"function"==typeof define&&define)},{}],"4J2RD":[function(e,t,r){!function(e,t,r){function n(e){var t=this,r="";t.x=0,t.y=0,t.z=0,t.w=0,t.next=function(){var e=t.x^t.x<<11;return t.x=t.y,t.y=t.z,t.z=t.w,t.w^=t.w>>>19^e^e>>>8},e===(0|e)?t.x=e:r+=e;for(var n=0;n>>0)/0x100000000};return o.double=function(){do var e=r.next()>>>11,t=(r.next()>>>0)/0x100000000,n=(e+t)/2097152;while(0===n)return n},o.int32=r.next,o.quick=o,a&&("object"==typeof a&&s(a,r),o.state=function(){return s(r,{})}),o}t&&t.exports?t.exports=a:r&&r.amd?r(function(){return a}):this.xor128=a}(0,t,"function"==typeof define&&define)},{}],xFac6:[function(e,t,r){!function(e,t,r){function n(e){var t=this,r="";t.next=function(){var e=t.x^t.x>>>2;return t.x=t.y,t.y=t.z,t.z=t.w,t.w=t.v,(t.d=t.d+362437|0)+(t.v=t.v^t.v<<4^(e^e<<1))|0},t.x=0,t.y=0,t.z=0,t.w=0,t.v=0,e===(0|e)?t.x=e:r+=e;for(var n=0;n>>4),t.next()}function s(e,t){return t.x=e.x,t.y=e.y,t.z=e.z,t.w=e.w,t.v=e.v,t.d=e.d,t}function a(e,t){var r=new n(e),a=t&&t.state,o=function(){return(r.next()>>>0)/0x100000000};return o.double=function(){do var e=r.next()>>>11,t=(r.next()>>>0)/0x100000000,n=(e+t)/2097152;while(0===n)return n},o.int32=r.next,o.quick=o,a&&("object"==typeof a&&s(a,r),o.state=function(){return s(r,{})}),o}t&&t.exports?t.exports=a:r&&r.amd?r(function(){return a}):this.xorwow=a}(0,t,"function"==typeof define&&define)},{}],"8rTN7":[function(e,t,r){!function(e,t,r){function n(e){var t=this;t.next=function(){var e,r,n=t.x,s=t.i;return e=n[s],e^=e>>>7,r=e^e<<24^((e=n[s+1&7])^e>>>10)^((e=n[s+3&7])^e>>>3)^((e=n[s+4&7])^e<<7),e=n[s+7&7],e^=e<<13,r^=e^e<<9,n[s]=r,t.i=s+1&7,r},function(e,t){var r,n=[];if(t===(0|t))n[0]=t;else for(r=0,t=""+t;r0;--r)e.next()}(t,e)}function s(e,t){return t.x=e.x.slice(),t.i=e.i,t}function a(e,t){null==e&&(e=+new Date);var r=new n(e),a=t&&t.state,o=function(){return(r.next()>>>0)/0x100000000};return o.double=function(){do var e=r.next()>>>11,t=(r.next()>>>0)/0x100000000,n=(e+t)/2097152;while(0===n)return n},o.int32=r.next,o.quick=o,a&&(a.x&&s(a,r),o.state=function(){return s(r,{})}),o}t&&t.exports?t.exports=a:r&&r.amd?r(function(){return a}):this.xorshift7=a}(0,t,"function"==typeof define&&define)},{}],"4aaP5":[function(e,t,r){!function(e,t,r){function n(e){var t=this;t.next=function(){var e,r,n=t.w,s=t.X,a=t.i;return t.w=n=n+0x61c88647|0,r=s[a+34&127],e=s[a=a+1&127],r^=r<<13,e^=e<<17,r^=r>>>15,e^=e>>>12,r=s[a]=r^e,t.i=a,r+(n^n>>>16)|0},function(e,t){var r,n,s,a,o,l=[],i=128;for(t===(0|t)?(n=t,t=null):(t+="\0",n=0,i=Math.max(i,t.length)),s=0,a=-32;a>>15,n^=n<<4,n^=n>>>13,a>=0&&(o=o+0x61c88647|0,s=0==(r=l[127&a]^=n+o)?s+1:0);for(s>=128&&(l[127&(t&&t.length||0)]=-1),s=127,a=512;a>0;--a)n=l[s+34&127],r=l[s=s+1&127],n^=n<<13,r^=r<<17,n^=n>>>15,r^=r>>>12,l[s]=n^r;e.w=o,e.X=l,e.i=s}(t,e)}function s(e,t){return t.i=e.i,t.w=e.w,t.X=e.X.slice(),t}function a(e,t){null==e&&(e=+new Date);var r=new n(e),a=t&&t.state,o=function(){return(r.next()>>>0)/0x100000000};return o.double=function(){do var e=r.next()>>>11,t=(r.next()>>>0)/0x100000000,n=(e+t)/2097152;while(0===n)return n},o.int32=r.next,o.quick=o,a&&(a.X&&s(a,r),o.state=function(){return s(r,{})}),o}t&&t.exports?t.exports=a:r&&r.amd?r(function(){return a}):this.xor4096=a}(0,t,"function"==typeof define&&define)},{}],"6xb4S":[function(e,t,r){!function(e,t,r){function n(e){var t=this,r="";t.next=function(){var e=t.b,r=t.c,n=t.d,s=t.a;return e=e<<25^e>>>7^r,r=r-n|0,n=n<<24^n>>>8^s,s=s-e|0,t.b=e=e<<20^e>>>12^r,t.c=r=r-n|0,t.d=n<<16^r>>>16^s,t.a=s-e|0},t.a=0,t.b=0,t.c=-0x61c88647,t.d=0x517cc1b7,e===Math.floor(e)?(t.a=e/0x100000000|0,t.b=0|e):r+=e;for(var n=0;n>>0)/0x100000000};return o.double=function(){do var e=r.next()>>>11,t=(r.next()>>>0)/0x100000000,n=(e+t)/2097152;while(0===n)return n},o.int32=r.next,o.quick=o,a&&("object"==typeof a&&s(a,r),o.state=function(){return s(r,{})}),o}t&&t.exports?t.exports=a:r&&r.amd?r(function(){return a}):this.tychei=a}(0,t,"function"==typeof define&&define)},{}],kTMsl:[function(e,t,r){!function(r,n,s){var a,o="random",l=s.pow(256,6),i=s.pow(2,52),u=2*i;function p(e,t,p){var m=[],g=f(function e(t,r){var n,s=[],a=typeof t;if(r&&"object"==a)for(n in t)try{s.push(e(t[n],r-1))}catch(e){}return s.length?s:"string"==a?t:t+"\0"}((t=!0==t?{entropy:!0}:t||{}).entropy?[e,h(n)]:null==e?function(){try{var e;return a&&(e=a.randomBytes)?e=e(256):(e=new Uint8Array(256),(r.crypto||r.msCrypto).getRandomValues(e)),h(e)}catch(e){var t=r.navigator,s=t&&t.plugins;return[+new Date,r,s,r.screen,h(n)]}}():e,3),m),x=new c(m),v=function(){for(var e=x.g(6),t=l,r=0;e=u;)e/=2,t/=2,r>>>=1;return(e+r)/t};return v.int32=function(){return 0|x.g(4)},v.quick=function(){return x.g(4)/0x100000000},v.double=v,f(h(x.S),n),(t.pass||p||function(e,t,r,n){return(n&&(n.S&&d(n,x),e.state=function(){return d(x,{})}),r)?(s[o]=e,t):e})(v,g,"global"in t?t.global:this==s,t.state)}function c(e){var t,r=e.length,n=this,s=0,a=n.i=n.j=0,o=n.S=[];for(r||(e=[r++]);s<256;)o[s]=s++;for(s=0;s<256;s++)o[s]=o[a=255&a+e[s%r]+(t=o[s])],o[a]=t;(n.g=function(e){for(var t,r=0,s=n.i,a=n.j,o=n.S;e--;)t=o[s=255&s+1],r=256*r+o[255&(o[s]=o[a=255&a+t])+(o[a]=t)];return n.i=s,n.j=a,r})(256)}function d(e,t){return t.i=e.i,t.j=e.j,t.S=e.S.slice(),t}function f(e,t){for(var r,n=e+"",s=0;sl),n.export(r,"expectArraysClose",()=>i),n.export(r,"testEpsilon",()=>u),n.export(r,"expectPromiseToFail",()=>c),n.export(r,"expectArraysEqual",()=>d),n.export(r,"expectNumbersClose",()=>f),n.export(r,"expectValuesInRange",()=>m),n.export(r,"expectArrayBuffersEqual",()=>g),n.export(r,"encodeStrings",()=>function e(t){for(let r=0;rx),n.export(r,"play",()=>v);var s=e("./engine"),a=e("./tensor_util_env"),o=e("./util");let l=.1;function i(e,t,r){return null==r&&(r=u()),p(e,t,(e,t)=>h(e,t,r))}function u(){return 32===(0,s.ENGINE).backend.floatPrecision()?.001:l}function p(e,t,r){let n=!0;if(((0,o.isTypedArray)(e)||(0,o.isTypedArray)(t))&&(n=!1),(0,o.isTypedArray)(e)&&(0,o.isTypedArray)(t)&&(n=!0),n){let r=e.constructor.name,n=t.constructor.name;if(r!==n)throw Error(`Arrays are of different type. Actual: ${r}. Expected: ${n}`)}if(Array.isArray(e)&&Array.isArray(t)){let r=(0,a.inferShape)(e),n=(0,a.inferShape)(t);if(!(0,o.arraysEqual)(r,n))throw Error(`Arrays have different shapes. Actual: [${r}]. Expected: [${n}]`)}let s=(0,o.isTypedArray)(e)?e:(0,o.flatten)(e),l=(0,o.isTypedArray)(t)?t:(0,o.flatten)(t);if(s.length!==l.length)throw Error(`Arrays have different lengths actual: ${s.length} vs expected: ${l.length}. Actual: ${s}. Expected: ${l}.`);for(let e=0;et.fail(),()=>t()),"undefined"!=typeof expect&&expect().nothing()}function d(e,t){let r="string"==typeof t||"number"==typeof t||"boolean"==typeof t?[t]:t;return(0,o.isString)(e)||(0,o.isString)(e[0])||(0,o.isString)(t)||(0,o.isString)(t[0])?p(e,r,(e,t)=>e==t):p(e,t,(e,t)=>h(e,t,0))}function f(e,t,r){if(null==r&&(r=u()),!h(e,t,r))throw Error(`Numbers differ: actual === ${e}, expected === ${t}`);"undefined"!=typeof expect&&expect().nothing()}function h(e,t,r){return!(isFinite(e)||isFinite(t))||!(isNaN(e)||isNaN(t)||Math.abs(e-t)>r)}function m(e,t,r){for(let n=0;nr)throw Error(`Value out of range:${e[n]} low: ${t}, high: ${r}`)}function g(e,t){let r=new Float32Array(e),n=new Float32Array(t);if(r.length!==n.length)throw Error(`Expected ArrayBuffer to be of length ${n.length}, but it was ${r.length}`);for(let e=0;e{t.addEventListener("loadeddata",r=>e(t)),t.load()})}async function v(e){await e.play(),"requestVideoFrameCallback"in e&&await new Promise(t=>{e.requestVideoFrameCallback(t)})}},{"./engine":"6eJyD","./tensor_util_env":"g1Qlv","./util":"gBRMK","@parcel/transformer-js/src/esmodule-helpers.js":"9pCYc"}],"5F50h":[function(e,t,r){/** * @license * Copyright 2020 Google LLC. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. * ============================================================================= */var n=e("@parcel/transformer-js/src/esmodule-helpers.js");n.defineInteropFlag(r),n.export(r,"randomNormal",()=>i);var s=e("../util_base"),a=e("./buffer"),o=e("./operation"),l=e("./rand_util");let i=/* @__PURE__ */(0,o.op)({randomNormal_:function(e,t=0,r=1,n,o){if((0,s.assertNonNegativeIntegerDimensions)(e),null!=n&&"bool"===n)throw Error(`Unsupported data type ${n}`);let i=new l.MPRandGauss(t,r,n,!1,o),u=(0,a.buffer)(e,n);for(let e=0;eo);var s=e("./operation"),a=e("./random_normal");let o=/* @__PURE__ */(0,s.op)({randomStandardNormal_:function(e,t,r){if(null!=t&&"bool"===t)throw Error(`Unsupported data type ${t}`);return(0,a.randomNormal)(e,0,1,t,r)}})},{"./operation":"2kGjz","./random_normal":"5F50h","@parcel/transformer-js/src/esmodule-helpers.js":"9pCYc"}],gyGgn:[function(e,t,r){/** * @license * Copyright 2020 Google LLC. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. * ============================================================================= */var n=e("@parcel/transformer-js/src/esmodule-helpers.js");n.defineInteropFlag(r),n.export(r,"randomUniform",()=>i);var s=e("../util_base"),a=e("./buffer"),o=e("./operation"),l=e("./rand_util");let i=/* @__PURE__ */(0,o.op)({randomUniform_:function(e,t=0,r=1,n="float32",o){(0,s.assertNonNegativeIntegerDimensions)(e);let i=(0,a.buffer)(e,n),u=new l.UniformRandom(t,r,null,o);for(let e=0;eo);var s=e("./operation"),a=e("./random_uniform");let o=/* @__PURE__ */(0,s.op)({randomUniformInt_:function(e,t,r,n){return(0,a.randomUniform)(e,t,r,"int32",n)}})},{"./operation":"2kGjz","./random_uniform":"gyGgn","@parcel/transformer-js/src/esmodule-helpers.js":"9pCYc"}],lKSmL:[function(e,t,r){/** * @license * Copyright 2018 Google LLC. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. * ============================================================================= */var n=e("@parcel/transformer-js/src/esmodule-helpers.js");n.defineInteropFlag(r),n.export(r,"range",()=>o);var s=e("../engine"),a=e("../kernel_names");function o(e,t,r=1,n="float32"){if(0===r)throw Error("Cannot have a step of zero");return(0,s.ENGINE).runKernel(a.Range,{},{start:e,stop:t,step:r,dtype:n})}},{"../engine":"6eJyD","../kernel_names":"aqvy4","@parcel/transformer-js/src/esmodule-helpers.js":"9pCYc"}],gL38H:[function(e,t,r){/** * @license * Copyright 2020 Google LLC. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. * ============================================================================= */var n=e("@parcel/transformer-js/src/esmodule-helpers.js");n.defineInteropFlag(r),n.export(r,"real",()=>l);var s=e("../engine"),a=e("../kernel_names"),o=e("../tensor_util_env");let l=/* @__PURE__ */(0,e("./operation").op)({real_:function(e){let t=(0,o.convertToTensor)(e,"input","real");return(0,s.ENGINE).runKernel(a.Real,{input:t})}})},{"../engine":"6eJyD","../kernel_names":"aqvy4","../tensor_util_env":"g1Qlv","./operation":"2kGjz","@parcel/transformer-js/src/esmodule-helpers.js":"9pCYc"}],"889wq":[function(e,t,r){/** * @license * Copyright 2018 Google LLC. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. * ============================================================================= */var n=e("@parcel/transformer-js/src/esmodule-helpers.js");n.defineInteropFlag(r),n.export(r,"reciprocal",()=>l);var s=e("../engine"),a=e("../kernel_names"),o=e("../tensor_util_env");let l=/* @__PURE__ */(0,e("./operation").op)({reciprocal_:function(e){let t=(0,o.convertToTensor)(e,"x","reciprocal");return(0,s.ENGINE).runKernel(a.Reciprocal,{x:t})}})},{"../engine":"6eJyD","../kernel_names":"aqvy4","../tensor_util_env":"g1Qlv","./operation":"2kGjz","@parcel/transformer-js/src/esmodule-helpers.js":"9pCYc"}],cx9c3:[function(e,t,r){/** * @license * Copyright 2020 Google LLC. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. * ============================================================================= */var n=e("@parcel/transformer-js/src/esmodule-helpers.js");n.defineInteropFlag(r),n.export(r,"relu",()=>l);var s=e("../engine"),a=e("../kernel_names"),o=e("../tensor_util_env");let l=/* @__PURE__ */(0,e("./operation").op)({relu_:function(e){let t=(0,o.convertToTensor)(e,"x","relu");return(0,s.ENGINE).runKernel(a.Relu,{x:t})}})},{"../engine":"6eJyD","../kernel_names":"aqvy4","../tensor_util_env":"g1Qlv","./operation":"2kGjz","@parcel/transformer-js/src/esmodule-helpers.js":"9pCYc"}],g5u74:[function(e,t,r){/** * @license * Copyright 2020 Google LLC. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. * ============================================================================= */var n=e("@parcel/transformer-js/src/esmodule-helpers.js");n.defineInteropFlag(r),n.export(r,"relu6",()=>l);var s=e("../engine"),a=e("../kernel_names"),o=e("../tensor_util_env");let l=/* @__PURE__ */(0,e("./operation").op)({relu6_:function(e){let t=(0,o.convertToTensor)(e,"x","relu6");return(0,s.ENGINE).runKernel(a.Relu6,{x:t})}})},{"../engine":"6eJyD","../kernel_names":"aqvy4","../tensor_util_env":"g1Qlv","./operation":"2kGjz","@parcel/transformer-js/src/esmodule-helpers.js":"9pCYc"}],"6PhlD":[function(e,t,r){/** * @license * Copyright 2018 Google LLC. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. * ============================================================================= */var n=e("@parcel/transformer-js/src/esmodule-helpers.js");n.defineInteropFlag(r),n.export(r,"reverse",()=>l);var s=e("../engine"),a=e("../kernel_names"),o=e("../tensor_util_env");let l=/* @__PURE__ */(0,e("./operation").op)({reverse_:function(e,t){let r=(0,o.convertToTensor)(e,"x","reverse");return(0,s.ENGINE).runKernel(a.Reverse,{x:r},{dims:t})}})},{"../engine":"6eJyD","../kernel_names":"aqvy4","../tensor_util_env":"g1Qlv","./operation":"2kGjz","@parcel/transformer-js/src/esmodule-helpers.js":"9pCYc"}],ddJ5K:[function(e,t,r){/** * @license * Copyright 2020 Google LLC. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. * ============================================================================= */var n=e("@parcel/transformer-js/src/esmodule-helpers.js");n.defineInteropFlag(r),n.export(r,"reverse1d",()=>i);var s=e("../tensor_util_env"),a=e("../util"),o=e("./operation"),l=e("./reverse");let i=/* @__PURE__ */(0,o.op)({reverse1d_:function(e){let t=(0,s.convertToTensor)(e,"x","reverse");return a.assert(1===t.rank,()=>`Error in reverse1D: x must be rank 1 but got rank ${t.rank}.`),(0,l.reverse)(t,0)}})},{"../tensor_util_env":"g1Qlv","../util":"gBRMK","./operation":"2kGjz","./reverse":"6PhlD","@parcel/transformer-js/src/esmodule-helpers.js":"9pCYc"}],e5ICP:[function(e,t,r){/** * @license * Copyright 2020 Google LLC. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. * ============================================================================= */var n=e("@parcel/transformer-js/src/esmodule-helpers.js");n.defineInteropFlag(r),n.export(r,"reverse2d",()=>i);var s=e("../tensor_util_env"),a=e("../util"),o=e("./operation"),l=e("./reverse");let i=/* @__PURE__ */(0,o.op)({reverse2d_:function(e,t){let r=(0,s.convertToTensor)(e,"x","reverse");return a.assert(2===r.rank,()=>`Error in reverse2D: x must be rank 2 but got rank ${r.rank}.`),(0,l.reverse)(r,t)}})},{"../tensor_util_env":"g1Qlv","../util":"gBRMK","./operation":"2kGjz","./reverse":"6PhlD","@parcel/transformer-js/src/esmodule-helpers.js":"9pCYc"}],ap92w:[function(e,t,r){/** * @license * Copyright 2020 Google LLC. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. * ============================================================================= */var n=e("@parcel/transformer-js/src/esmodule-helpers.js");n.defineInteropFlag(r),n.export(r,"reverse3d",()=>i);var s=e("../tensor_util_env"),a=e("../util"),o=e("./operation"),l=e("./reverse");let i=/* @__PURE__ */(0,o.op)({reverse3d_:function(e,t){let r=(0,s.convertToTensor)(e,"x","reverse");return a.assert(3===r.rank,()=>`Error in reverse3D: x must be rank 3 but got rank ${r.rank}.`),(0,l.reverse)(r,t)}})},{"../tensor_util_env":"g1Qlv","../util":"gBRMK","./operation":"2kGjz","./reverse":"6PhlD","@parcel/transformer-js/src/esmodule-helpers.js":"9pCYc"}],"3Dxlb":[function(e,t,r){/** * @license * Copyright 2020 Google LLC. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. * ============================================================================= */var n=e("@parcel/transformer-js/src/esmodule-helpers.js");n.defineInteropFlag(r),n.export(r,"reverse4d",()=>i);var s=e("../tensor_util_env"),a=e("../util"),o=e("./operation"),l=e("./reverse");let i=/* @__PURE__ */(0,o.op)({reverse4d_:function(e,t){let r=(0,s.convertToTensor)(e,"x","reverse");return a.assert(4===r.rank,()=>`Error in reverse4D: x must be rank 4 but got rank ${r.rank}.`),(0,l.reverse)(r,t)}})},{"../tensor_util_env":"g1Qlv","../util":"gBRMK","./operation":"2kGjz","./reverse":"6PhlD","@parcel/transformer-js/src/esmodule-helpers.js":"9pCYc"}],fNSi1:[function(e,t,r){/** * @license * Copyright 2018 Google LLC. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. * ============================================================================= */var n=e("@parcel/transformer-js/src/esmodule-helpers.js");n.defineInteropFlag(r),n.export(r,"round",()=>l);var s=e("../engine"),a=e("../kernel_names"),o=e("../tensor_util_env");let l=/* @__PURE__ */(0,e("./operation").op)({round_:function(e){let t=(0,o.convertToTensor)(e,"x","round");return(0,s.ENGINE).runKernel(a.Round,{x:t})}})},{"../engine":"6eJyD","../kernel_names":"aqvy4","../tensor_util_env":"g1Qlv","./operation":"2kGjz","@parcel/transformer-js/src/esmodule-helpers.js":"9pCYc"}],"6fl2z":[function(e,t,r){/** * @license * Copyright 2018 Google LLC. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. * ============================================================================= */var n=e("@parcel/transformer-js/src/esmodule-helpers.js");n.defineInteropFlag(r),n.export(r,"rsqrt",()=>l);var s=e("../engine"),a=e("../kernel_names"),o=e("../tensor_util_env");let l=/* @__PURE__ */(0,e("./operation").op)({rsqrt_:function(e){let t=(0,o.convertToTensor)(e,"x","rsqrt","float32");return(0,s.ENGINE).runKernel(a.Rsqrt,{x:t})}})},{"../engine":"6eJyD","../kernel_names":"aqvy4","../tensor_util_env":"g1Qlv","./operation":"2kGjz","@parcel/transformer-js/src/esmodule-helpers.js":"9pCYc"}],"854kD":[function(e,t,r){/** * @license * Copyright 2020 Google LLC. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. * ============================================================================= */var n=e("@parcel/transformer-js/src/esmodule-helpers.js");n.defineInteropFlag(r),n.export(r,"selu",()=>l);var s=e("../engine"),a=e("../kernel_names"),o=e("../tensor_util_env");let l=/* @__PURE__ */(0,e("./operation").op)({selu_:function(e){let t=(0,o.convertToTensor)(e,"x","selu");return(0,s.ENGINE).runKernel(a.Selu,{x:t})}})},{"../engine":"6eJyD","../kernel_names":"aqvy4","../tensor_util_env":"g1Qlv","./operation":"2kGjz","@parcel/transformer-js/src/esmodule-helpers.js":"9pCYc"}],g9xim:[function(e,t,r){var n=e("@parcel/transformer-js/src/esmodule-helpers.js");n.defineInteropFlag(r),n.export(r,"separableConv2d",()=>p);var s=e("../tensor_util_env"),a=e("../util"),o=e("./conv2d"),l=e("./depthwise_conv2d"),i=e("./operation"),u=e("./reshape");let p=/* @__PURE__ */(0,i.op)({separableConv2d_:function(e,t,r,n,i,p=[1,1],c="NHWC"){let d=(0,s.convertToTensor)(e,"x","separableConv2d"),f=(0,s.convertToTensor)(t,"depthwiseFilter","separableConv2d"),h=(0,s.convertToTensor)(r,"pointwiseFilter","separableConv2d"),m=d,g=!1;if(3===d.rank&&(g=!0,m=(0,u.reshape)(d,[1,d.shape[0],d.shape[1],d.shape[2]])),"NCHW"===c)throw Error("separableConv2d currently does not support dataFormat NCHW; only NHWC is supported");a.assert(4===m.rank,()=>`Error in separableConv2d: input must be rank 4, but got rank ${m.rank}.`),a.assert(4===f.rank,()=>`Error in separableConv2d: depthwise filter must be rank 4, but got rank ${f.rank}.`),a.assert(4===h.rank,()=>`Error in separableConv2d: pointwise filter must be rank 4, but got rank ${f.rank}.`),a.assert(1===h.shape[0],()=>`Error in separableConv2d: the first dimension of pointwise filter must be 1, but got ${h.shape[0]}.`),a.assert(1===h.shape[1],()=>`Error in separableConv2d: the second dimension of pointwise filter must be 1, but got ${h.shape[1]}.`);let x=f.shape[2],v=f.shape[3];a.assert(h.shape[2]===x*v,()=>`Error in separableConv2d: the third dimension of pointwise filter must be ${x*v}, but got ${h.shape[2]}.`);let y=(0,l.depthwiseConv2d)(m,f,n,i,c,p),b=(0,o.conv2d)(y,h,1,"valid",c);return g?(0,u.reshape)(b,[b.shape[1],b.shape[2],b.shape[3]]):b}})},{"../tensor_util_env":"g1Qlv","../util":"gBRMK","./conv2d":"59r1a","./depthwise_conv2d":"kLAtV","./operation":"2kGjz","./reshape":"VuY4S","@parcel/transformer-js/src/esmodule-helpers.js":"9pCYc"}],"3esgH":[function(e,t,r){/** * @license * Copyright 2020 Google Inc. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. * ============================================================================= */var n=e("@parcel/transformer-js/src/esmodule-helpers.js");n.defineInteropFlag(r),n.export(r,"setdiff1dAsync",()=>l);var s=e("../tensor"),a=e("../tensor_util_env"),o=e("../util");let l=async function(e,t){let r=(0,a.convertToTensor)(e,"x","setdiff1d"),n=(0,a.convertToTensor)(t,"y","setdiff1d");o.assert(r.dtype===n.dtype,()=>`x and y should have the same dtype, but got x (${r.dtype}) and y (${n.dtype}).`),o.assert(1===r.rank,()=>`x should be 1D tensor, but got x (${r.shape}).`),o.assert(1===n.rank,()=>`y should be 1D tensor, but got y (${n.shape}).`);let l=await r.data(),i=new Set(await n.data()),u=0;for(let e=0;el);var s=e("../engine"),a=e("../kernel_names"),o=e("../tensor_util_env");let l=/* @__PURE__ */(0,e("./operation").op)({sign_:function(e){let t=(0,o.convertToTensor)(e,"x","sign");return(0,s.ENGINE).runKernel(a.Sign,{x:t})}})},{"../engine":"6eJyD","../kernel_names":"aqvy4","../tensor_util_env":"g1Qlv","./operation":"2kGjz","@parcel/transformer-js/src/esmodule-helpers.js":"9pCYc"}],"4qLCn":[function(e,t,r){/** * @license * Copyright 2018 Google LLC. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. * ============================================================================= */var n=e("@parcel/transformer-js/src/esmodule-helpers.js");n.defineInteropFlag(r),n.export(r,"sin",()=>l);var s=e("../engine"),a=e("../kernel_names"),o=e("../tensor_util_env");let l=/* @__PURE__ */(0,e("./operation").op)({sin_:function(e){let t=(0,o.convertToTensor)(e,"x","sin","float32");return(0,s.ENGINE).runKernel(a.Sin,{x:t})}})},{"../engine":"6eJyD","../kernel_names":"aqvy4","../tensor_util_env":"g1Qlv","./operation":"2kGjz","@parcel/transformer-js/src/esmodule-helpers.js":"9pCYc"}],bnveM:[function(e,t,r){/** * @license * Copyright 2018 Google LLC. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. * ============================================================================= */var n=e("@parcel/transformer-js/src/esmodule-helpers.js");n.defineInteropFlag(r),n.export(r,"sinh",()=>l);var s=e("../engine"),a=e("../kernel_names"),o=e("../tensor_util_env");let l=/* @__PURE__ */(0,e("./operation").op)({sinh_:function(e){let t=(0,o.convertToTensor)(e,"x","sinh");return(0,s.ENGINE).runKernel(a.Sinh,{x:t})}})},{"../engine":"6eJyD","../kernel_names":"aqvy4","../tensor_util_env":"g1Qlv","./operation":"2kGjz","@parcel/transformer-js/src/esmodule-helpers.js":"9pCYc"}],"1ya8P":[function(e,t,r){/** * @license * Copyright 2018 Google LLC. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. * ============================================================================= */var n=e("@parcel/transformer-js/src/esmodule-helpers.js");n.defineInteropFlag(r),n.export(r,"slice1d",()=>i);var s=e("../tensor_util_env"),a=e("../util"),o=e("./operation"),l=e("./slice");let i=/* @__PURE__ */(0,o.op)({slice1d_:function(e,t,r){let n=(0,s.convertToTensor)(e,"x","slice1d");return a.assert(1===n.rank,()=>`slice1d expects a rank-1 tensor, but got a rank-${n.rank} tensor`),(0,l.slice)(n,[t],[r])}})},{"../tensor_util_env":"g1Qlv","../util":"gBRMK","./operation":"2kGjz","./slice":"cjlcK","@parcel/transformer-js/src/esmodule-helpers.js":"9pCYc"}],ifCCa:[function(e,t,r){/** * @license * Copyright 2018 Google LLC. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. * ============================================================================= */var n=e("@parcel/transformer-js/src/esmodule-helpers.js");n.defineInteropFlag(r),n.export(r,"slice2d",()=>i);var s=e("../tensor_util_env"),a=e("../util"),o=e("./operation"),l=e("./slice");let i=/* @__PURE__ */(0,o.op)({slice2d_:function(e,t,r){let n=(0,s.convertToTensor)(e,"x","slice2d");return a.assert(2===n.rank,()=>`slice2d expects a rank-2 tensor, but got a rank-${n.rank} tensor`),(0,l.slice)(n,t,r)}})},{"../tensor_util_env":"g1Qlv","../util":"gBRMK","./operation":"2kGjz","./slice":"cjlcK","@parcel/transformer-js/src/esmodule-helpers.js":"9pCYc"}],iJ1Vg:[function(e,t,r){/** * @license * Copyright 2018 Google LLC. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. * ============================================================================= */var n=e("@parcel/transformer-js/src/esmodule-helpers.js");n.defineInteropFlag(r),n.export(r,"slice3d",()=>i);var s=e("../tensor_util_env"),a=e("../util"),o=e("./operation"),l=e("./slice");let i=/* @__PURE__ */(0,o.op)({slice3d_:function(e,t,r){let n=(0,s.convertToTensor)(e,"x","slice3d");return a.assert(3===n.rank,()=>`slice3d expects a rank-3 tensor, but got a rank-${n.rank} tensor`),(0,l.slice)(n,t,r)}})},{"../tensor_util_env":"g1Qlv","../util":"gBRMK","./operation":"2kGjz","./slice":"cjlcK","@parcel/transformer-js/src/esmodule-helpers.js":"9pCYc"}],asX0D:[function(e,t,r){/** * @license * Copyright 2018 Google LLC. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. * ============================================================================= */var n=e("@parcel/transformer-js/src/esmodule-helpers.js");n.defineInteropFlag(r),n.export(r,"slice4d",()=>i);var s=e("../tensor_util_env"),a=e("../util"),o=e("./operation"),l=e("./slice");let i=/* @__PURE__ */(0,o.op)({slice4d_:function(e,t,r){let n=(0,s.convertToTensor)(e,"x","slice4d");return a.assert(4===n.rank,()=>`slice4d expects a rank-4 tensor, but got a rank-${n.rank} tensor`),(0,l.slice)(n,t,r)}})},{"../tensor_util_env":"g1Qlv","../util":"gBRMK","./operation":"2kGjz","./slice":"cjlcK","@parcel/transformer-js/src/esmodule-helpers.js":"9pCYc"}],"1slpr":[function(e,t,r){/** * @license * Copyright 2018 Google LLC. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. * ============================================================================= */var n=e("@parcel/transformer-js/src/esmodule-helpers.js");n.defineInteropFlag(r),n.export(r,"softmax",()=>l);var s=e("../engine"),a=e("../kernel_names"),o=e("../tensor_util_env");let l=/* @__PURE__ */(0,e("./operation").op)({softmax_:function(e,t=-1){let r=(0,o.convertToTensor)(e,"logits","softmax","float32");if(-1===t&&(t=r.rank-1),t!==r.rank-1)throw Error(`Softmax along a non-last dimension is not yet supported. Logits was rank ${r.rank} and dim was ${t}`);let n={dim:t};return(0,s.ENGINE).runKernel(a.Softmax,{logits:r},n)}})},{"../engine":"6eJyD","../kernel_names":"aqvy4","../tensor_util_env":"g1Qlv","./operation":"2kGjz","@parcel/transformer-js/src/esmodule-helpers.js":"9pCYc"}],kA5mr:[function(e,t,r){/** * @license * Copyright 2020 Google LLC. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. * ============================================================================= */var n=e("@parcel/transformer-js/src/esmodule-helpers.js");n.defineInteropFlag(r),n.export(r,"fft",()=>l);var s=e("../../engine"),a=e("../../kernel_names"),o=e("../../util");let l=/* @__PURE__ */(0,e("../operation").op)({fft_:function(e){return(0,o.assert)("complex64"===e.dtype,()=>`The dtype for tf.spectral.fft() must be complex64 but got ${e.dtype}.`),(0,s.ENGINE).runKernel(a.FFT,{input:e})}})},{"../../engine":"6eJyD","../../kernel_names":"aqvy4","../../util":"gBRMK","../operation":"2kGjz","@parcel/transformer-js/src/esmodule-helpers.js":"9pCYc"}],"40Lhz":[function(e,t,r){/** * @license * Copyright 2020 Google LLC. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. * ============================================================================= */var n=e("@parcel/transformer-js/src/esmodule-helpers.js");n.defineInteropFlag(r),n.export(r,"ifft",()=>l);var s=e("../../engine"),a=e("../../kernel_names"),o=e("../../util");let l=/* @__PURE__ */(0,e("../operation").op)({ifft_:function(e){return(0,o.assert)("complex64"===e.dtype,()=>`The dtype for tf.spectral.ifft() must be complex64 but got ${e.dtype}.`),(0,s.ENGINE).runKernel(a.IFFT,{input:e})}})},{"../../engine":"6eJyD","../../kernel_names":"aqvy4","../../util":"gBRMK","../operation":"2kGjz","@parcel/transformer-js/src/esmodule-helpers.js":"9pCYc"}],"8apyy":[function(e,t,r){/** * @license * Copyright 2018 Google LLC. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. * ============================================================================= */var n=e("@parcel/transformer-js/src/esmodule-helpers.js");n.defineInteropFlag(r),n.export(r,"irfft",()=>m);var s=e("../complex"),a=e("../concat"),o=e("../imag"),l=e("../mul"),i=e("../operation"),u=e("../real"),p=e("../reshape"),c=e("../reverse"),d=e("../scalar"),f=e("../slice"),h=e("./ifft");let m=/* @__PURE__ */(0,i.op)({irfft_:function(e){let t;let r=e.shape[e.shape.length-1],n=e.size/r;if(r<=2){let s=(0,p.reshape)(e,[n,r]);t=(0,h.ifft)(s)}else{let i=[n,2*(r-1)],m=(0,p.reshape)((0,u.real)(e),[n,r]),g=(0,p.reshape)((0,o.imag)(e),[n,r]),x=(0,c.reverse)((0,f.slice)(m,[0,1],[n,r-2]),1),v=(0,l.mul)((0,c.reverse)((0,f.slice)(g,[0,1],[n,r-2]),1),(0,d.scalar)(-1)),y=(0,a.concat)([m,x],1),b=(0,a.concat)([g,v],1),_=(0,p.reshape)((0,s.complex)(y,b),[i[0],i[1]]);t=(0,h.ifft)(_)}if(t=(0,u.real)(t),3===e.rank&&0!==e.shape[0]){let r=t,n=e.shape[0];t=(0,p.reshape)(t,[n,t.shape[0]/n,t.shape[1]]),r.dispose()}return t}})},{"../complex":"98mI6","../concat":"aQPCM","../imag":"2YwxX","../mul":"gPetX","../operation":"2kGjz","../real":"gL38H","../reshape":"VuY4S","../reverse":"6PhlD","../scalar":"53j04","../slice":"cjlcK","./ifft":"40Lhz","@parcel/transformer-js/src/esmodule-helpers.js":"9pCYc"}],enYFV:[function(e,t,r){/** * @license * Copyright 2018 Google LLC. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. * ============================================================================= */var n=e("@parcel/transformer-js/src/esmodule-helpers.js");n.defineInteropFlag(r),n.export(r,"rfft",()=>g);var s=e("../../util"),a=e("../complex"),o=e("../concat"),l=e("../imag"),i=e("../operation"),u=e("../real"),p=e("../reshape"),c=e("../slice"),d=e("../split"),f=e("../zeros"),h=e("../zeros_like"),m=e("./fft");let g=/* @__PURE__ */(0,i.op)({rfft_:function(e,t){let r;(0,s.assert)("float32"===e.dtype,()=>`The dtype for rfft() must be real value but got ${e.dtype}`);let n=e.shape[e.shape.length-1],i=e.size/n;if(null!=t&&t0),a=e.shape.map(e=>e);a[e.shape.length-1]=t,r=(0,c.slice)(e,s,a),n=t}else if(null!=t&&t>n){let s=e.shape.map(e=>e);s[e.shape.length-1]=t-n,r=(0,o.concat)([e,(0,f.zeros)(s)],e.shape.length-1),n=t}else r=e;let g=(0,h.zerosLike)(r),x=(0,p.reshape)((0,a.complex)(r,g),[i,n]),v=(0,m.fft)(x),y=Math.floor(n/2)+1,b=(0,u.real)(v),_=(0,l.imag)(v),k=(0,d.split)(b,[y,n-y],b.shape.length-1),j=(0,d.split)(_,[y,n-y],_.shape.length-1),I=r.shape.slice();return I[r.shape.length-1]=y,(0,p.reshape)((0,a.complex)(k[0],j[0]),I)}})},{"../../util":"gBRMK","../complex":"98mI6","../concat":"aQPCM","../imag":"2YwxX","../operation":"2kGjz","../real":"gL38H","../reshape":"VuY4S","../slice":"cjlcK","../split":"xglNu","../zeros":"1YDK1","../zeros_like":"gjKam","./fft":"kA5mr","@parcel/transformer-js/src/esmodule-helpers.js":"9pCYc"}],xglNu:[function(e,t,r){/** * @license * Copyright 2020 Google LLC. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. * ============================================================================= */var n=e("@parcel/transformer-js/src/esmodule-helpers.js");n.defineInteropFlag(r),n.export(r,"split",()=>l);var s=e("../engine"),a=e("../kernel_names"),o=e("../tensor_util_env");let l=/* @__PURE__ */(0,e("./operation").op)({split_:function(e,t,r=0){let n=(0,o.convertToTensor)(e,"x","split");return(0,s.ENGINE).runKernel(a.SplitV,{x:n},{numOrSizeSplits:t,axis:r})}})},{"../engine":"6eJyD","../kernel_names":"aqvy4","../tensor_util_env":"g1Qlv","./operation":"2kGjz","@parcel/transformer-js/src/esmodule-helpers.js":"9pCYc"}],ktglY:[function(e,t,r){/** * @license * Copyright 2020 Google LLC. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. * ============================================================================= */var n=e("@parcel/transformer-js/src/esmodule-helpers.js");n.defineInteropFlag(r),n.export(r,"squaredDifference",()=>u);var s=e("../engine"),a=e("../kernel_names"),o=e("../tensor_util"),l=e("../tensor_util_env"),i=e("./broadcast_util");let u=/* @__PURE__ */(0,e("./operation").op)({squaredDifference_:function(e,t){let r=(0,l.convertToTensor)(e,"a","squaredDifference"),n=(0,l.convertToTensor)(t,"b","squaredDifference");[r,n]=(0,o.makeTypesMatch)(r,n),(0,i.assertAndGetBroadcastShape)(r.shape,n.shape);let u={a:r,b:n};return(0,s.ENGINE).runKernel(a.SquaredDifference,u,{})}})},{"../engine":"6eJyD","../kernel_names":"aqvy4","../tensor_util":"jgr40","../tensor_util_env":"g1Qlv","./broadcast_util":"aouH8","./operation":"2kGjz","@parcel/transformer-js/src/esmodule-helpers.js":"9pCYc"}],"8ELtY":[function(e,t,r){/** * @license * Copyright 2020 Google LLC. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. * ============================================================================= */var n=e("@parcel/transformer-js/src/esmodule-helpers.js");n.defineInteropFlag(r),n.export(r,"squeeze",()=>i);var s=e("../tensor_util_env"),a=e("../util"),o=e("./operation"),l=e("./reshape");let i=/* @__PURE__ */(0,o.op)({squeeze_:function(e,t){let r=(0,s.convertToTensor)(e,"x","squeeze","string_or_numeric");return(0,l.reshape)(r,(0,a.squeezeShape)(r.shape,t).newShape)}})},{"../tensor_util_env":"g1Qlv","../util":"gBRMK","./operation":"2kGjz","./reshape":"VuY4S","@parcel/transformer-js/src/esmodule-helpers.js":"9pCYc"}],gM8I8:[function(e,t,r){/** * @license * Copyright 2020 Google LLC. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. * ============================================================================= */var n=e("@parcel/transformer-js/src/esmodule-helpers.js");n.defineInteropFlag(r),n.export(r,"stack",()=>i);var s=e("../engine"),a=e("../kernel_names"),o=e("../tensor_util_env"),l=e("../util");let i=/* @__PURE__ */(0,e("./operation").op)({stack_:function(e,t=0){let r=(0,o.convertToTensorArray)(e,"tensors","stack","string_or_numeric");return l.assert(r.length>=1,()=>"Pass at least one tensor to tf.stack"),r.length>0&&l.assert(t<=r[0].rank,()=>"Axis must be<= rank of the tensor"),(0,s.ENGINE).runKernel(a.Pack,r,{axis:t})}})},{"../engine":"6eJyD","../kernel_names":"aqvy4","../tensor_util_env":"g1Qlv","../util":"gBRMK","./operation":"2kGjz","@parcel/transformer-js/src/esmodule-helpers.js":"9pCYc"}],"2cIA8":[function(e,t,r){/** * @license * Copyright 2018 Google LLC. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. * ============================================================================= */var n=e("@parcel/transformer-js/src/esmodule-helpers.js");n.defineInteropFlag(r),n.export(r,"step",()=>l);var s=e("../engine"),a=e("../kernel_names"),o=e("../tensor_util_env");let l=/* @__PURE__ */(0,e("./operation").op)({step_:function(e,t=0){let r=(0,o.convertToTensor)(e,"x","step");return(0,s.ENGINE).runKernel(a.Step,{x:r},{alpha:t})}})},{"../engine":"6eJyD","../kernel_names":"aqvy4","../tensor_util_env":"g1Qlv","./operation":"2kGjz","@parcel/transformer-js/src/esmodule-helpers.js":"9pCYc"}],"4HYaV":[function(e,t,r){/** * @license * Copyright 2018 Google LLC. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. * ============================================================================= */var n=e("@parcel/transformer-js/src/esmodule-helpers.js");n.defineInteropFlag(r),n.export(r,"stridedSlice",()=>l);var s=e("../engine"),a=e("../kernel_names"),o=e("../tensor_util_env");let l=/* @__PURE__ */(0,e("./operation").op)({stridedSlice_:function(e,t,r,n,l=0,i=0,u=0,p=0,c=0){let d=(0,o.convertToTensor)(e,"x","stridedSlice","string_or_numeric");return(0,s.ENGINE).runKernel(a.StridedSlice,{x:d},{begin:t,end:r,strides:n,beginMask:l,endMask:i,ellipsisMask:u,newAxisMask:p,shrinkAxisMask:c})}})},{"../engine":"6eJyD","../kernel_names":"aqvy4","../tensor_util_env":"g1Qlv","./operation":"2kGjz","@parcel/transformer-js/src/esmodule-helpers.js":"9pCYc"}],"6U5oZ":[function(e,t,r){/** * @license * Copyright 2018 Google LLC. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. * ============================================================================= */var n=e("@parcel/transformer-js/src/esmodule-helpers.js");n.defineInteropFlag(r),n.export(r,"tan",()=>l);var s=e("../engine"),a=e("../kernel_names"),o=e("../tensor_util_env");let l=/* @__PURE__ */(0,e("./operation").op)({tan_:function(e){let t=(0,o.convertToTensor)(e,"x","tan","float32");return(0,s.ENGINE).runKernel(a.Tan,{x:t})}})},{"../engine":"6eJyD","../kernel_names":"aqvy4","../tensor_util_env":"g1Qlv","./operation":"2kGjz","@parcel/transformer-js/src/esmodule-helpers.js":"9pCYc"}],j8r4R:[function(e,t,r){/** * @license * Copyright 2018 Google LLC. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. * ============================================================================= */var n=e("@parcel/transformer-js/src/esmodule-helpers.js");n.defineInteropFlag(r),n.export(r,"tensor1d",()=>l);var s=e("../tensor_util_env"),a=e("../util"),o=e("./tensor_ops_util");function l(e,t){(0,a.assertNonNull)(e);let r=(0,s.inferShape)(e,t);if(1!==r.length)throw Error("tensor1d() requires values to be a flat/TypedArray");return(0,o.makeTensor)(e,null,r,t)}},{"../tensor_util_env":"g1Qlv","../util":"gBRMK","./tensor_ops_util":"c7cet","@parcel/transformer-js/src/esmodule-helpers.js":"9pCYc"}],anm7F:[function(e,t,r){/** * @license * Copyright 2018 Google LLC. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. * ============================================================================= */var n=e("@parcel/transformer-js/src/esmodule-helpers.js");n.defineInteropFlag(r),n.export(r,"tensor2d",()=>l);var s=e("../tensor_util_env"),a=e("../util"),o=e("./tensor_ops_util");function l(e,t,r){if((0,a.assertNonNull)(e),null!=t&&2!==t.length)throw Error("tensor2d() requires shape to have two numbers");let n=(0,s.inferShape)(e,r);if(2!==n.length&&1!==n.length)throw Error("tensor2d() requires values to be number[][] or flat/TypedArray");if(1===n.length&&null==t)throw Error("tensor2d() requires shape to be provided when `values` are a flat/TypedArray");return(0,o.makeTensor)(e,t,n,r)}},{"../tensor_util_env":"g1Qlv","../util":"gBRMK","./tensor_ops_util":"c7cet","@parcel/transformer-js/src/esmodule-helpers.js":"9pCYc"}],fN8Yq:[function(e,t,r){/** * @license * Copyright 2018 Google LLC. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. * ============================================================================= */var n=e("@parcel/transformer-js/src/esmodule-helpers.js");n.defineInteropFlag(r),n.export(r,"tensor3d",()=>l);var s=e("../tensor_util_env"),a=e("../util"),o=e("./tensor_ops_util");function l(e,t,r){if((0,a.assertNonNull)(e),null!=t&&3!==t.length)throw Error("tensor3d() requires shape to have three numbers");let n=(0,s.inferShape)(e,r);if(3!==n.length&&1!==n.length)throw Error("tensor3d() requires values to be number[][][] or flat/TypedArray");if(1===n.length&&null==t)throw Error("tensor3d() requires shape to be provided when `values` are a flat array");return(0,o.makeTensor)(e,t,n,r)}},{"../tensor_util_env":"g1Qlv","../util":"gBRMK","./tensor_ops_util":"c7cet","@parcel/transformer-js/src/esmodule-helpers.js":"9pCYc"}],"5i3cW":[function(e,t,r){/** * @license * Copyright 2018 Google LLC. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. * ============================================================================= */var n=e("@parcel/transformer-js/src/esmodule-helpers.js");n.defineInteropFlag(r),n.export(r,"tensor4d",()=>l);var s=e("../tensor_util_env"),a=e("../util"),o=e("./tensor_ops_util");function l(e,t,r){if((0,a.assertNonNull)(e),null!=t&&4!==t.length)throw Error("tensor4d() requires shape to have four numbers");let n=(0,s.inferShape)(e,r);if(4!==n.length&&1!==n.length)throw Error("tensor4d() requires values to be number[][][][] or flat/TypedArray");if(1===n.length&&null==t)throw Error("tensor4d() requires shape to be provided when `values` are a flat array");return(0,o.makeTensor)(e,t,n,r)}},{"../tensor_util_env":"g1Qlv","../util":"gBRMK","./tensor_ops_util":"c7cet","@parcel/transformer-js/src/esmodule-helpers.js":"9pCYc"}],jQ0Mp:[function(e,t,r){/** * @license * Copyright 2018 Google LLC. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. * ============================================================================= */var n=e("@parcel/transformer-js/src/esmodule-helpers.js");n.defineInteropFlag(r),n.export(r,"tensor5d",()=>l);var s=e("../tensor_util_env"),a=e("../util"),o=e("./tensor_ops_util");function l(e,t,r){if((0,a.assertNonNull)(e),null!=t&&5!==t.length)throw Error("tensor5d() requires shape to have five numbers");let n=(0,s.inferShape)(e,r);if(5!==n.length&&1!==n.length)throw Error("tensor5d() requires values to be number[][][][][] or flat/TypedArray");if(1===n.length&&null==t)throw Error("tensor5d() requires shape to be provided when `values` are a flat array");return(0,o.makeTensor)(e,t,n,r)}},{"../tensor_util_env":"g1Qlv","../util":"gBRMK","./tensor_ops_util":"c7cet","@parcel/transformer-js/src/esmodule-helpers.js":"9pCYc"}],fj5AK:[function(e,t,r){/** * @license * Copyright 2018 Google LLC. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. * ============================================================================= */var n=e("@parcel/transformer-js/src/esmodule-helpers.js");n.defineInteropFlag(r),n.export(r,"tensor6d",()=>l);var s=e("../tensor_util_env"),a=e("../util"),o=e("./tensor_ops_util");function l(e,t,r){if((0,a.assertNonNull)(e),null!=t&&6!==t.length)throw Error("tensor6d() requires shape to have six numbers");let n=(0,s.inferShape)(e,r);if(6!==n.length&&1!==n.length)throw Error("tensor6d() requires values to be number[][][][][][] or flat/TypedArray");if(1===n.length&&null==t)throw Error("tensor6d() requires shape to be provided when `values` are a flat array");return t=t||n,(0,o.makeTensor)(e,t,n,r)}},{"../tensor_util_env":"g1Qlv","../util":"gBRMK","./tensor_ops_util":"c7cet","@parcel/transformer-js/src/esmodule-helpers.js":"9pCYc"}],fh20S:[function(e,t,r){/** * @license * Copyright 2022 Google LLC. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. * ============================================================================= */var n=e("@parcel/transformer-js/src/esmodule-helpers.js");n.defineInteropFlag(r),n.export(r,"tensorScatterUpdate",()=>u);var s=e("../engine"),a=e("../kernel_names"),o=e("../tensor_util_env"),l=e("./operation"),i=e("./scatter_nd_util");let u=(0,l.op)({tensorScatterUpdate_:function(e,t,r){let n=(0,o.convertToTensor)(e,"tensor","tensorScatterupdate"),l=(0,o.convertToTensor)(t,"indices","tensorScatterupdate","int32"),u=(0,o.convertToTensor)(r,"updates","tensorScatterupdate");if(i.validateInput(u,l,n.shape),n.dtype!==u.dtype)throw Error(`tensor and updates must have the same dtype, instead they are ${n.dtype} and ${u.dtype}.`);return(0,s.ENGINE).runKernel(a.TensorScatterUpdate,{tensor:n,indices:l,updates:u},{})}})},{"../engine":"6eJyD","../kernel_names":"aqvy4","../tensor_util_env":"g1Qlv","./operation":"2kGjz","./scatter_nd_util":"1SOU1","@parcel/transformer-js/src/esmodule-helpers.js":"9pCYc"}],"1SOU1":[function(e,t,r){var n=e("@parcel/transformer-js/src/esmodule-helpers.js");n.defineInteropFlag(r),n.export(r,"validateUpdateShape",()=>a),n.export(r,"validateInput",()=>o),n.export(r,"calculateShapes",()=>l);var s=e("../util");function a(e,t,r){let n=t.rank>1?t.shape[t.rank-1]:1,s=t.rank>1?t.rank-1:1,a=`Must have updates.shape = indices.shape[:batchDim] + shape[sliceDim:], got updates.shape: ${r.shape}, indices.shape: ${t.shape}, shape: ${e}, sliceDim: ${n}, and batchDim: ${s}.`;if(r.rank1?t.shape[n-1]:1,o=r.length,l=1;for(let e=a;el);var s=e("../engine"),a=e("../kernel_names"),o=e("../tensor_util_env");let l=/* @__PURE__ */(0,e("./operation").op)({topk_:function(e,t=1,r=!0){let n=(0,o.convertToTensor)(e,"x","topk");if(0===n.rank)throw Error("topk() expects the input to be of rank 1 or higher");let l=n.shape[n.shape.length-1];if(t<0)throw Error(`'k' passed to topk() must be >= 0 but got ${t}`);if(t>l)throw Error(`'k' passed to topk() must be<= the last dimension (${l}) but got ${t}`);let[i,u]=(0,s.ENGINE).runKernel(a.TopK,{x:n},{k:t,sorted:r});return{values:i,indices:u}}})},{"../engine":"6eJyD","../kernel_names":"aqvy4","../tensor_util_env":"g1Qlv","./operation":"2kGjz","@parcel/transformer-js/src/esmodule-helpers.js":"9pCYc"}],"64b7J":[function(e,t,r){/** * @license * Copyright 2020 Google LLC. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. * ============================================================================= */var n=e("@parcel/transformer-js/src/esmodule-helpers.js");n.defineInteropFlag(r),n.export(r,"truncatedNormal",()=>i);var s=e("../util_base"),a=e("./buffer"),o=e("./operation"),l=e("./rand_util");let i=/* @__PURE__ */(0,o.op)({truncatedNormal_:function(e,t=0,r=1,n,o){if((0,s.assertNonNegativeIntegerDimensions)(e),null!=n&&"bool"===n)throw Error("Unsupported data type $ { dtype }");let i=new l.MPRandGauss(t,r,n,!0,o),u=(0,a.buffer)(e,n);for(let e=0;ei);var s=e("../engine"),a=e("../kernel_names"),o=e("../tensor_util_env"),l=e("../util");let i=/* @__PURE__ */(0,e("./operation").op)({unique_:function(e,t=0){let r=(0,o.convertToTensor)(e,"x","unique","string_or_numeric");(0,l.assert)(r.rank>0,()=>"The input tensor must be at least 1D");let[n,i]=(0,s.ENGINE).runKernel(a.Unique,{x:r},{axis:t});return{values:n,indices:i}}})},{"../engine":"6eJyD","../kernel_names":"aqvy4","../tensor_util_env":"g1Qlv","../util":"gBRMK","./operation":"2kGjz","@parcel/transformer-js/src/esmodule-helpers.js":"9pCYc"}],ijbzG:[function(e,t,r){/** * @license * Copyright 2020 Google LLC. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. * ============================================================================= */var n=e("@parcel/transformer-js/src/esmodule-helpers.js");n.defineInteropFlag(r),n.export(r,"unsortedSegmentSum",()=>i);var s=e("../engine"),a=e("../kernel_names"),o=e("../tensor_util_env"),l=e("../util");let i=/* @__PURE__ */(0,e("./operation").op)({unsortedSegmentSum_:function(e,t,r){let n=(0,o.convertToTensor)(e,"x","unsortedSegmentSum"),i=(0,o.convertToTensor)(t,"segmentIds","unsortedSegmentSum","int32");return(0,l.assert)((0,l.isInt)(r),()=>"numSegments must be of dtype int"),(0,s.ENGINE).runKernel(a.UnsortedSegmentSum,{x:n,segmentIds:i},{numSegments:r})}})},{"../engine":"6eJyD","../kernel_names":"aqvy4","../tensor_util_env":"g1Qlv","../util":"gBRMK","./operation":"2kGjz","@parcel/transformer-js/src/esmodule-helpers.js":"9pCYc"}],"7lgSS":[function(e,t,r){/** * @license * Copyright 2020 Google LLC. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. * ============================================================================= */var n=e("@parcel/transformer-js/src/esmodule-helpers.js");n.defineInteropFlag(r),n.export(r,"unstack",()=>i);var s=e("../engine"),a=e("../kernel_names"),o=e("../tensor_util_env"),l=e("../util");let i=/* @__PURE__ */(0,e("./operation").op)({unstack_:function(e,t=0){let r=(0,o.convertToTensor)(e,"x","unstack","string_or_numeric");return l.assert(t>=-r.shape.length&&t`Axis = ${t} is not in [-${r.shape.length}, ${r.shape.length})`),(0,s.ENGINE).runKernel(a.Unpack,{value:r},{axis:t})}})},{"../engine":"6eJyD","../kernel_names":"aqvy4","../tensor_util_env":"g1Qlv","../util":"gBRMK","./operation":"2kGjz","@parcel/transformer-js/src/esmodule-helpers.js":"9pCYc"}],"45Ote":[function(e,t,r){/** * @license * Copyright 2022 Google LLC. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. * ============================================================================= */var n=e("@parcel/transformer-js/src/esmodule-helpers.js");n.defineInteropFlag(r),n.export(r,"upperBound",()=>a);var s=e("./search_sorted");function a(e,t){return(0,s.searchSorted)(e,t,"right")}},{"./search_sorted":"2Y7bB","@parcel/transformer-js/src/esmodule-helpers.js":"9pCYc"}],"9wyHt":[function(e,t,r){/** * @license * Copyright 2018 Google LLC. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. * ============================================================================= */var n=e("@parcel/transformer-js/src/esmodule-helpers.js");n.defineInteropFlag(r),n.export(r,"variable",()=>a);var s=e("../engine");function a(e,t=!0,r,n){return(0,s.ENGINE).makeVariable(e,t,r,n)}},{"../engine":"6eJyD","@parcel/transformer-js/src/esmodule-helpers.js":"9pCYc"}],bAvwN:[function(e,t,r){/** * @license * Copyright 2020 Google LLC. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. * ============================================================================= */var n=e("@parcel/transformer-js/src/esmodule-helpers.js");n.defineInteropFlag(r),n.export(r,"whereAsync",()=>o);var s=e("../backends/where_impl"),a=e("../tensor_util_env");let o=async function(e){let t=(0,a.convertToTensor)(e,"condition","whereAsync","bool"),r=await t.data(),n=(0,s.whereImpl)(t.shape,r);return e!==t&&t.dispose(),n}},{"../backends/where_impl":"iAW14","../tensor_util_env":"g1Qlv","@parcel/transformer-js/src/esmodule-helpers.js":"9pCYc"}],iAW14:[function(e,t,r){/** * @license * Copyright 2018 Google LLC. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. * ============================================================================= */var n=e("@parcel/transformer-js/src/esmodule-helpers.js");n.defineInteropFlag(r),n.export(r,"whereImpl",()=>a);var s=e("../ops/buffer");function a(e,t){let r=[];for(let e=0;ep);var s=e("../tensor_util_env"),a=e("../util"),o=e("./gather"),l=e("./reshape"),i=e("./squeeze"),u=e("./where_async");let p=async function(e,t,r){let n=(0,s.convertToTensor)(e,"tensor","boolMask"),p=(0,s.convertToTensor)(t,"mask","boolMask","bool"),c=null==r?0:r,d=p.rank,f=n.shape;a.assert(d>0,()=>"mask cannot be scalar"),a.assertShapesMatch(f.slice(c,c+d),p.shape,"mask's shape must match the first K dimensions of tensor's shape,");let h=1;for(let e=c;eh);var s=e("../engine"),a=e("../globals"),o=e("../kernel_names"),l=e("../tensor_util_env"),i=e("../util"),u=e("./complex"),p=e("./imag"),c=e("./neg"),d=e("./operation"),f=e("./real");let h=/* @__PURE__ */(0,d.op)({transpose_:function(e,t,r){let n=(0,l.convertToTensor)(e,"x","transpose");if(null==t&&(t=n.shape.map((e,t)=>t).reverse()),i.assert(n.rank===t.length,()=>`Error in transpose: rank of input ${n.rank} must match length of perm ${t}.`),t.forEach(e=>{i.assert(e>=0&&e`All entries in 'perm' must be between 0 and ${n.rank-1} but got ${t}`)}),n.rank<=1)return n.clone();let d={perm:t};return"complex64"===n.dtype?(0,a.tidy)(()=>{let e=(0,f.real)(n),t=(0,p.imag)(n);return e=(0,s.ENGINE).runKernel(o.Transpose,{x:e},d),t=(0,s.ENGINE).runKernel(o.Transpose,{x:t},d),r&&(t=(0,c.neg)(t)),(0,u.complex)(e,t)}):(0,s.ENGINE).runKernel(o.Transpose,{x:n},d)}})},{"../engine":"6eJyD","../globals":"dGn2S","../kernel_names":"aqvy4","../tensor_util_env":"g1Qlv","../util":"gBRMK","./complex":"98mI6","./imag":"2YwxX","./neg":"7zXw5","./operation":"2kGjz","./real":"gL38H","@parcel/transformer-js/src/esmodule-helpers.js":"9pCYc"}],"1x3sH":[function(e,t,r){/** * @license * Copyright 2018 Google LLC. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. * ============================================================================= */var n=e("@parcel/transformer-js/src/esmodule-helpers.js");n.defineInteropFlag(r),n.export(r,"movingAverage",()=>h);var s=e("../tensor_util"),a=e("../tensor_util_env"),o=e("../util"),l=e("./add"),i=e("./div"),u=e("./mul"),p=e("./operation"),c=e("./pow"),d=e("./scalar"),f=e("./sub");let h=/* @__PURE__ */(0,p.op)({movingAverage_:function(e,t,r,n,p=!0){let h=(0,a.convertToTensor)(e,"v","movingAverage"),m=(0,a.convertToTensor)(t,"x","movingAverage"),g=(0,a.convertToTensor)(r,"decay","movingAverage");(0,s.assertTypesMatch)(h,m),o.assert(o.arraysEqual(h.shape,m.shape),()=>"Shape mismatch in v and x");let x=(0,d.scalar)(1),v=(0,f.sub)(x,g),y=(0,u.mul)((0,f.sub)(m,h),v);if(p){o.assert(null!=n,()=>"When using zeroDebias: true, step is required.");let e=(0,a.convertToTensor)(n,"step","movingAverage");y=(0,i.div)(y,(0,f.sub)(x,(0,c.pow)(g,e)))}return(0,l.add)(h,y)}})},{"../tensor_util":"jgr40","../tensor_util_env":"g1Qlv","../util":"gBRMK","./add":"g9v2X","./div":"f7E5D","./mul":"gPetX","./operation":"2kGjz","./pow":"cL5Hc","./scalar":"53j04","./sub":"cQqL3","@parcel/transformer-js/src/esmodule-helpers.js":"9pCYc"}],j0Hjd:[function(e,t,r){/** * @license * Copyright 2018 Google LLC. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. * ============================================================================= */var n=e("@parcel/transformer-js/src/esmodule-helpers.js");n.defineInteropFlag(r),n.export(r,"scatterND",()=>p);var s=e("../engine"),a=e("../kernel_names"),o=e("../tensor_util_env"),l=e("../util_base"),i=e("./operation"),u=e("./scatter_nd_util");let p=/* @__PURE__ */(0,i.op)({scatterND_:function(e,t,r){(0,l.assertNonNegativeIntegerDimensions)(r);let n=(0,o.convertToTensor)(e,"indices","scatterND","int32"),i=(0,o.convertToTensor)(t,"updates","scatterND");return u.validateInput(i,n,r),(0,s.ENGINE).runKernel(a.ScatterNd,{indices:n,updates:i},{shape:r})}})},{"../engine":"6eJyD","../kernel_names":"aqvy4","../tensor_util_env":"g1Qlv","../util_base":"8U7kO","./operation":"2kGjz","./scatter_nd_util":"1SOU1","@parcel/transformer-js/src/esmodule-helpers.js":"9pCYc"}],"9wN9b":[function(e,t,r){/** * @license * Copyright 2018 Google LLC. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. * ============================================================================= */var n=e("@parcel/transformer-js/src/esmodule-helpers.js");n.defineInteropFlag(r),n.export(r,"sparseToDense",()=>u);var s=e("../engine"),a=e("../kernel_names"),o=e("../ops/sparse_to_dense_util"),l=e("../tensor_util_env"),i=e("../util_base");let u=/* @__PURE__ */(0,e("./operation").op)({sparseToDense_:function(e,t,r,n=0){(0,i.assertNonNegativeIntegerDimensions)(r);let u=(0,l.convertToTensor)(e,"sparseIndices","sparseToDense","int32"),p=(0,l.convertToTensor)(t,"sparseValues","sparseToDense","string_or_numeric"),c=(0,l.convertToTensor)(n,"defaultValue","sparseToDense",p.dtype);return o.validateInput(u,p,r,c),(0,s.ENGINE).runKernel(a.SparseToDense,{sparseIndices:u,sparseValues:p,defaultValue:c},{outputShape:r})}})},{"../engine":"6eJyD","../kernel_names":"aqvy4","../ops/sparse_to_dense_util":"bCsSo","../tensor_util_env":"g1Qlv","../util_base":"8U7kO","./operation":"2kGjz","@parcel/transformer-js/src/esmodule-helpers.js":"9pCYc"}],bCsSo:[function(e,t,r){var n=e("@parcel/transformer-js/src/esmodule-helpers.js");function s(e,t,r,n){if("int32"!==e.dtype)throw Error(`tf.sparseToDense() expects the indices to be int32 type, but the dtype was ${e.dtype}.`);if(e.rank>2)throw Error(`sparseIndices should be a scalar, vector, or matrix, but got shape ${e.shape}.`);let s=e.rank>0?e.shape[0]:1,a=e.rank>1?e.shape[1]:1;if(r.length!==a)throw Error(`outputShape has incorrect number of elements:, ${r.length}, should be: ${a}.`);let o=t.size;if(!(0===t.rank||1===t.rank&&o===s))throw Error(`sparseValues has incorrect shape ${t.shape}, should be [] or [${s}]`);if(t.dtype!==n.dtype)throw Error("sparseValues.dtype must match defaultValues.dtype")}n.defineInteropFlag(r),n.export(r,"validateInput",()=>s)},{"@parcel/transformer-js/src/esmodule-helpers.js":"9pCYc"}],ftx7F:[function(e,t,r){/** * @license * Copyright 2018 Google LLC. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. * ============================================================================= */var n=e("@parcel/transformer-js/src/esmodule-helpers.js");n.defineInteropFlag(r),n.export(r,"gatherND",()=>l);var s=e("../engine"),a=e("../kernel_names"),o=e("../tensor_util_env");let l=/* @__PURE__ */(0,e("./operation").op)({gatherND_:function(e,t){let r=(0,o.convertToTensor)(t,"indices","gatherND","int32"),n=(0,o.convertToTensor)(e,"x","gatherND","string_or_numeric");return(0,s.ENGINE).runKernel(a.GatherNd,{params:n,indices:r})}})},{"../engine":"6eJyD","../kernel_names":"aqvy4","../tensor_util_env":"g1Qlv","./operation":"2kGjz","@parcel/transformer-js/src/esmodule-helpers.js":"9pCYc"}],"8yPYM":[function(e,t,r){/** * @license * Copyright 2018 Google LLC. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. * ============================================================================= */var n=e("@parcel/transformer-js/src/esmodule-helpers.js");n.defineInteropFlag(r),n.export(r,"dropout",()=>h);var s=e("../tensor"),a=e("../tensor_util_env"),o=e("../util"),l=e("./add"),i=e("./div"),u=e("./dropout_util"),p=e("./floor"),c=e("./mul"),d=e("./operation"),f=e("./random_uniform");let h=/* @__PURE__ */(0,d.op)({dropout_:function(e,t,r,n){let d=(0,a.convertToTensor)(e,"x","dropout");if(o.assert("float32"===d.dtype,()=>`x has to be a floating point tensor since it's going to be scaled, but got a ${d.dtype} tensor instead.`),o.assert(t>=0&&t<1,()=>`rate must be a float in the range [0, 1), but got ${t}.`),0===t)return e instanceof s.Tensor?d.clone():d;let h=(0,u.getNoiseShape)(d,r),m=1-t,g=(0,i.div)((0,p.floor)((0,l.add)((0,f.randomUniform)(h,0,1,"float32",n),m)),m);return(0,c.mul)(d,g)}})},{"../tensor":"cZ8UW","../tensor_util_env":"g1Qlv","../util":"gBRMK","./add":"g9v2X","./div":"f7E5D","./dropout_util":"gbfj4","./floor":"29qAJ","./mul":"gPetX","./operation":"2kGjz","./random_uniform":"gyGgn","@parcel/transformer-js/src/esmodule-helpers.js":"9pCYc"}],gbfj4:[function(e,t,r){/** * @license * Copyright 2019 Google LLC. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. * ============================================================================= */var n=e("@parcel/transformer-js/src/esmodule-helpers.js");n.defineInteropFlag(r),n.export(r,"getNoiseShape",()=>a);var s=e("../util");function a(e,t){if(null==t)return e.shape.slice();if(s.arraysEqual(e.shape,t))return t;if(e.shape.length===t.length){let r=[];for(let n=0;na),n.export(r,"cosineWindow",()=>o);var s=e("./tensor1d");function a(e){return Math.floor(Math.pow(2,Math.ceil(Math.log(e)/Math.log(2))))}function o(e,t,r){let n=1-e%2,a=new Float32Array(e);for(let s=0;sl);var s=e("../tensor_util_env"),a=e("../util"),o=e("./tensor");let l=async function(e,t,r=1){let n=(0,s.convertToTensor)(e,"predictions","inTopK"),l=(0,s.convertToTensor)(t,"targets","inTopK");(0,a.assert)(n.rank>1,()=>`inTopK() expects the predictions to be of rank 2 or higher, but got ${n.rank}`),(0,a.assert)(n.rank-1===l.rank,()=>`predictions rank should be 1 larger than targets rank, but got predictions rank ${n.rank} and targets rank ${l.rank}`),(0,a.assertShapesMatch)(n.shape.slice(0,n.shape.length-1),l.shape,"predictions's shape should be align with the targets' shape, except the last dimension.");let i=n.shape[n.shape.length-1];(0,a.assert)(r>0&&r<=i,()=>`'k' passed to inTopK() must be > 0 &&<= the predictions last dimension (${i}), but got ${r}`);let u=await n.data(),p=await l.data(),[c,d]=[u.length/i,i],f=(0,a.getTypedArrayFromDType)("bool",c);for(let e=0;et.value-e.value),f[e]=0;for(let t=0;ts.conv2d),n.export(r,"depthwiseConv2d",()=>a.depthwiseConv2d),n.export(r,"matMul",()=>o.matMul);var s=e("./fused/conv2d"),a=e("./fused/depthwise_conv2d"),o=e("./fused/mat_mul")},{"./fused/conv2d":"hyzRi","./fused/depthwise_conv2d":"9Dbtn","./fused/mat_mul":"7tQWn","@parcel/transformer-js/src/esmodule-helpers.js":"9pCYc"}],hyzRi:[function(e,t,r){/** * @license * Copyright 2019 Google LLC. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. * ============================================================================= */var n=e("@parcel/transformer-js/src/esmodule-helpers.js");n.defineInteropFlag(r),n.export(r,"conv2d",()=>y);var s=e("../../engine"),a=e("../../gradients"),o=e("../../kernel_names"),l=e("../../tensor_util"),i=e("../../tensor_util_env"),u=e("../../util"),p=e("../add"),c=e("../broadcast_util"),d=e("../conv2d"),f=e("../conv2d_backprop_filter"),h=e("../conv2d_backprop_input"),m=e("../conv_util"),g=e("../fused_util"),x=e("../operation"),v=e("../reshape");let y=/* @__PURE__ */(0,x.op)({fusedConv2d_:function({x:e,filter:t,strides:r,pad:n,dataFormat:x="NHWC",dilations:y=[1,1],dimRoundingMode:b,bias:_,activation:k="linear",preluActivationWeights:j,leakyreluAlpha:I}){let C,w;if(k=k||"linear",!1===(0,g.shouldFuse)(s.ENGINE.state.gradientDepth,k)){u.assert("NHWC"===x,()=>`Error in fused conv2d: got dataFormat of ${x} but only NHWC is currently supported for the case of gradient depth is 0 and the activation is not linear.`);let s=(0,d.conv2d)(e,t,r,n,x,y,b);return null!=_&&(s=(0,p.add)(s,_)),(0,g.applyActivation)(s,k,j,I)}let T=(0,i.convertToTensor)(e,"x","conv2d","float32"),S=(0,i.convertToTensor)(t,"filter","conv2d","float32"),N=T,E=!1;3===T.rank&&(E=!0,N=(0,v.reshape)(T,[1,T.shape[0],T.shape[1],T.shape[2]])),u.assert(4===N.rank,()=>`Error in fused conv2d: input must be rank 4, but got rank ${N.rank}.`),u.assert(4===S.rank,()=>`Error in fused conv2d: filter must be rank 4, but got rank ${S.rank}.`),m.checkPadOnDimRoundingMode("fused conv2d",n,b);let F="NHWC"===x?N.shape[3]:N.shape[1];u.assert(S.shape[2]===F,()=>`Error in conv2d: depth of input (${F}) must match input depth for filter ${S.shape[2]}.`),u.assert(m.eitherStridesOrDilationsAreOne(r,y),()=>`Error in conv2D: Either strides or dilations must be 1. Got strides ${r} and dilations '${y}'`);let R=m.computeConv2DInfo(N.shape,S.shape,r,y,n,b);if(null!=_&&(C=(0,i.convertToTensor)(_,"bias","fused conv2d"),[C]=(0,l.makeTypesMatch)(C,T),"NHWC"===x?c.assertAndGetBroadcastShape(R.outShape,C.shape):(u.assert(C.shape.length<=1,()=>`Error in fused conv2d: only supports scalar or 1-D Tensor bias for NCHW format but got the bias of rank-${C.shape.length}.`),u.assert(0===C.shape.length||C.shape[0]===R.outChannels||1===C.shape[0],()=>`Error in fused conv2d: bias shape (${C.shape}) is not compatible with the number of output channels (${R.outChannels})`))),null!=j){let e=j.shape;if(u.assert(e.length<=1||3===e.length,()=>`Error in fused conv2d: only supports scalar, 1-D Tensor or 3-D Tensor PReLU activation weights but got a tensor of rank-${e.length}.`),1===e.length)u.assert(1===e[0]||e[0]===R.outChannels,()=>`Error in fused conv2d: PReLU activation weights (${e}) is not compatible with the number of output channels (${R.outChannels}).`);else if(3===e.length)try{c.assertAndGetBroadcastShape(e,R.outShape)}catch(t){throw Error(`Error in fused conv2d: PReLU activation weights (${e}) is not compatible with the output shape of the conv2d (${R.outShape}).`)}w=(0,i.convertToTensor)(j,"prelu weights","fused conv2d")}let A=(e,t)=>{u.assert("NHWC"===x,()=>`Error in gradient of fused conv2D: got dataFormat of ${x} but only NHWC is currently supported.`);let[s,a,o,l]=t,i=(0,g.getFusedDyActivation)(e,o,k);u.assert(m.tupleValuesAreOne(y),()=>`Error in gradient of fused conv2D: dilation rates greater than 1 are not yet supported in gradients. Got dilations '${y}'`);let p=[(0,h.conv2DBackpropInput)(a.shape,i,s,r,n),(0,f.conv2DBackpropFilter)(a,i,s.shape,r,n)];if(null!=l){let e=(0,g.getFusedBiasGradient)(l,i);p.push(e)}return p},P={x:N,filter:S,bias:C,preluActivationWeights:w},D={strides:r,pad:n,dataFormat:x,dilations:y,dimRoundingMode:b,activation:k,leakyreluAlpha:I};return null==_?(0,a.customGrad)((e,t,r)=>{let n=(0,s.ENGINE).runKernel(o.FusedConv2D,P,D);return r([t,e,n]),E&&(n=(0,v.reshape)(n,[n.shape[1],n.shape[2],n.shape[3]])),{value:n,gradFunc:A}})(N,S):(0,a.customGrad)((e,t,r,n)=>{let a=(0,s.ENGINE).runKernel(o.FusedConv2D,P,D);return n([t,e,a,r]),E&&(a=(0,v.reshape)(a,[a.shape[1],a.shape[2],a.shape[3]])),{value:a,gradFunc:A}})(N,S,C)}})},{"../../engine":"6eJyD","../../gradients":"ab8zU","../../kernel_names":"aqvy4","../../tensor_util":"jgr40","../../tensor_util_env":"g1Qlv","../../util":"gBRMK","../add":"g9v2X","../broadcast_util":"aouH8","../conv2d":"59r1a","../conv2d_backprop_filter":"9QUkV","../conv2d_backprop_input":"bD5qH","../conv_util":"kmOtb","../fused_util":"eVVb8","../operation":"2kGjz","../reshape":"VuY4S","@parcel/transformer-js/src/esmodule-helpers.js":"9pCYc"}],"9QUkV":[function(e,t,r){/** * @license * Copyright 2020 Google LLC. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. * ============================================================================= */var n=e("@parcel/transformer-js/src/esmodule-helpers.js");n.defineInteropFlag(r),n.export(r,"conv2DBackpropFilter",()=>p);var s=e("../engine"),a=e("../kernel_names"),o=e("../util"),l=e("./conv_util"),i=e("./operation"),u=e("./reshape");let p=/* @__PURE__ */(0,i.op)({conv2DBackpropFilter_:function(e,t,r,n,i,p="NHWC",c){let d=e;3===e.rank&&(d=(0,u.reshape)(e,[1,e.shape[0],e.shape[1],e.shape[2]]));let f=t;3===f.rank&&(f=(0,u.reshape)(t,[1,t.shape[0],t.shape[1],t.shape[2]])),o.assert(4===d.rank,()=>`Error in conv2dDerFilter: input must be rank 4, but got shape ${d.shape}.`),o.assert(4===f.rank,()=>`Error in conv2dDerFilter: dy must be rank 4, but got shape ${f.shape}.`),o.assert(4===r.length,()=>`Error in conv2dDerFilter: filterShape must be length 4, but got ${r}.`);let h="NHWC"===p?d.shape[3]:d.shape[1],m="NHWC"===p?f.shape[3]:f.shape[1];o.assert(h===r[2],()=>`Error in conv2dDerFilter: depth of input ${h}) must match input depth in filter (${r[2]}.`),o.assert(m===r[3],()=>`Error in conv2dDerFilter: depth of dy (${m}) must match output depth for filter (${r[3]}).`),l.checkPadOnDimRoundingMode("conv2dDerFilter",i,c);let g={x:d,dy:f};return(0,s.ENGINE).runKernel(a.Conv2DBackpropFilter,g,{strides:n,pad:i,dataFormat:p,dimRoundingMode:c,filterShape:r})}})},{"../engine":"6eJyD","../kernel_names":"aqvy4","../util":"gBRMK","./conv_util":"kmOtb","./operation":"2kGjz","./reshape":"VuY4S","@parcel/transformer-js/src/esmodule-helpers.js":"9pCYc"}],eVVb8:[function(e,t,r){/** * @license * Copyright 2019 Google LLC. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. * ============================================================================= */var n=e("@parcel/transformer-js/src/esmodule-helpers.js");n.defineInteropFlag(r),n.export(r,"getFusedDyActivation",()=>m),n.export(r,"getFusedBiasGradient",()=>g),n.export(r,"applyActivation",()=>x),n.export(r,"shouldFuse",()=>v);var s=e("./broadcast_util"),a=e("./elu"),o=e("./leaky_relu"),l=e("./mul"),i=e("./prelu"),u=e("./relu"),p=e("./relu6"),c=e("./reshape"),d=e("./sigmoid"),f=e("./step"),h=e("./sum");function m(e,t,r){if(null==r||"linear"===r)return e;if("relu"===r)return(0,l.mul)(e,(0,f.step)(t));throw Error(`Cannot compute gradient for fused activation ${r}.`)}function g(e,t){let r=t,n=s.getReductionAxes(e.shape,t.shape);return n.length>0&&(r=(0,h.sum)(r,n)),(0,c.reshape)(r,e.shape)}function x(e,t,r,n){if("linear"===t)return e;if("relu"===t)return(0,u.relu)(e);if("elu"===t)return(0,a.elu)(e);if("relu6"===t)return(0,p.relu6)(e);if("prelu"===t)return(0,i.prelu)(e,r);if("leakyrelu"===t)return(0,o.leakyRelu)(e,n);if("sigmoid"===t)return(0,d.sigmoid)(e);throw Error(`Unknown fused activation ${t}.`)}let v=(e,t)=>!(e>0)||"linear"===t},{"./broadcast_util":"aouH8","./elu":"gTKMF","./leaky_relu":"4La0e","./mul":"gPetX","./prelu":"9UqPZ","./relu":"cx9c3","./relu6":"g5u74","./reshape":"VuY4S","./sigmoid":"gGNpa","./step":"2cIA8","./sum":"gsfPR","@parcel/transformer-js/src/esmodule-helpers.js":"9pCYc"}],"9Dbtn":[function(e,t,r){/** * @license * Copyright 2019 Google LLC. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. * ============================================================================= */var n=e("@parcel/transformer-js/src/esmodule-helpers.js");n.defineInteropFlag(r),n.export(r,"depthwiseConv2d",()=>y);var s=e("../../engine"),a=e("../../gradients"),o=e("../../kernel_names"),l=e("../../tensor_util"),i=e("../../tensor_util_env"),u=e("../../util"),p=e("../add"),c=e("../broadcast_util"),d=e("../conv_util"),f=e("../depthwise_conv2d"),h=e("../depthwise_conv2d_native_backprop_filter"),m=e("../depthwise_conv2d_native_backprop_input"),g=e("../fused_util"),x=e("../operation"),v=e("../reshape");let y=/* @__PURE__ */(0,x.op)({fusedDepthwiseConv2d_:function({x:e,filter:t,strides:r,pad:n,dataFormat:x="NHWC",dilations:y=[1,1],dimRoundingMode:b,bias:_,activation:k="linear",preluActivationWeights:j,leakyreluAlpha:I}){let C,w;if(!1===(0,g.shouldFuse)(s.ENGINE.state.gradientDepth,k)){let s=(0,f.depthwiseConv2d)(e,t,r,n,x,y,b);return null!=_&&(s=(0,p.add)(s,_)),(0,g.applyActivation)(s,k,j,I)}let T=(0,i.convertToTensor)(e,"x","depthwiseConv2d","float32"),S=(0,i.convertToTensor)(t,"filter","depthwiseConv2d","float32"),N=T,E=!1;3===T.rank&&(E=!0,N=(0,v.reshape)(T,[1,T.shape[0],T.shape[1],T.shape[2]])),u.assert(4===N.rank,()=>`Error in fused depthwiseConv2d: input must be rank 4, but got rank ${N.rank}.`),u.assert(4===S.rank,()=>`Error in fused depthwiseConv2d: filter must be rank 4, but got rank ${S.rank}.`),u.assert(N.shape[3]===S.shape[2],()=>`Error in fused depthwiseConv2d: number of input channels (${N.shape[3]}) must match the inChannels dimension in filter ${S.shape[2]}.`),null==y&&(y=[1,1]),u.assert(d.eitherStridesOrDilationsAreOne(r,y),()=>`Error in fused depthwiseConv2d: Either strides or dilations must be 1. Got strides ${r} and dilations '${y}'`),d.checkPadOnDimRoundingMode("fused depthwiseConv2d",n,b);let F=d.computeConv2DInfo(N.shape,S.shape,r,y,n,b,!0);null!=_&&(C=(0,i.convertToTensor)(_,"bias","fused conv2d"),[C]=(0,l.makeTypesMatch)(C,T),c.assertAndGetBroadcastShape(F.outShape,C.shape)),null!=j&&(w=(0,i.convertToTensor)(j,"prelu weights","fused depthwiseConv2d"));let R=(e,t)=>{u.assert(d.tupleValuesAreOne(y),()=>`Error in gradient of fused depthwiseConv2d: dilation rates greater than 1 are not yet supported. Got dilations '${y}'`);let[s,a,o,l]=t,i=(0,g.getFusedDyActivation)(e,o,k),p=(0,m.depthwiseConv2dNativeBackpropInput)(a.shape,i,s,r,n,y,b),c=(0,h.depthwiseConv2dNativeBackpropFilter)(a,i,s.shape,r,n,y,b);return null!=l?[p,c,(0,g.getFusedBiasGradient)(C,i)]:[p,c]},A={x:N,filter:S,bias:C,preluActivationWeights:w},P={strides:r,pad:n,dataFormat:x,dilations:y,dimRoundingMode:b,activation:k,leakyreluAlpha:I};return null==_?(0,a.customGrad)((e,t,r)=>{let n=(0,s.ENGINE).runKernel(o.FusedDepthwiseConv2D,A,P);return r([t,e,n]),E&&(n=(0,v.reshape)(n,[n.shape[1],n.shape[2],n.shape[3]])),{value:n,gradFunc:R}})(N,S):(0,a.customGrad)((e,t,r,n)=>{let a=(0,s.ENGINE).runKernel(o.FusedDepthwiseConv2D,A,P);return n([t,e,a,r]),E&&(a=(0,v.reshape)(a,[a.shape[1],a.shape[2],a.shape[3]])),{value:a,gradFunc:R}})(N,S,C)}})},{"../../engine":"6eJyD","../../gradients":"ab8zU","../../kernel_names":"aqvy4","../../tensor_util":"jgr40","../../tensor_util_env":"g1Qlv","../../util":"gBRMK","../add":"g9v2X","../broadcast_util":"aouH8","../conv_util":"kmOtb","../depthwise_conv2d":"kLAtV","../depthwise_conv2d_native_backprop_filter":"kUIdt","../depthwise_conv2d_native_backprop_input":"2ztk4","../fused_util":"eVVb8","../operation":"2kGjz","../reshape":"VuY4S","@parcel/transformer-js/src/esmodule-helpers.js":"9pCYc"}],kUIdt:[function(e,t,r){/** * @license * Copyright 2020 Google LLC. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. * ============================================================================= */var n=e("@parcel/transformer-js/src/esmodule-helpers.js");n.defineInteropFlag(r),n.export(r,"depthwiseConv2dNativeBackpropFilter",()=>i);var s=e("../engine"),a=e("../kernel_names"),o=e("./operation"),l=e("./reshape");let i=(0,o.op)({depthwiseConv2dNativeBackpropFilter_:function(e,t,r,n,o,i=[1,1],u){let p=e;3===e.rank&&(p=(0,l.reshape)(e,[1,e.shape[0],e.shape[1],e.shape[2]]));let c=t;3===c.rank&&(c=(0,l.reshape)(t,[1,t.shape[0],t.shape[1],t.shape[2]]));let d={x:p,dy:c};return(0,s.ENGINE).runKernel(a.DepthwiseConv2dNativeBackpropFilter,d,{strides:n,pad:o,dimRoundingMode:u,dilations:i,filterShape:r})}})},{"../engine":"6eJyD","../kernel_names":"aqvy4","./operation":"2kGjz","./reshape":"VuY4S","@parcel/transformer-js/src/esmodule-helpers.js":"9pCYc"}],"2ztk4":[function(e,t,r){/** * @license * Copyright 2020 Google LLC. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. * ============================================================================= */var n=e("@parcel/transformer-js/src/esmodule-helpers.js");n.defineInteropFlag(r),n.export(r,"depthwiseConv2dNativeBackpropInput",()=>i);var s=e("../engine"),a=e("../kernel_names"),o=e("./operation"),l=e("./reshape");let i=(0,o.op)({depthwiseConv2dNativeBackpropInput_:function(e,t,r,n,o,i=[1,1],u){let p=t,c=!1;3===t.rank&&(c=!0,p=(0,l.reshape)(t,[1,t.shape[0],t.shape[1],t.shape[2]]));let d={dy:p,filter:r},f=(0,s.ENGINE).runKernel(a.DepthwiseConv2dNativeBackpropInput,d,{strides:n,pad:o,dimRoundingMode:u,dilations:i,inputShape:e});return c?(0,l.reshape)(f,[f.shape[1],f.shape[2],f.shape[3]]):f}})},{"../engine":"6eJyD","../kernel_names":"aqvy4","./operation":"2kGjz","./reshape":"VuY4S","@parcel/transformer-js/src/esmodule-helpers.js":"9pCYc"}],"7tQWn":[function(e,t,r){/** * @license * Copyright 2019 Google LLC. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. * ============================================================================= */var n=e("@parcel/transformer-js/src/esmodule-helpers.js");n.defineInteropFlag(r),n.export(r,"matMul",()=>g);var s=e("../../engine"),a=e("../../gradients"),o=e("../../kernel_names"),l=e("../../tensor_util"),i=e("../../tensor_util_env"),u=e("../../util"),p=e("../add"),c=e("../broadcast_util"),d=e("../fused_util"),f=e("../mat_mul"),h=e("../operation"),m=e("../reshape");let g=/* @__PURE__ */(0,h.op)({fusedMatMul_:function({a:e,b:t,transposeA:r=!1,transposeB:n=!1,bias:h,activation:g="linear",preluActivationWeights:x,leakyreluAlpha:v=.2}){let y,b;if(!1===(0,d.shouldFuse)(s.ENGINE.state.gradientDepth,g)){let s=(0,f.matMul)(e,t,r,n);return null!=h&&(s=(0,p.add)(s,h)),(0,d.applyActivation)(s,g,x,v)}let _=(0,i.convertToTensor)(e,"a","fused matMul"),k=(0,i.convertToTensor)(t,"b","fused matMul");[_,k]=(0,l.makeTypesMatch)(_,k);let j=r?_.shape[_.rank-2]:_.shape[_.rank-1],I=n?k.shape[k.rank-1]:k.shape[k.rank-2],C=r?_.shape[_.rank-1]:_.shape[_.rank-2],w=n?k.shape[k.rank-2]:k.shape[k.rank-1],T=_.shape.slice(0,-2),S=k.shape.slice(0,-2),N=u.sizeFromShape(T),E=u.sizeFromShape(S);u.assert(j===I,()=>`Error in fused matMul: inner shapes (${j}) and (${I}) of Tensors with shapes ${_.shape} and ${k.shape} and transposeA=${r} and transposeB=${n} must match.`);let F=c.assertAndGetBroadcastShape(_.shape.slice(0,-2),k.shape.slice(0,-2)).concat([C,w]),R=r?(0,m.reshape)(_,[N,j,C]):(0,m.reshape)(_,[N,C,j]),A=n?(0,m.reshape)(k,[E,w,I]):(0,m.reshape)(k,[E,I,w]);null!=h&&(y=(0,i.convertToTensor)(h,"bias","fused matMul"),[y]=(0,l.makeTypesMatch)(y,_),c.assertAndGetBroadcastShape(F,y.shape)),null!=x&&(b=(0,i.convertToTensor)(x,"prelu weights","fused matMul"));let P=(e,t)=>{let s,a;let[o,l,i,u]=t,p=(0,d.getFusedDyActivation)((0,m.reshape)(e,i.shape),i,g);return(r||n?!r&&n?(s=(0,f.matMul)(p,l,!1,!1),a=(0,f.matMul)(p,o,!0,!1)):r&&!n?(s=(0,f.matMul)(l,p,!1,!0),a=(0,f.matMul)(o,p,!1,!1)):(s=(0,f.matMul)(l,p,!0,!0),a=(0,f.matMul)(p,o,!0,!0)):(s=(0,f.matMul)(p,l,!1,!0),a=(0,f.matMul)(o,p,!0,!1)),null!=h)?[s,a,(0,d.getFusedBiasGradient)(u,p)]:[s,a]},D={a:R,b:A,bias:y,preluActivationWeights:b},$={transposeA:r,transposeB:n,activation:g,leakyreluAlpha:v};return null==h?(0,a.customGrad)((e,t,r)=>{let n=(0,s.ENGINE).runKernel(o._FusedMatMul,D,$);return r([e,t,n]),{value:(0,m.reshape)(n,F),gradFunc:P}})(R,A):(0,a.customGrad)((e,t,r,n)=>{let a=(0,s.ENGINE).runKernel(o._FusedMatMul,D,$);return n([e,t,a,r]),{value:(0,m.reshape)(a,F),gradFunc:P}})(R,A,y)}})},{"../../engine":"6eJyD","../../gradients":"ab8zU","../../kernel_names":"aqvy4","../../tensor_util":"jgr40","../../tensor_util_env":"g1Qlv","../../util":"gBRMK","../add":"g9v2X","../broadcast_util":"aouH8","../fused_util":"eVVb8","../mat_mul":"9ZocJ","../operation":"2kGjz","../reshape":"VuY4S","@parcel/transformer-js/src/esmodule-helpers.js":"9pCYc"}],d2Ryg:[function(e,t,r){/** * @license * Copyright 2019 Google LLC. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. * ============================================================================= */var n=e("@parcel/transformer-js/src/esmodule-helpers.js");n.defineInteropFlag(r),n.export(r,"hammingWindow",()=>o);var s=e("../operation"),a=e("../signal_ops_util");let o=/* @__PURE__ */(0,s.op)({hammingWindow_:function(e){return(0,a.cosineWindow)(e,.54,.46)}})},{"../operation":"2kGjz","../signal_ops_util":"ebQTE","@parcel/transformer-js/src/esmodule-helpers.js":"9pCYc"}],bYtSf:[function(e,t,r){/** * @license * Copyright 2019 Google LLC. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. * ============================================================================= */var n=e("@parcel/transformer-js/src/esmodule-helpers.js");n.defineInteropFlag(r),n.export(r,"hannWindow",()=>o);var s=e("../operation"),a=e("../signal_ops_util");let o=/* @__PURE__ */(0,s.op)({hannWindow_:function(e){return(0,a.cosineWindow)(e,.5,.5)}})},{"../operation":"2kGjz","../signal_ops_util":"ebQTE","@parcel/transformer-js/src/esmodule-helpers.js":"9pCYc"}],"11lOp":[function(e,t,r){/** * @license * Copyright 2019 Google LLC. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. * ============================================================================= */var n=e("@parcel/transformer-js/src/esmodule-helpers.js");n.defineInteropFlag(r),n.export(r,"frame",()=>p);var s=e("../concat"),a=e("../fill"),o=e("../operation"),l=e("../reshape"),i=e("../slice"),u=e("../tensor2d");let p=/* @__PURE__ */(0,o.op)({frame_:function(e,t,r,n=!1,o=0){let p=0,c=[];for(;p+t<=e.size;)c.push((0,i.slice)(e,p,t)),p+=r;if(n)for(;pp);var s=e("../mul"),a=e("../operation"),o=e("../signal_ops_util"),l=e("../spectral/rfft"),i=e("./frame"),u=e("./hann_window");let p=/* @__PURE__ */(0,a.op)({stft_:function(e,t,r,n,a=u.hannWindow){null==n&&(n=(0,o.enclosingPowerOfTwo)(t));let p=(0,i.frame)(e,t,r),c=(0,s.mul)(p,a(t));return(0,l.rfft)(c,n)}})},{"../mul":"gPetX","../operation":"2kGjz","../signal_ops_util":"ebQTE","../spectral/rfft":"enYFV","./frame":"11lOp","./hann_window":"bYtSf","@parcel/transformer-js/src/esmodule-helpers.js":"9pCYc"}],TjMmg:[function(e,t,r){/** * @license * Copyright 2020 Google LLC. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. * ============================================================================= */var n=e("@parcel/transformer-js/src/esmodule-helpers.js");n.defineInteropFlag(r),n.export(r,"cropAndResize",()=>i);var s=e("../../engine"),a=e("../../kernel_names"),o=e("../../tensor_util_env"),l=e("../../util");let i=/* @__PURE__ */(0,e("../operation").op)({cropAndResize_:function(e,t,r,n,i="bilinear",u=0){let p=(0,o.convertToTensor)(e,"image","cropAndResize"),c=(0,o.convertToTensor)(t,"boxes","cropAndResize","float32"),d=(0,o.convertToTensor)(r,"boxInd","cropAndResize","int32"),f=c.shape[0];return l.assert(4===p.rank,()=>`Error in cropAndResize: image must be rank 4,but got rank ${p.rank}.`),l.assert(2===c.rank&&4===c.shape[1],()=>`Error in cropAndResize: boxes must be have size [${f},4] but had shape ${c.shape}.`),l.assert(1===d.rank&&d.shape[0]===f,()=>`Error in cropAndResize: boxInd must be have size [${f}] but had shape ${c.shape}.`),l.assert(2===n.length,()=>`Error in cropAndResize: cropSize must be of length 2, but got length ${n.length}.`),l.assert(n[0]>=1&&n[1]>=1,()=>`cropSize must be atleast [1,1], but was ${n}`),l.assert("bilinear"===i||"nearest"===i,()=>`method must be bilinear or nearest, but was ${i}`),(0,s.ENGINE).runKernel(a.CropAndResize,{image:p,boxes:c,boxInd:d},{method:i,extrapolationValue:u,cropSize:n})}})},{"../../engine":"6eJyD","../../kernel_names":"aqvy4","../../tensor_util_env":"g1Qlv","../../util":"gBRMK","../operation":"2kGjz","@parcel/transformer-js/src/esmodule-helpers.js":"9pCYc"}],kns2j:[function(e,t,r){/** * @license * Copyright 2020 Google LLC. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. * ============================================================================= */var n=e("@parcel/transformer-js/src/esmodule-helpers.js");n.defineInteropFlag(r),n.export(r,"flipLeftRight",()=>i);var s=e("../../engine"),a=e("../../kernel_names"),o=e("../../tensor_util_env"),l=e("../../util");let i=/* @__PURE__ */(0,e("../operation").op)({flipLeftRight_:function(e){let t=(0,o.convertToTensor)(e,"image","flipLeftRight","float32");return l.assert(4===t.rank,()=>`Error in flipLeftRight: image must be rank 4,but got rank ${t.rank}.`),(0,s.ENGINE).runKernel(a.FlipLeftRight,{image:t},{})}})},{"../../engine":"6eJyD","../../kernel_names":"aqvy4","../../tensor_util_env":"g1Qlv","../../util":"gBRMK","../operation":"2kGjz","@parcel/transformer-js/src/esmodule-helpers.js":"9pCYc"}],"9VwKI":[function(e,t,r){/** * @license * Copyright 2021 Google LLC. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. * ============================================================================= */var n=e("@parcel/transformer-js/src/esmodule-helpers.js");n.defineInteropFlag(r),n.export(r,"grayscaleToRGB",()=>i);var s=e("../../tensor_util_env"),a=e("../../util"),o=e("../operation"),l=e("../tile");let i=/* @__PURE__ */(0,o.op)({grayscaleToRGB_:function(e){let t=(0,s.convertToTensor)(e,"image","grayscaleToRGB"),r=t.rank-1,n=t.shape[r];a.assert(t.rank>=2,()=>`Error in grayscaleToRGB: images must be at least rank 2, but got rank ${t.rank}.`),a.assert(1===n,()=>`Error in grayscaleToRGB: last dimension of a grayscale image should be size 1, but got size ${n}.`);let o=Array(t.rank);return o.fill(1,0,r),o[r]=3,(0,l.tile)(t,o)}})},{"../../tensor_util_env":"g1Qlv","../../util":"gBRMK","../operation":"2kGjz","../tile":"5kcg2","@parcel/transformer-js/src/esmodule-helpers.js":"9pCYc"}],cvHCC:[function(e,t,r){/** * @license * Copyright 2023 Google LLC. * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. * ============================================================================= */var n=e("@parcel/transformer-js/src/esmodule-helpers.js");n.defineInteropFlag(r),n.export(r,"rgbToGrayscale",()=>c);var s=e("../../tensor_util_env"),a=e("../../util"),o=e("../cast"),l=e("../einsum"),i=e("../expand_dims"),u=e("../operation"),p=e("../tensor1d");let c=/* @__PURE__ */(0,u.op)({rgbToGrayscale_:function(e){let t;let r=(0,s.convertToTensor)(e,"image","RGBToGrayscale"),n=r.rank-1,u=r.shape[n];a.assert(r.rank>=2,()=>`Error in RGBToGrayscale: images must be at least rank 2, but got rank ${r.rank}.`),a.assert(3===u,()=>`Error in RGBToGrayscale: last dimension of an RGB image should be size 3, but got size ${u}.`);let c=r.dtype,d=(0,o.cast)(r,"float32"),f=(0,p.tensor1d)([.2989,.587,.114]);switch(r.rank){case 2:t=(0,l.einsum)("ij,j->i",d,f);break;case 3:t=(0,l.einsum)("ijk,k->ij",d,f);break;case 4:t=(0,l.einsum)("ijkl,l->ijk",d,f);break;case 5:t=(0,l.einsum)("ijklm,m->ijkl",d,f);break;case 6:t=(0,l.einsum)("ijklmn,n->ijklm",d,f);break;default:throw Error("Not a valid tensor rank.")}return t=(0,i.expandDims)(t,-1),(0,o.cast)(t,c)}})},{"../../tensor_util_env":"g1Qlv","../../util":"gBRMK","../cast":"ekSnT","../einsum":"iHV90","../expand_dims":"bkwaY","../operation":"2kGjz","../tensor1d":"j8r4R","@parcel/transformer-js/src/esmodule-helpers.js":"9pCYc"}],"9G7PX":[function(e,t,r){/** * @license * Copyright 2020 Google LLC. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. * ============================================================================= */var n=e("@parcel/transformer-js/src/esmodule-helpers.js");n.defineInteropFlag(r),n.export(r,"rotateWithOffset",()=>i);var s=e("../../engine"),a=e("../../kernel_names"),o=e("../../tensor_util_env"),l=e("../../util");let i=/* @__PURE__ */(0,e("../operation").op)({rotateWithOffset_:function(e,t,r=0,n=.5){let i=(0,o.convertToTensor)(e,"image","rotateWithOffset","float32");return l.assert(4===i.rank,()=>`Error in rotateWithOffset: image must be rank 4,but got rank ${i.rank}.`),(0,s.ENGINE).runKernel(a.RotateWithOffset,{image:i},{radians:t,fillValue:r,center:n})}})},{"../../engine":"6eJyD","../../kernel_names":"aqvy4","../../tensor_util_env":"g1Qlv","../../util":"gBRMK","../operation":"2kGjz","@parcel/transformer-js/src/esmodule-helpers.js":"9pCYc"}],l18In:[function(e,t,r){/** * @license * Copyright 2020 Google LLC. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. * ============================================================================= */var n=e("@parcel/transformer-js/src/esmodule-helpers.js");n.defineInteropFlag(r),n.export(r,"nonMaxSuppression",()=>i);var s=e("../../engine"),a=e("../../kernel_names"),o=e("../../tensor_util_env"),l=e("../nonmax_util");let i=/* @__PURE__ */(0,e("../operation").op)({nonMaxSuppression_:function(e,t,r,n=.5,i=Number.NEGATIVE_INFINITY){let u=(0,o.convertToTensor)(e,"boxes","nonMaxSuppression","float32"),p=(0,o.convertToTensor)(t,"scores","nonMaxSuppression","float32"),c=(0,l.nonMaxSuppSanityCheck)(u,p,r,n,i),d={maxOutputSize:r=c.maxOutputSize,iouThreshold:n=c.iouThreshold,scoreThreshold:i=c.scoreThreshold};return(0,s.ENGINE).runKernel(a.NonMaxSuppressionV3,{boxes:u,scores:p},d)}})},{"../../engine":"6eJyD","../../kernel_names":"aqvy4","../../tensor_util_env":"g1Qlv","../nonmax_util":"7A1ZE","../operation":"2kGjz","@parcel/transformer-js/src/esmodule-helpers.js":"9pCYc"}],"7A1ZE":[function(e,t,r){/** * @license * Copyright 2020 Google LLC. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. * ============================================================================= */var n=e("@parcel/transformer-js/src/esmodule-helpers.js");n.defineInteropFlag(r),n.export(r,"nonMaxSuppSanityCheck",()=>a);var s=e("../util");function a(e,t,r,n,a,o){null==n&&(n=.5),null==a&&(a=Number.NEGATIVE_INFINITY),null==o&&(o=0);let l=e.shape[0];return r=Math.min(r,l),s.assert(0<=n&&n<=1,()=>`iouThreshold must be in [0, 1], but was '${n}'`),s.assert(2===e.rank,()=>`boxes must be a 2D tensor, but was of rank '${e.rank}'`),s.assert(4===e.shape[1],()=>`boxes must have 4 columns, but 2nd dimension was ${e.shape[1]}`),s.assert(1===t.rank,()=>"scores must be a 1D tensor"),s.assert(t.shape[0]===l,()=>`scores has incompatible shape with boxes. Expected ${l}, but was ${t.shape[0]}`),s.assert(0<=o&&o<=1,()=>`softNmsSigma must be in [0, 1], but was '${o}'`),{maxOutputSize:r,iouThreshold:n,scoreThreshold:a,softNmsSigma:o}}},{"../util":"gBRMK","@parcel/transformer-js/src/esmodule-helpers.js":"9pCYc"}],"25fjM":[function(e,t,r){/** * @license * Copyright 2020 Google LLC. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. * ============================================================================= */var n=e("@parcel/transformer-js/src/esmodule-helpers.js");n.defineInteropFlag(r),n.export(r,"nonMaxSuppressionAsync",()=>i);var s=e("../../backends/non_max_suppression_impl"),a=e("../../tensor_util_env"),o=e("../nonmax_util"),l=e("../tensor1d");let i=async function(e,t,r,n=.5,i=Number.NEGATIVE_INFINITY){let u=(0,a.convertToTensor)(e,"boxes","nonMaxSuppressionAsync"),p=(0,a.convertToTensor)(t,"scores","nonMaxSuppressionAsync"),c=(0,o.nonMaxSuppSanityCheck)(u,p,r,n,i);r=c.maxOutputSize,n=c.iouThreshold,i=c.scoreThreshold;let d=await Promise.all([u.data(),p.data()]),f=d[0],h=d[1],{selectedIndices:m}=(0,s.nonMaxSuppressionV3Impl)(f,h,r,n,i);return u!==e&&u.dispose(),p!==t&&p.dispose(),(0,l.tensor1d)(m,"int32")}},{"../../backends/non_max_suppression_impl":"5hWvx","../../tensor_util_env":"g1Qlv","../nonmax_util":"7A1ZE","../tensor1d":"j8r4R","@parcel/transformer-js/src/esmodule-helpers.js":"9pCYc"}],"5hWvx":[function(e,t,r){/** * @license * Copyright 2020 Google LLC. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. * ============================================================================= */var n=e("@parcel/transformer-js/src/esmodule-helpers.js");n.defineInteropFlag(r),n.export(r,"nonMaxSuppressionV3Impl",()=>a),n.export(r,"nonMaxSuppressionV4Impl",()=>o),n.export(r,"nonMaxSuppressionV5Impl",()=>l);var s=e("./non_max_suppression_util");function a(e,t,r,n,s){return i(e,t,r,n,s,0)}function o(e,t,r,n,s,a){return i(e,t,r,n,s,0,!1,a,!0)}function l(e,t,r,n,s,a){return i(e,t,r,n,s,a,!0)}function i(e,t,r,n,a,o,l=!1,p=!1,c=!1){let d=[];for(let e=0;ea&&d.push({score:t[e],boxIndex:e,suppressBeginIndex:0});d.sort(u);let f=o>0?-.5/o:0,h=[],m=[];for(;h.length0;){let t=d.pop(),{score:r,boxIndex:o,suppressBeginIndex:l}=t;if(r=l;--r){let s=function(e,t,r){let n=e.subarray(4*t,4*t+4),s=e.subarray(4*r,4*r+4),a=Math.min(n[0],n[2]),o=Math.min(n[1],n[3]),l=Math.max(n[0],n[2]),i=Math.max(n[1],n[3]),u=Math.min(s[0],s[2]),p=Math.min(s[1],s[3]),c=Math.max(s[0],s[2]),d=Math.max(s[1],s[3]),f=(l-a)*(i-o),h=(c-u)*(d-p);if(f<=0||h<=0)return 0;let m=Math.max(Math.min(l,c)-Math.max(a,u),0)*Math.max(Math.min(i,d)-Math.max(o,p),0);return m/(f+h-m)}(e,o,h[r]);if(s>=n){i=!0;break}if(t.score=t.score*function(e,t,r){let n=Math.exp(t*r*r);return r<=e?n:0}(n,f,s),t.score<=a)break}t.suppressBeginIndex=h.length,!i&&(t.score===r?(h.push(o),m.push(t.score)):t.score>a&&(0,s.binaryInsert)(d,t,u))}let g=h.length,x=r-g;p&&x>0&&(h.push(...Array(x).fill(0)),m.push(...Array(x).fill(0)));let v={selectedIndices:h};return l&&(v.selectedScores=m),c&&(v.validOutputs=g),v}function u(e,t){return e.score-t.score||e.score===t.score&&t.boxIndex-e.boxIndex}},{"./non_max_suppression_util":"fU2IK","@parcel/transformer-js/src/esmodule-helpers.js":"9pCYc"}],fU2IK:[function(e,t,r){/** * @license * Copyright 2019 Google LLC. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. * ============================================================================= */var n=e("@parcel/transformer-js/src/esmodule-helpers.js");function s(e,t,r){let n=a(e,t,r);e.splice(n<0?-(n+1):n,0,t)}function a(e,t,r){return function(e,t,r){let n=0,s=e.length,a=0,o=!1;for(;n>>1)]);l>0?n=a+1:(s=a,o=!l)}return o?n:-n-1}(e,t,r||o)}function o(e,t){return e>t?1:es),n.export(r,"binarySearch",()=>a)},{"@parcel/transformer-js/src/esmodule-helpers.js":"9pCYc"}],"3QkyU":[function(e,t,r){/** * @license * Copyright 2020 Google LLC. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. * ============================================================================= */var n=e("@parcel/transformer-js/src/esmodule-helpers.js");n.defineInteropFlag(r),n.export(r,"nonMaxSuppressionWithScore",()=>i);var s=e("../../engine"),a=e("../../kernel_names"),o=e("../../tensor_util_env"),l=e("../nonmax_util");let i=/* @__PURE__ */(0,e("../operation").op)({nonMaxSuppressionWithScore_:function(e,t,r,n=.5,i=Number.NEGATIVE_INFINITY,u=0){let p=(0,o.convertToTensor)(e,"boxes","nonMaxSuppression"),c=(0,o.convertToTensor)(t,"scores","nonMaxSuppression"),d=(0,l.nonMaxSuppSanityCheck)(p,c,r,n,i,u);r=d.maxOutputSize,n=d.iouThreshold;let f={maxOutputSize:r,iouThreshold:n,scoreThreshold:i=d.scoreThreshold,softNmsSigma:u=d.softNmsSigma},h=(0,s.ENGINE).runKernel(a.NonMaxSuppressionV5,{boxes:p,scores:c},f);return{selectedIndices:h[0],selectedScores:h[1]}}})},{"../../engine":"6eJyD","../../kernel_names":"aqvy4","../../tensor_util_env":"g1Qlv","../nonmax_util":"7A1ZE","../operation":"2kGjz","@parcel/transformer-js/src/esmodule-helpers.js":"9pCYc"}],"1hBGY":[function(e,t,r){/** * @license * Copyright 2020 Google LLC. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. * ============================================================================= */var n=e("@parcel/transformer-js/src/esmodule-helpers.js");n.defineInteropFlag(r),n.export(r,"nonMaxSuppressionWithScoreAsync",()=>i);var s=e("../../backends/non_max_suppression_impl"),a=e("../../tensor_util_env"),o=e("../nonmax_util"),l=e("../tensor1d");let i=async function(e,t,r,n=.5,i=Number.NEGATIVE_INFINITY,u=0){let p=(0,a.convertToTensor)(e,"boxes","nonMaxSuppressionAsync"),c=(0,a.convertToTensor)(t,"scores","nonMaxSuppressionAsync"),d=(0,o.nonMaxSuppSanityCheck)(p,c,r,n,i,u);r=d.maxOutputSize,n=d.iouThreshold,i=d.scoreThreshold,u=d.softNmsSigma;let f=await Promise.all([p.data(),c.data()]),h=f[0],m=f[1],{selectedIndices:g,selectedScores:x}=(0,s.nonMaxSuppressionV5Impl)(h,m,r,n,i,u);return p!==e&&p.dispose(),c!==t&&c.dispose(),{selectedIndices:(0,l.tensor1d)(g,"int32"),selectedScores:(0,l.tensor1d)(x)}}},{"../../backends/non_max_suppression_impl":"5hWvx","../../tensor_util_env":"g1Qlv","../nonmax_util":"7A1ZE","../tensor1d":"j8r4R","@parcel/transformer-js/src/esmodule-helpers.js":"9pCYc"}],dc0Hx:[function(e,t,r){/** * @license * Copyright 2020 Google LLC. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. * ============================================================================= */var n=e("@parcel/transformer-js/src/esmodule-helpers.js");n.defineInteropFlag(r),n.export(r,"nonMaxSuppressionPadded",()=>i);var s=e("../../engine"),a=e("../../kernel_names"),o=e("../../tensor_util_env"),l=e("../nonmax_util");let i=/* @__PURE__ */(0,e("../operation").op)({nonMaxSuppressionPadded_:function(e,t,r,n=.5,i=Number.NEGATIVE_INFINITY,u=!1){let p=(0,o.convertToTensor)(e,"boxes","nonMaxSuppression"),c=(0,o.convertToTensor)(t,"scores","nonMaxSuppression"),d=(0,l.nonMaxSuppSanityCheck)(p,c,r,n,i,null),f=d.maxOutputSize,h=d.iouThreshold,m=d.scoreThreshold,g=(0,s.ENGINE).runKernel(a.NonMaxSuppressionV4,{boxes:p,scores:c},{maxOutputSize:f,iouThreshold:h,scoreThreshold:m,padToMaxOutputSize:u});return{selectedIndices:g[0],validOutputs:g[1]}}})},{"../../engine":"6eJyD","../../kernel_names":"aqvy4","../../tensor_util_env":"g1Qlv","../nonmax_util":"7A1ZE","../operation":"2kGjz","@parcel/transformer-js/src/esmodule-helpers.js":"9pCYc"}],"8i0M7":[function(e,t,r){/** * @license * Copyright 2020 Google LLC. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. * ============================================================================= */var n=e("@parcel/transformer-js/src/esmodule-helpers.js");n.defineInteropFlag(r),n.export(r,"nonMaxSuppressionPaddedAsync",()=>u);var s=e("../../backends/non_max_suppression_impl"),a=e("../../tensor_util_env"),o=e("../nonmax_util"),l=e("../scalar"),i=e("../tensor1d");let u=async function(e,t,r,n=.5,u=Number.NEGATIVE_INFINITY,p=!1){let c=(0,a.convertToTensor)(e,"boxes","nonMaxSuppressionAsync"),d=(0,a.convertToTensor)(t,"scores","nonMaxSuppressionAsync"),f=(0,o.nonMaxSuppSanityCheck)(c,d,r,n,u,null),h=f.maxOutputSize,m=f.iouThreshold,g=f.scoreThreshold,[x,v]=await Promise.all([c.data(),d.data()]),{selectedIndices:y,validOutputs:b}=(0,s.nonMaxSuppressionV4Impl)(x,v,h,m,g,p);return c!==e&&c.dispose(),d!==t&&d.dispose(),{selectedIndices:(0,i.tensor1d)(y,"int32"),validOutputs:(0,l.scalar)(b,"int32")}}},{"../../backends/non_max_suppression_impl":"5hWvx","../../tensor_util_env":"g1Qlv","../nonmax_util":"7A1ZE","../scalar":"53j04","../tensor1d":"j8r4R","@parcel/transformer-js/src/esmodule-helpers.js":"9pCYc"}],jcgG4:[function(e,t,r){/** * @license * Copyright 2020 Google LLC. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. * ============================================================================= */var n=e("@parcel/transformer-js/src/esmodule-helpers.js");n.defineInteropFlag(r),n.export(r,"resizeBilinear",()=>p);var s=e("../../engine"),a=e("../../kernel_names"),o=e("../../tensor_util_env"),l=e("../../util"),i=e("../operation"),u=e("../reshape");let p=/* @__PURE__ */(0,i.op)({resizeBilinear_:function(e,t,r=!1,n=!1){let i=(0,o.convertToTensor)(e,"images","resizeBilinear");l.assert(3===i.rank||4===i.rank,()=>`Error in resizeBilinear: x must be rank 3 or 4, but got rank ${i.rank}.`),l.assert(2===t.length,()=>`Error in resizeBilinear: new shape must 2D, but got shape ${t}.`),l.assert(!1===n||!1===r,()=>"Error in resizeBilinear: If halfPixelCenters is true, alignCorners must be false.");let p=i,c=!1;3===i.rank&&(c=!0,p=(0,u.reshape)(i,[1,i.shape[0],i.shape[1],i.shape[2]]));let[]=t,d={images:p},f=(0,s.ENGINE).runKernel(a.ResizeBilinear,d,{alignCorners:r,halfPixelCenters:n,size:t});return c?(0,u.reshape)(f,[f.shape[1],f.shape[2],f.shape[3]]):f}})},{"../../engine":"6eJyD","../../kernel_names":"aqvy4","../../tensor_util_env":"g1Qlv","../../util":"gBRMK","../operation":"2kGjz","../reshape":"VuY4S","@parcel/transformer-js/src/esmodule-helpers.js":"9pCYc"}],jdfJP:[function(e,t,r){/** * @license * Copyright 2020 Google LLC. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. * ============================================================================= */var n=e("@parcel/transformer-js/src/esmodule-helpers.js");n.defineInteropFlag(r),n.export(r,"resizeNearestNeighbor",()=>p);var s=e("../../engine"),a=e("../../kernel_names"),o=e("../../tensor_util_env"),l=e("../../util"),i=e("../operation"),u=e("../reshape");let p=/* @__PURE__ */(0,i.op)({resizeNearestNeighbor_:function(e,t,r=!1,n=!1){let i=(0,o.convertToTensor)(e,"images","resizeNearestNeighbor");l.assert(3===i.rank||4===i.rank,()=>`Error in resizeNearestNeighbor: x must be rank 3 or 4, but got rank ${i.rank}.`),l.assert(2===t.length,()=>`Error in resizeNearestNeighbor: new shape must 2D, but got shape ${t}.`),l.assert("float32"===i.dtype||"int32"===i.dtype,()=>"`images` must have `int32` or `float32` as dtype"),l.assert(!1===n||!1===r,()=>"Error in resizeNearestNeighbor: If halfPixelCenters is true, alignCorners must be false.");let p=i,c=!1;3===i.rank&&(c=!0,p=(0,u.reshape)(i,[1,i.shape[0],i.shape[1],i.shape[2]]));let[]=t,d={images:p},f=(0,s.ENGINE).runKernel(a.ResizeNearestNeighbor,d,{alignCorners:r,halfPixelCenters:n,size:t});return c?(0,u.reshape)(f,[f.shape[1],f.shape[2],f.shape[3]]):f}})},{"../../engine":"6eJyD","../../kernel_names":"aqvy4","../../tensor_util_env":"g1Qlv","../../util":"gBRMK","../operation":"2kGjz","../reshape":"VuY4S","@parcel/transformer-js/src/esmodule-helpers.js":"9pCYc"}],b4A5K:[function(e,t,r){/** * @license * Copyright 2021 Google LLC. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * https://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. * ============================================================================= */var n=e("@parcel/transformer-js/src/esmodule-helpers.js");n.defineInteropFlag(r),n.export(r,"threshold",()=>I);var s=e("../tensor1d"),a=e("../operation"),o=e("../cast"),l=e("../split"),i=e("../bincount"),u=e("../less_equal"),p=e("../greater"),c=e("../sum"),d=e("../add"),f=e("../mul"),h=e("../div"),m=e("../sub"),g=e("../round"),x=e("../where"),v=e("../fill"),y=e("../slice"),b=e("../range"),_=e("../tensor"),k=e("../../util"),j=e("../../tensor_util_env");let I=/* @__PURE__ */(0,a.op)({threshold_:function(e,t="binary",r=!1,n=.5){let a,I,C,w;let T=(0,j.convertToTensor)(e,"image","threshold"),S=T.shape[0]*T.shape[1],N=(0,f.mul)((0,s.tensor1d)([n]),255);if(k.assert(3===T.rank,()=>`Error in threshold: image must be rank 3,but got rank ${T.rank}.`),k.assert(3===T.shape[2]||1===T.shape[2],()=>`Error in threshold: image color channel must be equal to 3 or 1but got ${T.shape[2]}.`),k.assert("int32"===T.dtype||"float32"===T.dtype,()=>`Error in dtype: image dtype must be int32 or float32,but got dtype ${T.dtype}.`),k.assert("otsu"===t||"binary"===t,()=>`Method must be binary or otsu, but was ${t}`),3===T.shape[2]){[a,I,C]=(0,l.split)(T,[1,1,1],-1);let e=(0,f.mul)(a,.2989),t=(0,f.mul)(I,.587),r=(0,f.mul)(C,.114);w=(0,d.add)((0,d.add)(e,t),r)}else w=e;"otsu"===t&&(N=function(e,t){let r,n,a,o,l,i,u=(0,s.tensor1d)([-1]),g=(0,s.tensor1d)([0]),_=(0,s.tensor1d)([0]);for(let k=0;ki);var s=e("../../engine"),a=e("../../kernel_names"),o=e("../../tensor_util_env"),l=e("../../util");let i=/* @__PURE__ */(0,e("../operation").op)({transform_:function(e,t,r="nearest",n="constant",i=0,u){let p=(0,o.convertToTensor)(e,"image","transform","float32"),c=(0,o.convertToTensor)(t,"transforms","transform","float32");return l.assert(4===p.rank,()=>`Error in transform: image must be rank 4,but got rank ${p.rank}.`),l.assert(2===c.rank&&(c.shape[0]===p.shape[0]||1===c.shape[0])&&8===c.shape[1],()=>"Error in transform: Input transform should be batch x 8 or 1 x 8"),l.assert(null==u||2===u.length,()=>`Error in transform: outputShape must be [height, width] or null, but got ${u}.`),(0,s.ENGINE).runKernel(a.Transform,{image:p,transforms:c},{interpolation:r,fillMode:n,fillValue:i,outputShape:u})}})},{"../../engine":"6eJyD","../../kernel_names":"aqvy4","../../tensor_util_env":"g1Qlv","../../util":"gBRMK","../operation":"2kGjz","@parcel/transformer-js/src/esmodule-helpers.js":"9pCYc"}],"802Ux":[function(e,t,r){/** * @license * Copyright 2020 Google LLC. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. * ============================================================================= */var n=e("@parcel/transformer-js/src/esmodule-helpers.js");n.defineInteropFlag(r),n.export(r,"bandPart",()=>b);var s=e("../../tensor_util_env"),a=e("../../util"),o=e("../greater_equal"),l=e("../less"),i=e("../less_equal"),u=e("../logical_and"),p=e("../minimum"),c=e("../neg"),d=e("../operation"),f=e("../range"),h=e("../reshape"),m=e("../stack"),g=e("../sub"),x=e("../unstack"),v=e("../where"),y=e("../zeros");let b=/* @__PURE__ */(0,d.op)({bandPart_:function(e,t,r){let n,d;let b=(0,s.convertToTensor)(e,"a","bandPart");(0,a.assert)(b.rank>=2,()=>`bandPart(): Rank must be at least 2, got ${b.rank}.`);let _=b.shape,[k,j]=b.shape.slice(-2);"number"==typeof t?((0,a.assert)(t%1==0,()=>`bandPart(): numLower must be an integer, got ${t}.`),(0,a.assert)(t<=k,()=>`bandPart(): numLower (${t}) must not be greater than the number of rows (${k}).`),n=(0,s.convertToTensor)(t<0?k:t,"numLower","bandPart")):((0,a.assert)("int32"===t.dtype,()=>"bandPart(): numLower's dtype must be an int32."),n=(0,v.where)((0,l.less)(t,0),k,(0,p.minimum)(t,k))),"number"==typeof r?((0,a.assert)(r%1==0,()=>`bandPart(): numUpper must be an integer, got ${r}.`),(0,a.assert)(r<=j,()=>`bandPart(): numUpper (${r}) must not be greater than the number of columns (${j}).`),d=(0,s.convertToTensor)(r<0?j:r,"numUpper","bandPart")):((0,a.assert)("int32"===r.dtype,()=>"bandPart(): numUpper's dtype must be an int32."),d=(0,v.where)((0,l.less)(r,0),j,(0,p.minimum)(r,j)));let I=(0,h.reshape)((0,f.range)(0,k,1,"int32"),[-1,1]),C=(0,f.range)(0,j,1,"int32"),w=(0,g.sub)(I,C),T=(0,u.logicalAnd)((0,i.lessEqual)(w,n),(0,o.greaterEqual)(w,(0,c.neg)(d))),S=(0,y.zeros)([k,j],b.dtype);return(0,h.reshape)((0,m.stack)((0,x.unstack)((0,h.reshape)(b,[-1,k,j])).map(e=>(0,v.where)(T,e,S))),_)}})},{"../../tensor_util_env":"g1Qlv","../../util":"gBRMK","../greater_equal":"5jRVD","../less":"kyWc5","../less_equal":"bqBgL","../logical_and":"eVMNJ","../minimum":"jeIQ1","../neg":"7zXw5","../operation":"2kGjz","../range":"lKSmL","../reshape":"VuY4S","../stack":"gM8I8","../sub":"cQqL3","../unstack":"7lgSS","../where":"4ZjiT","../zeros":"1YDK1","@parcel/transformer-js/src/esmodule-helpers.js":"9pCYc"}],h2qxT:[function(e,t,r){/** * @license * Copyright 2020 Google LLC. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. * ============================================================================= */var n=e("@parcel/transformer-js/src/esmodule-helpers.js");n.defineInteropFlag(r),n.export(r,"gramSchmidt",()=>m);var s=e("../../engine"),a=e("../../util"),o=e("../div"),l=e("../mul"),i=e("../norm"),u=e("../operation"),p=e("../split"),c=e("../squeeze"),d=e("../stack"),f=e("../sub"),h=e("../sum");let m=/* @__PURE__ */(0,u.op)({gramSchmidt_:function(e){let t;if(Array.isArray(e)){t=!1,(0,a.assert)(null!=e&&e.length>0,()=>"Gram-Schmidt process: input must not be null, undefined, or empty");let r=e[0].shape[0];for(let t=1;t`Gram-Schmidt: Non-unique lengths found in the input vectors: (${e[t].shape[0]} vs. ${r})`)}else t=!0,e=(0,p.split)(e,e.shape[0],0).map(e=>(0,c.squeeze)(e,[0]));(0,a.assert)(e.length<=e[0].shape[0],()=>`Gram-Schmidt: Number of vectors (${e.length}) exceeds number of dimensions (${e[0].shape[0]}).`);let r=[],n=e;for(let t=0;t{let e=n[t];if(t>0)for(let n=0;nw);var s=e("../../engine"),a=e("../../globals"),o=e("../../util"),l=e("../clone"),i=e("../concat"),u=e("../div"),p=e("../eye"),c=e("../greater"),d=e("../mat_mul"),f=e("../mul"),h=e("../neg"),m=e("../norm"),g=e("../operation"),x=e("../reshape"),v=e("../slice"),y=e("../stack"),b=e("../sub"),_=e("../tensor2d"),k=e("../transpose"),j=e("../unstack"),I=e("../where");function C(e,t=!1){return(0,s.ENGINE).tidy(()=>{(0,o.assert)(2===e.shape.length,()=>`qr2d() requires a 2D Tensor, but got a ${e.shape.length}D Tensor.`);let r=e.shape[0],n=e.shape[1],g=(0,p.eye)(r),x=(0,l.clone)(e),y=(0,_.tensor2d)([[1]],[1,1]),j=(0,l.clone)(y),C=r>=n?n:r;for(let e=0;e{let t=(0,v.slice)(x,[e,e],[r-e,1]),s=(0,m.norm)(t),a=(0,v.slice)(x,[e,e],[1,1]),o=(0,I.where)((0,c.greater)(a,0),(0,_.tensor2d)([[-1]]),(0,_.tensor2d)([[1]])),p=(0,b.sub)(a,(0,f.mul)(o,s)),C=(0,u.div)(t,p);j=1===C.shape[0]?(0,l.clone)(y):(0,i.concat)([y,(0,v.slice)(C,[1,0],[C.shape[0]-1,C.shape[1]])],0);let w=(0,h.neg)((0,u.div)((0,d.matMul)(o,p),s)),T=(0,v.slice)(x,[e,0],[r-e,n]),S=(0,f.mul)(w,j),N=(0,k.transpose)(j);if(0===e)x=(0,b.sub)(T,(0,d.matMul)(S,(0,d.matMul)(N,T)));else{let t=(0,b.sub)(T,(0,d.matMul)(S,(0,d.matMul)(N,T)));x=(0,i.concat)([(0,v.slice)(x,[0,0],[e,n]),t],0)}let E=(0,k.transpose)(S),F=(0,v.slice)(g,[0,e],[r,g.shape[1]-e]);if(0===e)g=(0,b.sub)(F,(0,d.matMul)((0,d.matMul)(F,j),E));else{let t=(0,b.sub)(F,(0,d.matMul)((0,d.matMul)(F,j),E));g=(0,i.concat)([(0,v.slice)(g,[0,0],[r,e]),t],1)}return[j,x,g]}),(0,a.dispose)([t,o,p])}return!t&&r>n&&(g=(0,v.slice)(g,[0,0],[r,n]),x=(0,v.slice)(x,[0,0],[n,n])),[g,x]})}let w=/* @__PURE__ */(0,g.op)({qr_:function(e,t=!1){if((0,o.assert)(e.rank>=2,()=>`qr() requires input tensor to have a rank >= 2, but got rank ${e.rank}`),2===e.rank)return C(e,t);{let r=e.shape.slice(0,e.shape.length-2).reduce((e,t)=>e*t),n=(0,j.unstack)((0,x.reshape)(e,[r,e.shape[e.shape.length-2],e.shape[e.shape.length-1]]),0),s=[],a=[];return n.forEach(e=>{let[r,n]=C(e,t);s.push(r),a.push(n)}),[(0,x.reshape)((0,y.stack)(s,0),e.shape),(0,x.reshape)((0,y.stack)(a,0),e.shape)]}}})},{"../../engine":"6eJyD","../../globals":"dGn2S","../../util":"gBRMK","../clone":"gI2Tp","../concat":"aQPCM","../div":"f7E5D","../eye":"1q7xZ","../greater":"auCuN","../mat_mul":"9ZocJ","../mul":"gPetX","../neg":"7zXw5","../norm":"auMxT","../operation":"2kGjz","../reshape":"VuY4S","../slice":"cjlcK","../stack":"gM8I8","../sub":"cQqL3","../tensor2d":"anm7F","../transpose":"4OrXK","../unstack":"7lgSS","../where":"4ZjiT","@parcel/transformer-js/src/esmodule-helpers.js":"9pCYc"}],fYxMY:[function(e,t,r){/** * @license * Copyright 2020 Google LLC. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. * ============================================================================= */var n=e("@parcel/transformer-js/src/esmodule-helpers.js");n.defineInteropFlag(r),n.export(r,"absoluteDifference",()=>c);var s=e("../../tensor_util_env"),a=e("../../util"),o=e("../abs"),l=e("../loss_ops_utils"),i=e("../operation"),u=e("../sub"),p=e("./compute_weighted_loss");let c=/* @__PURE__ */(0,i.op)({absoluteDifference_:function(e,t,r,n=l.Reduction.SUM_BY_NONZERO_WEIGHTS){let i=(0,s.convertToTensor)(e,"labels","absoluteDifference"),c=(0,s.convertToTensor)(t,"predictions","absoluteDifference"),d=null;null!=r&&(d=(0,s.convertToTensor)(r,"weights","absoluteDifference")),(0,a.assertShapesMatch)(i.shape,c.shape,"Error in absoluteDifference: ");let f=(0,o.abs)((0,u.sub)(i,c));return(0,p.computeWeightedLoss)(f,d,n)}})},{"../../tensor_util_env":"g1Qlv","../../util":"gBRMK","../abs":"3JIEu","../loss_ops_utils":"5Eo2w","../operation":"2kGjz","../sub":"cQqL3","./compute_weighted_loss":"3X2X3","@parcel/transformer-js/src/esmodule-helpers.js":"9pCYc"}],"5Eo2w":[function(e,t,r){/** * @license * Copyright 2020 Google LLC. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. * ============================================================================= */var n,s,a=e("@parcel/transformer-js/src/esmodule-helpers.js");a.defineInteropFlag(r),a.export(r,"Reduction",()=>s),(n=s||(s={}))[n.NONE=0]="NONE",n[n.MEAN=1]="MEAN",n[n.SUM=2]="SUM",n[n.SUM_BY_NONZERO_WEIGHTS=3]="SUM_BY_NONZERO_WEIGHTS"},{"@parcel/transformer-js/src/esmodule-helpers.js":"9pCYc"}],"3X2X3":[function(e,t,r){var n=e("@parcel/transformer-js/src/esmodule-helpers.js");n.defineInteropFlag(r),n.export(r,"computeWeightedLoss",()=>m);var s=e("../../tensor_util_env"),a=e("../cast"),o=e("../div"),l=e("../loss_ops_utils"),i=e("../mean"),u=e("../mul"),p=e("../not_equal"),c=e("../ones"),d=e("../operation"),f=e("../scalar"),h=e("../sum");let m=/* @__PURE__ */(0,d.op)({computeWeightedLoss_:function(e,t,r=l.Reduction.SUM_BY_NONZERO_WEIGHTS){let n=(0,s.convertToTensor)(e,"losses","computeWeightedLoss"),d=null;null!=t&&(d=(0,s.convertToTensor)(t,"weights","computeWeightedLoss"));let m=null==d?n:(0,u.mul)(n,d);if(r===l.Reduction.NONE)return m;if(r===l.Reduction.SUM)return(0,h.sum)(m);if(r===l.Reduction.MEAN){if(null==d)return(0,i.mean)(m);{let e=n.size/d.size,t=(0,o.div)((0,h.sum)(m),(0,h.sum)(d));return e>1?(0,o.div)(t,(0,f.scalar)(e)):t}}if(r===l.Reduction.SUM_BY_NONZERO_WEIGHTS){if(null==d)return(0,o.div)((0,h.sum)(m),(0,f.scalar)(n.size));{let e=(0,u.mul)(d,(0,c.ones)(n.shape)),t=(0,a.cast)((0,h.sum)((0,p.notEqual)(e,(0,f.scalar)(0))),"float32");return(0,o.div)((0,h.sum)(m),t)}}throw Error(`Unknown reduction: ${r}`)}})},{"../../tensor_util_env":"g1Qlv","../cast":"ekSnT","../div":"f7E5D","../loss_ops_utils":"5Eo2w","../mean":"ddOHD","../mul":"gPetX","../not_equal":"lDPfv","../ones":"bs1MK","../operation":"2kGjz","../scalar":"53j04","../sum":"gsfPR","@parcel/transformer-js/src/esmodule-helpers.js":"9pCYc"}],c9vR1:[function(e,t,r){var n=e("@parcel/transformer-js/src/esmodule-helpers.js");n.defineInteropFlag(r),n.export(r,"cosineDistance",()=>f);var s=e("../../tensor_util_env"),a=e("../../util"),o=e("../loss_ops_utils"),l=e("../mul"),i=e("../operation"),u=e("../scalar"),p=e("../sub"),c=e("../sum"),d=e("./compute_weighted_loss");let f=/* @__PURE__ */(0,i.op)({cosineDistance_:function(e,t,r,n,i=o.Reduction.SUM_BY_NONZERO_WEIGHTS){let f=(0,s.convertToTensor)(e,"labels","cosineDistance"),h=(0,s.convertToTensor)(t,"predictions","cosineDistance"),m=null;null!=n&&(m=(0,s.convertToTensor)(n,"weights","cosineDistance")),(0,a.assertShapesMatch)(f.shape,h.shape,"Error in cosineDistance: ");let g=(0,u.scalar)(1),x=(0,p.sub)(g,(0,c.sum)((0,l.mul)(f,h),r,!0));return(0,d.computeWeightedLoss)(x,m,i)}})},{"../../tensor_util_env":"g1Qlv","../../util":"gBRMK","../loss_ops_utils":"5Eo2w","../mul":"gPetX","../operation":"2kGjz","../scalar":"53j04","../sub":"cQqL3","../sum":"gsfPR","./compute_weighted_loss":"3X2X3","@parcel/transformer-js/src/esmodule-helpers.js":"9pCYc"}],"745PS":[function(e,t,r){var n=e("@parcel/transformer-js/src/esmodule-helpers.js");n.defineInteropFlag(r),n.export(r,"hingeLoss",()=>f);var s=e("../../tensor_util_env"),a=e("../../util"),o=e("../loss_ops_utils"),l=e("../mul"),i=e("../operation"),u=e("../relu"),p=e("../scalar"),c=e("../sub"),d=e("./compute_weighted_loss");let f=/* @__PURE__ */(0,i.op)({hingeLoss_:function(e,t,r,n=o.Reduction.SUM_BY_NONZERO_WEIGHTS){let i=(0,s.convertToTensor)(e,"labels","hingeLoss"),f=(0,s.convertToTensor)(t,"predictions","hingeLoss"),h=null;null!=r&&(h=(0,s.convertToTensor)(r,"weights","hingeLoss")),(0,a.assertShapesMatch)(i.shape,f.shape,"Error in hingeLoss: ");let m=(0,p.scalar)(1);i=(0,c.sub)((0,l.mul)((0,p.scalar)(2),i),m);let g=(0,u.relu)((0,c.sub)(m,(0,l.mul)(i,f)));return(0,d.computeWeightedLoss)(g,h,n)}})},{"../../tensor_util_env":"g1Qlv","../../util":"gBRMK","../loss_ops_utils":"5Eo2w","../mul":"gPetX","../operation":"2kGjz","../relu":"cx9c3","../scalar":"53j04","../sub":"cQqL3","./compute_weighted_loss":"3X2X3","@parcel/transformer-js/src/esmodule-helpers.js":"9pCYc"}],"6ueCA":[function(e,t,r){/** * @license * Copyright 2020 Google LLC. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. * ============================================================================= */var n=e("@parcel/transformer-js/src/esmodule-helpers.js");n.defineInteropFlag(r),n.export(r,"huberLoss",()=>g);var s=e("../../tensor_util_env"),a=e("../../util"),o=e("../abs"),l=e("../add"),i=e("../loss_ops_utils"),u=e("../minimum"),p=e("../mul"),c=e("../operation"),d=e("../scalar"),f=e("../square"),h=e("../sub"),m=e("./compute_weighted_loss");let g=/* @__PURE__ */(0,c.op)({huberLoss_:function(e,t,r,n=1,c=i.Reduction.SUM_BY_NONZERO_WEIGHTS){let g=(0,s.convertToTensor)(e,"labels","huberLoss"),x=(0,s.convertToTensor)(t,"predictions","huberLoss"),v=null;null!=r&&(v=(0,s.convertToTensor)(r,"weights","huberLoss")),(0,a.assertShapesMatch)(g.shape,x.shape,"Error in huberLoss: ");let y=(0,d.scalar)(n),b=(0,o.abs)((0,h.sub)(x,g)),_=(0,u.minimum)(b,y),k=(0,h.sub)(b,_),j=(0,l.add)((0,p.mul)((0,d.scalar)(.5),(0,f.square)(_)),(0,p.mul)(y,k));return(0,m.computeWeightedLoss)(j,v,c)}})},{"../../tensor_util_env":"g1Qlv","../../util":"gBRMK","../abs":"3JIEu","../add":"g9v2X","../loss_ops_utils":"5Eo2w","../minimum":"jeIQ1","../mul":"gPetX","../operation":"2kGjz","../scalar":"53j04","../square":"1Qqi7","../sub":"cQqL3","./compute_weighted_loss":"3X2X3","@parcel/transformer-js/src/esmodule-helpers.js":"9pCYc"}],"3DiEw":[function(e,t,r){/** * @license * Copyright 2020 Google LLC. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. * ============================================================================= */var n=e("@parcel/transformer-js/src/esmodule-helpers.js");n.defineInteropFlag(r),n.export(r,"logLoss",()=>m);var s=e("../../tensor_util_env"),a=e("../../util"),o=e("../add"),l=e("../log"),i=e("../loss_ops_utils"),u=e("../mul"),p=e("../neg"),c=e("../operation"),d=e("../scalar"),f=e("../sub"),h=e("./compute_weighted_loss");let m=/* @__PURE__ */(0,c.op)({logLoss_:function(e,t,r,n=1e-7,c=i.Reduction.SUM_BY_NONZERO_WEIGHTS){let m=(0,s.convertToTensor)(e,"labels","logLoss"),g=(0,s.convertToTensor)(t,"predictions","logLoss"),x=null;null!=r&&(x=(0,s.convertToTensor)(r,"weights","logLoss")),(0,a.assertShapesMatch)(m.shape,g.shape,"Error in logLoss: ");let v=(0,d.scalar)(1),y=(0,d.scalar)(n),b=(0,p.neg)((0,u.mul)(m,(0,l.log)((0,o.add)(g,y)))),_=(0,u.mul)((0,f.sub)(v,m),(0,l.log)((0,o.add)((0,f.sub)(v,g),y))),k=(0,f.sub)(b,_);return(0,h.computeWeightedLoss)(k,x,c)}})},{"../../tensor_util_env":"g1Qlv","../../util":"gBRMK","../add":"g9v2X","../log":"jzL0E","../loss_ops_utils":"5Eo2w","../mul":"gPetX","../neg":"7zXw5","../operation":"2kGjz","../scalar":"53j04","../sub":"cQqL3","./compute_weighted_loss":"3X2X3","@parcel/transformer-js/src/esmodule-helpers.js":"9pCYc"}],iOpdj:[function(e,t,r){/** * @license * Copyright 2020 Google LLC. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. * ============================================================================= */var n=e("@parcel/transformer-js/src/esmodule-helpers.js");n.defineInteropFlag(r),n.export(r,"meanSquaredError",()=>p);var s=e("../../tensor_util_env"),a=e("../../util"),o=e("../loss_ops_utils"),l=e("../operation"),i=e("../squared_difference"),u=e("./compute_weighted_loss");let p=/* @__PURE__ */(0,l.op)({meanSquaredError_:function(e,t,r,n=o.Reduction.SUM_BY_NONZERO_WEIGHTS){let l=(0,s.convertToTensor)(e,"labels","meanSquaredError"),p=(0,s.convertToTensor)(t,"predictions","meanSquaredError"),c=null;null!=r&&(c=(0,s.convertToTensor)(r,"weights","meanSquaredError")),(0,a.assertShapesMatch)(l.shape,p.shape,"Error in meanSquaredError: ");let d=(0,i.squaredDifference)(l,p);return(0,u.computeWeightedLoss)(d,c,n)}})},{"../../tensor_util_env":"g1Qlv","../../util":"gBRMK","../loss_ops_utils":"5Eo2w","../operation":"2kGjz","../squared_difference":"ktglY","./compute_weighted_loss":"3X2X3","@parcel/transformer-js/src/esmodule-helpers.js":"9pCYc"}],ak4fC:[function(e,t,r){/** * @license * Copyright 2020 Google LLC. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. * ============================================================================= */var n=e("@parcel/transformer-js/src/esmodule-helpers.js");n.defineInteropFlag(r),n.export(r,"sigmoidCrossEntropy",()=>v);var s=e("../../tensor_util_env"),a=e("../../util"),o=e("../abs"),l=e("../add"),i=e("../exp"),u=e("../log1p"),p=e("../loss_ops_utils"),c=e("../mul"),d=e("../neg"),f=e("../operation"),h=e("../relu"),m=e("../scalar"),g=e("../sub"),x=e("./compute_weighted_loss");let v=/* @__PURE__ */(0,f.op)({sigmoidCrossEntropy_:function(e,t,r,n=0,f=p.Reduction.SUM_BY_NONZERO_WEIGHTS){let v=(0,s.convertToTensor)(e,"multiClassLabels","sigmoidCrossEntropy"),y=(0,s.convertToTensor)(t,"logits","sigmoidCrossEntropy"),b=null;if(null!=r&&(b=(0,s.convertToTensor)(r,"weights","sigmoidCrossEntropy")),(0,a.assertShapesMatch)(v.shape,y.shape,"Error in sigmoidCrossEntropy: "),n>0){let e=(0,m.scalar)(n),t=(0,m.scalar)(1),r=(0,m.scalar)(.5);v=(0,l.add)((0,c.mul)(v,(0,g.sub)(t,e)),(0,c.mul)(r,e))}let _=function(e,t){let r=(0,s.convertToTensor)(e,"labels","sigmoidCrossEntropyWithLogits"),n=(0,s.convertToTensor)(t,"logits","sigmoidCrossEntropyWithLogits");(0,a.assertShapesMatch)(r.shape,n.shape,"Error in sigmoidCrossEntropyWithLogits: ");let p=(0,h.relu)(n),f=(0,c.mul)(n,r),m=(0,u.log1p)((0,i.exp)((0,d.neg)((0,o.abs)(n))));return(0,l.add)((0,g.sub)(p,f),m)}(v,y);return(0,x.computeWeightedLoss)(_,b,f)}})},{"../../tensor_util_env":"g1Qlv","../../util":"gBRMK","../abs":"3JIEu","../add":"g9v2X","../exp":"g4QHY","../log1p":"3kse5","../loss_ops_utils":"5Eo2w","../mul":"gPetX","../neg":"7zXw5","../operation":"2kGjz","../relu":"cx9c3","../scalar":"53j04","../sub":"cQqL3","./compute_weighted_loss":"3X2X3","@parcel/transformer-js/src/esmodule-helpers.js":"9pCYc"}],l673k:[function(e,t,r){/** * @license * Copyright 2020 Google LLC. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. * ============================================================================= */var n=e("@parcel/transformer-js/src/esmodule-helpers.js");n.defineInteropFlag(r),n.export(r,"softmaxCrossEntropy",()=>k);var s=e("../../gradients"),a=e("../../tensor_util_env"),o=e("../../util"),l=e("../add"),i=e("../axis_util"),u=e("../cast"),p=e("../div"),c=e("../exp"),d=e("../log_sum_exp"),f=e("../loss_ops_utils"),h=e("../mul"),m=e("../neg"),g=e("../operation"),x=e("../reshape"),v=e("../scalar"),y=e("../sub"),b=e("../sum"),_=e("./compute_weighted_loss");let k=/* @__PURE__ */(0,g.op)({softmaxCrossEntropy_:function(e,t,r,n=0,g=f.Reduction.SUM_BY_NONZERO_WEIGHTS){let k=(0,a.convertToTensor)(e,"onehotLabels","softmaxCrossEntropy"),j=(0,a.convertToTensor)(t,"logits","softmaxCrossEntropy"),I=null;if(null!=r&&(I=(0,a.convertToTensor)(r,"weights","softmaxCrossEntropy")),(0,o.assertShapesMatch)(k.shape,j.shape,"Error in softmaxCrossEntropy: "),n>0){let e=(0,v.scalar)(n),t=(0,v.scalar)(1),r=(0,v.scalar)(k.shape[1]);k=(0,l.add)((0,h.mul)(k,(0,y.sub)(t,e)),(0,p.div)(e,r))}let C=function(e,t,r=-1){if(-1===r&&(r=t.rank-1),r!==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 ${r}`);return(0,s.customGrad)((e,t,n)=>{let s=(0,d.logSumExp)(t,[r],!0),a=(0,y.sub)((0,u.cast)(t,"float32"),s);n([e,a]);let o=(0,m.neg)((0,h.mul)(a,e));return{value:(0,b.sum)(o,[r]),gradFunc:(e,t)=>{let[n,s]=t,a=(0,i.expandShapeToKeepDim)(e.shape,[r]);return[(0,h.mul)((0,x.reshape)(e,a),(0,y.sub)((0,u.cast)(n,"float32"),(0,c.exp)(s))),(0,h.mul)((0,x.reshape)(e,a),(0,y.sub)((0,c.exp)(s),(0,u.cast)(n,"float32")))]}}})(e,t)}(k,j);return(0,_.computeWeightedLoss)(C,I,g)}})},{"../../gradients":"ab8zU","../../tensor_util_env":"g1Qlv","../../util":"gBRMK","../add":"g9v2X","../axis_util":"3ROd2","../cast":"ekSnT","../div":"f7E5D","../exp":"g4QHY","../log_sum_exp":"9LKqV","../loss_ops_utils":"5Eo2w","../mul":"gPetX","../neg":"7zXw5","../operation":"2kGjz","../reshape":"VuY4S","../scalar":"53j04","../sub":"cQqL3","../sum":"gsfPR","./compute_weighted_loss":"3X2X3","@parcel/transformer-js/src/esmodule-helpers.js":"9pCYc"}],c5a3k:[function(e,t,r){/** * @license * Copyright 2021 Google LLC. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. * ============================================================================= */var n=e("@parcel/transformer-js/src/esmodule-helpers.js");n.defineInteropFlag(r),n.export(r,"sparseFillEmptyRows",()=>l);var s=e("../../engine"),a=e("../../kernel_names"),o=e("../../tensor_util_env");let l=/* @__PURE__ */(0,e("../operation").op)({sparseFillEmptyRows_:function(e,t,r,n){let l=(0,o.convertToTensor)(e,"indices","sparseFillEmptyRows","int32"),i=(0,o.convertToTensor)(t,"values","sparseFillEmptyRows"),u=(0,o.convertToTensor)(r,"denseShape","sparseFillEmptyRows","int32"),p=(0,o.convertToTensor)(n,"defaultValue","sparseFillEmptyRows",i.dtype);if(2!==l.rank)throw Error(`Indices should be Tensor2D but received shape ${l.shape}`);if(1!==i.rank)throw Error(`Values should be Tensor1D but received shape ${i.shape}`);if(1!==u.rank)throw Error(`Dense shape should be Tensor1D but received shape ${u.shape}`);if(0!==p.rank)throw Error(`Default value should be a scalar but received shape ${p.shape}`);let c=(0,s.ENGINE).runKernel(a.SparseFillEmptyRows,{indices:l,values:i,denseShape:u,defaultValue:p});return{outputIndices:c[0],outputValues:c[1],emptyRowIndicator:c[2],reverseIndexMap:c[3]}}})},{"../../engine":"6eJyD","../../kernel_names":"aqvy4","../../tensor_util_env":"g1Qlv","../operation":"2kGjz","@parcel/transformer-js/src/esmodule-helpers.js":"9pCYc"}],aQZAA:[function(e,t,r){/** * @license * Copyright 2021 Google LLC. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. * ============================================================================= */var n=e("@parcel/transformer-js/src/esmodule-helpers.js");n.defineInteropFlag(r),n.export(r,"sparseReshape",()=>l);var s=e("../../engine"),a=e("../../kernel_names"),o=e("../../tensor_util_env");let l=/* @__PURE__ */(0,e("../operation").op)({sparseReshape_:function(e,t,r){let n=(0,o.convertToTensor)(e,"inputIndices","sparseReshape","int32"),l=(0,o.convertToTensor)(t,"inputShape","sparseReshape","int32"),i=(0,o.convertToTensor)(r,"newShape","sparseReshape","int32");if(2!==n.rank)throw Error(`Input indices should be Tensor2D but received shape ${n.shape}`);if(1!==l.rank)throw Error(`Input shape should be Tensor1D but received shape ${l.shape}`);if(1!==i.rank)throw Error(`New shape should be Tensor1D but received shape ${i.shape}`);let u=(0,s.ENGINE).runKernel(a.SparseReshape,{inputIndices:n,inputShape:l,newShape:i});return{outputIndices:u[0],outputShape:u[1]}}})},{"../../engine":"6eJyD","../../kernel_names":"aqvy4","../../tensor_util_env":"g1Qlv","../operation":"2kGjz","@parcel/transformer-js/src/esmodule-helpers.js":"9pCYc"}],bPnbn:[function(e,t,r){/** * @license * Copyright 2021 Google LLC. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. * ============================================================================= */var n=e("@parcel/transformer-js/src/esmodule-helpers.js");n.defineInteropFlag(r),n.export(r,"sparseSegmentMean",()=>l);var s=e("../../engine"),a=e("../../kernel_names"),o=e("../../tensor_util_env");let l=/* @__PURE__ */(0,e("../operation").op)({sparseSegmentMean_:function(e,t,r){let n=(0,o.convertToTensor)(e,"data","sparseSegmentMean"),l=(0,o.convertToTensor)(t,"indices","sparseSegmentMean","int32"),i=(0,o.convertToTensor)(r,"segmentIds","sparseSegmentMean","int32");if(n.rank<1)throw Error("Data should be at least 1 dimensional but received scalar");if(1!==l.rank)throw Error(`Indices should be Tensor1D but received shape ${l.shape}`);if(1!==i.rank)throw Error(`Segment ids should be Tensor1D but received shape ${i.shape}`);return(0,s.ENGINE).runKernel(a.SparseSegmentMean,{data:n,indices:l,segmentIds:i})}})},{"../../engine":"6eJyD","../../kernel_names":"aqvy4","../../tensor_util_env":"g1Qlv","../operation":"2kGjz","@parcel/transformer-js/src/esmodule-helpers.js":"9pCYc"}],kyjdR:[function(e,t,r){/** * @license * Copyright 2021 Google LLC. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. * ============================================================================= */var n=e("@parcel/transformer-js/src/esmodule-helpers.js");n.defineInteropFlag(r),n.export(r,"sparseSegmentSum",()=>l);var s=e("../../engine"),a=e("../../kernel_names"),o=e("../../tensor_util_env");let l=/* @__PURE__ */(0,e("../operation").op)({sparseSegmentSum_:function(e,t,r){let n=(0,o.convertToTensor)(e,"data","sparseSegmentSum"),l=(0,o.convertToTensor)(t,"indices","sparseSegmentSum","int32"),i=(0,o.convertToTensor)(r,"segmentIds","sparseSegmentSum","int32");if(n.rank<1)throw Error("Data should be at least 1 dimensional but received scalar");if(1!==l.rank)throw Error(`Indices should be Tensor1D but received shape ${l.shape}`);if(1!==i.rank)throw Error(`Segment ids should be Tensor1D but received shape ${i.shape}`);return(0,s.ENGINE).runKernel(a.SparseSegmentSum,{data:n,indices:l,segmentIds:i})}})},{"../../engine":"6eJyD","../../kernel_names":"aqvy4","../../tensor_util_env":"g1Qlv","../operation":"2kGjz","@parcel/transformer-js/src/esmodule-helpers.js":"9pCYc"}],jdtAC:[function(e,t,r){/** * @license * Copyright 2021 Google LLC. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. * ============================================================================= */var n=e("@parcel/transformer-js/src/esmodule-helpers.js");n.defineInteropFlag(r),n.export(r,"stringNGrams",()=>l);var s=e("../../engine"),a=e("../../kernel_names"),o=e("../../tensor_util_env");let l=/* @__PURE__ */(0,e("../operation").op)({stringNGrams_:function(e,t,r,n,l,i,u,p){let c=(0,o.convertToTensor)(e,"data","stringNGrams","string");if("string"!==c.dtype)throw Error("Data must be of datatype string");if(1!==c.shape.length)throw Error(`Data must be a vector, saw: ${c.shape}`);let d=(0,o.convertToTensor)(t,"dataSplits","stringNGrams");if("int32"!==d.dtype)throw Error("Data splits must be of datatype int32");let f=(0,s.ENGINE).runKernel(a.StringNGrams,{data:c,dataSplits:d},{separator:r,nGramWidths:n,leftPad:l,rightPad:i,padWidth:u,preserveShortSequences:p});return{nGrams:f[0],nGramsSplits:f[1]}}})},{"../../engine":"6eJyD","../../kernel_names":"aqvy4","../../tensor_util_env":"g1Qlv","../operation":"2kGjz","@parcel/transformer-js/src/esmodule-helpers.js":"9pCYc"}],byxrk:[function(e,t,r){/** * @license * Copyright 2021 Google LLC. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. * ============================================================================= */var n=e("@parcel/transformer-js/src/esmodule-helpers.js");n.defineInteropFlag(r),n.export(r,"stringSplit",()=>l);var s=e("../../engine"),a=e("../../kernel_names"),o=e("../../tensor_util_env");let l=/* @__PURE__ */(0,e("../operation").op)({stringSplit_:function(e,t,r=!0){let n=(0,o.convertToTensor)(e,"input","stringSplit","string"),l=(0,o.convertToTensor)(t,"delimiter","stringSplit","string");if(1!==n.rank)throw Error(`Input should be Tensor1D but received shape ${n.shape}`);if(0!==l.rank)throw Error(`Delimiter should be a scalar but received shape ${l.shape}`);let i=(0,s.ENGINE).runKernel(a.StringSplit,{input:n,delimiter:l},{skipEmpty:r});return{indices:i[0],values:i[1],shape:i[2]}}})},{"../../engine":"6eJyD","../../kernel_names":"aqvy4","../../tensor_util_env":"g1Qlv","../operation":"2kGjz","@parcel/transformer-js/src/esmodule-helpers.js":"9pCYc"}],"38QJ5":[function(e,t,r){/** * @license * Copyright 2021 Google LLC. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. * ============================================================================= */var n=e("@parcel/transformer-js/src/esmodule-helpers.js");n.defineInteropFlag(r),n.export(r,"stringToHashBucketFast",()=>l);var s=e("../../engine"),a=e("../../kernel_names"),o=e("../../tensor_util_env");let l=/* @__PURE__ */(0,e("../operation").op)({stringToHashBucketFast_:function(e,t){let r=(0,o.convertToTensor)(e,"input","stringToHashBucketFast","string");if(t<=0)throw Error("Number of buckets must be at least 1");return(0,s.ENGINE).runKernel(a.StringToHashBucketFast,{input:r},{numBuckets:t})}})},{"../../engine":"6eJyD","../../kernel_names":"aqvy4","../../tensor_util_env":"g1Qlv","../operation":"2kGjz","@parcel/transformer-js/src/esmodule-helpers.js":"9pCYc"}],eTPWG:[function(e,t,r){/** * @license * Copyright 2023 Google LLC. * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. * ============================================================================= */var n=e("@parcel/transformer-js/src/esmodule-helpers.js");n.defineInteropFlag(r),n.export(r,"staticRegexReplace",()=>l);var s=e("../../engine"),a=e("../../kernel_names"),o=e("../../tensor_util_env");let l=/* @__PURE__ */(0,e("../operation").op)({staticRegexReplace_:function(e,t,r,n=!0){let l=(0,o.convertToTensor)(e,"input","staticRegexReplace","string");return(0,s.ENGINE).runKernel(a.StaticRegexReplace,{x:l},{pattern:t,rewrite:r,replaceGlobal:n})}})},{"../../engine":"6eJyD","../../kernel_names":"aqvy4","../../tensor_util_env":"g1Qlv","../operation":"2kGjz","@parcel/transformer-js/src/esmodule-helpers.js":"9pCYc"}],"11gW1":[function(e,t,r){/** * @license * Copyright 2018 Google LLC. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. * ============================================================================= */var n=e("@parcel/transformer-js/src/esmodule-helpers.js");n.defineInteropFlag(r),n.export(r,"Optimizer",()=>i);var s=e("../globals"),a=e("../gradients"),o=e("../ops/ops"),l=e("../serialization");class i extends l.Serializable{minimize(e,t=!1,r){let{value:n,grads:a}=this.computeGradients(e,r);if(null!=r){let e=r.map(e=>({name:e.name,tensor:a[e.name]}));this.applyGradients(e)}else this.applyGradients(a);return((0,s.dispose)(a),t)?n:(n.dispose(),null)}get iterations(){return null==this.iterations_&&(this.iterations_=0),this.iterations_}incrementIterations(){this.iterations_=this.iterations+1}computeGradients(e,t){return(0,a.variableGrads)(e,t)}dispose(){null!=this.iterations_&&(0,s.dispose)(this.iterations_)}async saveIterations(){return null==this.iterations_&&(this.iterations_=0),{name:"iter",tensor:(0,o.scalar)(this.iterations_,"int32")}}async getWeights(){throw Error("getWeights() is not implemented for this optimizer yet.")}async setWeights(e){throw 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(i,Symbol.hasInstance,{value:e=>null!=e.minimize&&null!=e.computeGradients&&null!=e.applyGradients})},{"../globals":"dGn2S","../gradients":"ab8zU","../ops/ops":"hRONF","../serialization":"3Y583","@parcel/transformer-js/src/esmodule-helpers.js":"9pCYc"}],"3Y583":[function(e,t,r){/** * @license * Copyright 2018 Google LLC. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. * ============================================================================= */var n=e("@parcel/transformer-js/src/esmodule-helpers.js");n.defineInteropFlag(r),n.export(r,"Serializable",()=>l),n.export(r,"SerializationMap",()=>i),n.export(r,"registerClass",()=>u),n.export(r,"getRegisteredName",()=>p);var s=e("./util");let a=new Map,o=new Map;class l{getClassName(){return this.constructor.className}static fromConfig(e,t){return new e(t)}}class i{constructor(){this.classNameMap={}}static getMap(){return null==i.instance&&(i.instance=new i),i.instance}static register(e){i.getMap().classNameMap[e.className]=[e,e.fromConfig]}}function u(e,t,r){(0,s.assert)(null!=e.className,()=>"Class being registered does not have the static className property defined."),(0,s.assert)("string"==typeof e.className,()=>"className is required to be a string, but got type "+typeof e.className),(0,s.assert)(e.className.length>0,()=>"Class being registered has an empty-string as its className, which is disallowed."),void 0===t&&(t="Custom"),void 0===r&&(r=e.className);let n=t+">"+r;return i.register(e),a.set(n,e),o.set(e,n),e}function p(e){return o.has(e)?o.get(e):e.className}},{"./util":"gBRMK","@parcel/transformer-js/src/esmodule-helpers.js":"9pCYc"}],f9OX9:[function(e,t,r){/** * @license * Copyright 2018 Google LLC. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. * ============================================================================= */var n=e("@parcel/transformer-js/src/esmodule-helpers.js");n.defineInteropFlag(r),n.export(r,"AdagradOptimizer",()=>f);var s=e("../engine"),a=e("../globals"),o=e("../ops/add"),l=e("../ops/div"),i=e("../ops/fill"),u=e("../ops/mul"),p=e("../ops/sqrt"),c=e("../ops/square"),d=e("./optimizer");class f extends d.Optimizer{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(e=>e.name):Object.keys(e)).forEach((t,r)=>{let n=s.ENGINE.registeredVariables[t];null==this.accumulatedGrads[r]&&(this.accumulatedGrads[r]={originalName:`${t}/accumulator`,variable:(0,a.tidy)(()=>(0,i.fill)(n.shape,this.initialAccumulatorValue).variable(!1))});let d=Array.isArray(e)?e[r].tensor:e[t];if(null==d)return;let f=this.accumulatedGrads[r].variable;(0,a.tidy)(()=>{let e=(0,o.add)(f,(0,c.square)(d));f.assign(e);let t=(0,o.add)((0,u.mul)((0,l.div)(d,(0,p.sqrt)((0,o.add)(e,(0,s.ENGINE).backend.epsilon()))),-this.learningRate),n);n.assign(t)})}),this.incrementIterations()}dispose(){null!=this.accumulatedGrads&&(0,a.dispose)(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),this.accumulatedGrads=e.map(e=>({originalName:e.name,variable:e.tensor.variable(!1)}))}getConfig(){return{learningRate:this.learningRate,initialAccumulatorValue:this.initialAccumulatorValue}}static fromConfig(e,t){return new e(t.learningRate,t.initialAccumulatorValue)}}},{"../engine":"6eJyD","../globals":"dGn2S","../ops/add":"g9v2X","../ops/div":"f7E5D","../ops/fill":"b1ljI","../ops/mul":"gPetX","../ops/sqrt":"kl1Ie","../ops/square":"1Qqi7","./optimizer":"11gW1","@parcel/transformer-js/src/esmodule-helpers.js":"9pCYc"}],i7Li7:[function(e,t,r){/** * @license * Copyright 2018 Google LLC. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. * ============================================================================= */var n=e("@parcel/transformer-js/src/esmodule-helpers.js");n.defineInteropFlag(r),n.export(r,"AdamOptimizer",()=>g);var s=e("../engine"),a=e("../globals"),o=e("../ops/add"),l=e("../ops/div"),i=e("../ops/mul"),u=e("../ops/pow"),p=e("../ops/scalar"),c=e("../ops/sqrt"),d=e("../ops/square"),f=e("../ops/sub"),h=e("../ops/zeros_like"),m=e("./optimizer");class g extends m.Optimizer{static get className(){return"Adam"}constructor(e,t,r,n=null){super(),this.learningRate=e,this.beta1=t,this.beta2=r,this.epsilon=n,this.accumulatedFirstMoment=[],this.accumulatedSecondMoment=[],(0,a.tidy)(()=>{this.accBeta1=(0,p.scalar)(t).variable(),this.accBeta2=(0,p.scalar)(r).variable()}),null==n&&(this.epsilon=(0,s.ENGINE).backend.epsilon())}applyGradients(e){let t=Array.isArray(e)?e.map(e=>e.name):Object.keys(e);(0,a.tidy)(()=>{let r=(0,f.sub)(1,this.accBeta1),n=(0,f.sub)(1,this.accBeta2);t.forEach((t,u)=>{let p=s.ENGINE.registeredVariables[t];null==this.accumulatedFirstMoment[u]&&(this.accumulatedFirstMoment[u]={originalName:`${t}/m`,variable:(0,a.tidy)(()=>(0,h.zerosLike)(p).variable(!1))}),null==this.accumulatedSecondMoment[u]&&(this.accumulatedSecondMoment[u]={originalName:`${t}/v`,variable:(0,a.tidy)(()=>(0,h.zerosLike)(p).variable(!1))});let f=Array.isArray(e)?e[u].tensor:e[t];if(null==f)return;let m=this.accumulatedFirstMoment[u].variable,g=this.accumulatedSecondMoment[u].variable,x=(0,o.add)((0,i.mul)(m,this.beta1),(0,i.mul)(f,1-this.beta1)),v=(0,o.add)((0,i.mul)(g,this.beta2),(0,i.mul)((0,d.square)(f),1-this.beta2)),y=(0,l.div)(x,r),b=(0,l.div)(v,n);m.assign(x),g.assign(v);let _=(0,o.add)((0,i.mul)((0,l.div)(y,(0,o.add)((0,c.sqrt)(b),this.epsilon)),-this.learningRate),p);p.assign(_)}),this.accBeta1.assign((0,i.mul)(this.accBeta1,this.beta1)),this.accBeta2.assign((0,i.mul)(this.accBeta2,this.beta2))}),this.incrementIterations()}dispose(){this.accBeta1.dispose(),this.accBeta2.dispose(),null!=this.accumulatedFirstMoment&&(0,a.dispose)(this.accumulatedFirstMoment.map(e=>e.variable)),null!=this.accumulatedSecondMoment&&(0,a.dispose)(this.accumulatedSecondMoment.map(e=>e.variable))}async getWeights(){let e=[...this.accumulatedFirstMoment,...this.accumulatedSecondMoment];return[await this.saveIterations()].concat(e.map(e=>({name:e.originalName,tensor:e.variable})))}async setWeights(e){e=await this.extractIterations(e),(0,a.tidy)(()=>{this.accBeta1.assign((0,u.pow)(this.beta1,this.iterations_+1)),this.accBeta2.assign((0,u.pow)(this.beta2,this.iterations_+1))});let t=e.length/2;this.accumulatedFirstMoment=e.slice(0,t).map(e=>({originalName:e.name,variable:e.tensor.variable(!1)})),this.accumulatedSecondMoment=e.slice(t,2*t).map(e=>({originalName:e.name,variable:e.tensor.variable(!1)}))}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)}}},{"../engine":"6eJyD","../globals":"dGn2S","../ops/add":"g9v2X","../ops/div":"f7E5D","../ops/mul":"gPetX","../ops/pow":"cL5Hc","../ops/scalar":"53j04","../ops/sqrt":"kl1Ie","../ops/square":"1Qqi7","../ops/sub":"cQqL3","../ops/zeros_like":"gjKam","./optimizer":"11gW1","@parcel/transformer-js/src/esmodule-helpers.js":"9pCYc"}],gb2az:[function(e,t,r){/** * @license * Copyright 2018 Google LLC. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. * ============================================================================= */var n=e("@parcel/transformer-js/src/esmodule-helpers.js");n.defineInteropFlag(r),n.export(r,"AdamaxOptimizer",()=>m);var s=e("../engine"),a=e("../globals"),o=e("../ops/abs"),l=e("../ops/add"),i=e("../ops/div"),u=e("../ops/maximum"),p=e("../ops/mul"),c=e("../ops/scalar"),d=e("../ops/sub"),f=e("../ops/zeros_like"),h=e("./optimizer");class m extends h.Optimizer{static get className(){return"Adamax"}constructor(e,t,r,n=null,o=0){super(),this.learningRate=e,this.beta1=t,this.beta2=r,this.epsilon=n,this.decay=o,this.accumulatedFirstMoment=[],this.accumulatedWeightedInfNorm=[],(0,a.tidy)(()=>{this.iteration=(0,c.scalar)(0).variable(),this.accBeta1=(0,c.scalar)(t).variable()}),null==n&&(this.epsilon=(0,s.ENGINE).backend.epsilon())}applyGradients(e){let t=Array.isArray(e)?e.map(e=>e.name):Object.keys(e);(0,a.tidy)(()=>{let r=(0,d.sub)(1,this.accBeta1),n=(0,i.div)(-this.learningRate,(0,l.add)((0,p.mul)(this.iteration,this.decay),1));t.forEach((t,a)=>{let c=s.ENGINE.registeredVariables[t];null==this.accumulatedFirstMoment[a]&&(this.accumulatedFirstMoment[a]={originalName:`${t}/m`,variable:(0,f.zerosLike)(c).variable(!1)}),null==this.accumulatedWeightedInfNorm[a]&&(this.accumulatedWeightedInfNorm[a]={originalName:`${t}/v`,variable:(0,f.zerosLike)(c).variable(!1)});let d=Array.isArray(e)?e[a].tensor:e[t];if(null==d)return;let h=this.accumulatedFirstMoment[a].variable,m=this.accumulatedWeightedInfNorm[a].variable,g=(0,l.add)((0,p.mul)(h,this.beta1),(0,p.mul)(d,1-this.beta1)),x=(0,p.mul)(m,this.beta2),v=(0,o.abs)(d),y=(0,u.maximum)(x,v);h.assign(g),m.assign(y);let b=(0,l.add)((0,p.mul)((0,i.div)(n,r),(0,i.div)(g,(0,l.add)(y,this.epsilon))),c);c.assign(b)}),this.iteration.assign((0,l.add)(this.iteration,1)),this.accBeta1.assign((0,p.mul)(this.accBeta1,this.beta1))}),this.incrementIterations()}dispose(){this.accBeta1.dispose(),this.iteration.dispose(),null!=this.accumulatedFirstMoment&&(0,a.dispose)(this.accumulatedFirstMoment.map(e=>e.variable)),null!=this.accumulatedWeightedInfNorm&&(0,a.dispose)(this.accumulatedWeightedInfNorm.map(e=>e.variable))}async getWeights(){throw Error("getWeights() is not implemented for Adamax yet.")}async setWeights(e){throw 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)}}},{"../engine":"6eJyD","../globals":"dGn2S","../ops/abs":"3JIEu","../ops/add":"g9v2X","../ops/div":"f7E5D","../ops/maximum":"dq98s","../ops/mul":"gPetX","../ops/scalar":"53j04","../ops/sub":"cQqL3","../ops/zeros_like":"gjKam","./optimizer":"11gW1","@parcel/transformer-js/src/esmodule-helpers.js":"9pCYc"}],ka4Mb:[function(e,t,r){/** * @license * Copyright 2018 Google LLC. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. * ============================================================================= */var n=e("@parcel/transformer-js/src/esmodule-helpers.js");n.defineInteropFlag(r),n.export(r,"MomentumOptimizer",()=>c);var s=e("../engine"),a=e("../globals"),o=e("../ops/add"),l=e("../ops/mul"),i=e("../ops/scalar"),u=e("../ops/zeros_like"),p=e("./sgd_optimizer");class c extends p.SGDOptimizer{static get className(){return"Momentum"}constructor(e,t,r=!1){super(e),this.learningRate=e,this.momentum=t,this.useNesterov=r,this.accumulations=[],this.m=(0,i.scalar)(this.momentum)}applyGradients(e){(Array.isArray(e)?e.map(e=>e.name):Object.keys(e)).forEach((t,r)=>{let n=s.ENGINE.registeredVariables[t];null==this.accumulations[r]&&(this.accumulations[r]={originalName:`${t}/momentum`,variable:(0,a.tidy)(()=>(0,u.zerosLike)(n).variable(!1))});let i=this.accumulations[r].variable,p=Array.isArray(e)?e[r].tensor:e[t];null!=p&&(0,a.tidy)(()=>{let e;let t=(0,o.add)((0,l.mul)(this.m,i),p);e=this.useNesterov?(0,o.add)((0,l.mul)(this.c,(0,o.add)(p,(0,l.mul)(t,this.m))),n):(0,o.add)((0,l.mul)(this.c,t),n),i.assign(t),n.assign(e)})}),this.incrementIterations()}dispose(){this.m.dispose(),null!=this.accumulations&&(0,a.dispose)(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),this.accumulations=e.map(e=>({originalName:e.name,variable:e.tensor.variable(!1)}))}getConfig(){return{learningRate:this.learningRate,momentum:this.momentum,useNesterov:this.useNesterov}}static fromConfig(e,t){return new e(t.learningRate,t.momentum,t.useNesterov)}}},{"../engine":"6eJyD","../globals":"dGn2S","../ops/add":"g9v2X","../ops/mul":"gPetX","../ops/scalar":"53j04","../ops/zeros_like":"gjKam","./sgd_optimizer":"aaxfI","@parcel/transformer-js/src/esmodule-helpers.js":"9pCYc"}],aaxfI:[function(e,t,r){/** * @license * Copyright 2018 Google LLC. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. * ============================================================================= */var n=e("@parcel/transformer-js/src/esmodule-helpers.js");n.defineInteropFlag(r),n.export(r,"SGDOptimizer",()=>p);var s=e("../engine"),a=e("../globals"),o=e("../ops/add"),l=e("../ops/mul"),i=e("../ops/scalar"),u=e("./optimizer");class p extends u.Optimizer{static get className(){return"SGD"}constructor(e){super(),this.learningRate=e,this.setLearningRate(e)}applyGradients(e){(Array.isArray(e)?e.map(e=>e.name):Object.keys(e)).forEach((t,r)=>{let n=Array.isArray(e)?e[r].tensor:e[t];if(null==n)return;let i=s.ENGINE.registeredVariables[t];(0,a.tidy)(()=>{let e=(0,o.add)((0,l.mul)(this.c,n),i);i.assign(e)})}),this.incrementIterations()}setLearningRate(e){this.learningRate=e,null!=this.c&&this.c.dispose(),this.c=(0,a.keep)((0,i.scalar)(-e))}dispose(){this.c.dispose()}async getWeights(){return[await this.saveIterations()]}async setWeights(e){if(0!==(e=await this.extractIterations(e)).length)throw Error("SGD optimizer does not have settable weights.")}getConfig(){return{learningRate:this.learningRate}}static fromConfig(e,t){return new e(t.learningRate)}}},{"../engine":"6eJyD","../globals":"dGn2S","../ops/add":"g9v2X","../ops/mul":"gPetX","../ops/scalar":"53j04","./optimizer":"11gW1","@parcel/transformer-js/src/esmodule-helpers.js":"9pCYc"}],iwr1K:[function(e,t,r){/** * @license * Copyright 2018 Google LLC. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. * ============================================================================= */var n=e("@parcel/transformer-js/src/esmodule-helpers.js");n.defineInteropFlag(r),n.export(r,"RMSPropOptimizer",()=>h);var s=e("../engine"),a=e("../globals"),o=e("../ops/add"),l=e("../ops/div"),i=e("../ops/mul"),u=e("../ops/sqrt"),p=e("../ops/square"),c=e("../ops/sub"),d=e("../ops/zeros_like"),f=e("./optimizer");class h extends f.Optimizer{static get className(){return"RMSProp"}constructor(e,t=.9,r=0,n=null,a=!1){if(super(),this.learningRate=e,this.decay=t,this.momentum=r,this.epsilon=n,this.accumulatedMeanSquares=[],this.accumulatedMoments=[],this.accumulatedMeanGrads=[],this.centered=a,null==n&&(this.epsilon=(0,s.ENGINE).backend.epsilon()),null==e)throw Error("learningRate for RMSPropOptimizer must be defined.")}applyGradients(e){(Array.isArray(e)?e.map(e=>e.name):Object.keys(e)).forEach((t,r)=>{let n=s.ENGINE.registeredVariables[t];null==this.accumulatedMeanSquares[r]&&(this.accumulatedMeanSquares[r]={originalName:`${t}/rms`,variable:(0,a.tidy)(()=>(0,d.zerosLike)(n).variable(!1))}),null==this.accumulatedMoments[r]&&(this.accumulatedMoments[r]={originalName:`${t}/momentum`,variable:(0,a.tidy)(()=>(0,d.zerosLike)(n).variable(!1))}),null==this.accumulatedMeanGrads[r]&&this.centered&&(this.accumulatedMeanGrads[r]={originalName:`${t}/mg`,variable:(0,a.tidy)(()=>(0,d.zerosLike)(n).variable(!1))});let f=Array.isArray(e)?e[r].tensor:e[t];if(null==f)return;let h=this.accumulatedMeanSquares[r].variable,m=this.accumulatedMoments[r].variable;(0,a.tidy)(()=>{let e=(0,o.add)((0,i.mul)(h,this.decay),(0,i.mul)((0,p.square)(f),1-this.decay));if(this.centered){let t=this.accumulatedMeanGrads[r].variable,s=(0,o.add)((0,i.mul)(t,this.decay),(0,i.mul)(f,1-this.decay)),a=(0,l.div)((0,i.mul)(f,this.learningRate),(0,u.sqrt)((0,c.sub)(e,(0,o.add)((0,p.square)(s),this.epsilon)))),d=(0,o.add)((0,i.mul)(m,this.momentum),a);h.assign(e),t.assign(s),m.assign(d);let g=(0,c.sub)(n,d);n.assign(g)}else{let e=(0,o.add)((0,i.mul)(h,this.decay),(0,i.mul)((0,p.square)(f),1-this.decay)),t=(0,o.add)((0,i.mul)(m,this.momentum),(0,l.div)((0,i.mul)(f,this.learningRate),(0,u.sqrt)((0,o.add)(e,this.epsilon))));h.assign(e),m.assign(t);let r=(0,c.sub)(n,t);n.assign(r)}})}),this.incrementIterations()}dispose(){null!=this.accumulatedMeanSquares&&(0,a.dispose)(this.accumulatedMeanSquares.map(e=>e.variable)),null!=this.accumulatedMeanGrads&&this.centered&&(0,a.dispose)(this.accumulatedMeanGrads.map(e=>e.variable)),null!=this.accumulatedMoments&&(0,a.dispose)(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(e=>({name:e.originalName,tensor:e.variable})))}async setWeights(e){e=await this.extractIterations(e);let t=this.centered?e.length/3:e.length/2;this.accumulatedMeanSquares=e.slice(0,t).map(e=>({originalName:e.name,variable:e.tensor.variable(!1)})),this.accumulatedMoments=e.slice(t,2*t).map(e=>({originalName:e.name,variable:e.tensor.variable(!1)})),this.centered&&(this.accumulatedMeanGrads=e.slice(2*t,3*t).map(e=>({originalName:e.name,variable:e.tensor.variable(!1)})))}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)}}},{"../engine":"6eJyD","../globals":"dGn2S","../ops/add":"g9v2X","../ops/div":"f7E5D","../ops/mul":"gPetX","../ops/sqrt":"kl1Ie","../ops/square":"1Qqi7","../ops/sub":"cQqL3","../ops/zeros_like":"gjKam","./optimizer":"11gW1","@parcel/transformer-js/src/esmodule-helpers.js":"9pCYc"}],gbLpv:[function(e,t,r){/** * @license * Copyright 2020 Google Inc. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. * ============================================================================= */var n=e("@parcel/transformer-js/src/esmodule-helpers.js");n.defineInteropFlag(r),n.export(r,"AdadeltaOptimizer",()=>g.AdadeltaOptimizer),n.export(r,"AdagradOptimizer",()=>x.AdagradOptimizer),n.export(r,"AdamOptimizer",()=>v.AdamOptimizer),n.export(r,"AdamaxOptimizer",()=>y.AdamaxOptimizer),n.export(r,"MomentumOptimizer",()=>b.MomentumOptimizer),n.export(r,"Optimizer",()=>_.Optimizer),n.export(r,"OptimizerConstructors",()=>k.OptimizerConstructors),n.export(r,"RMSPropOptimizer",()=>j.RMSPropOptimizer),n.export(r,"SGDOptimizer",()=>I.SGDOptimizer),n.export(r,"Tensor",()=>C.Tensor),n.export(r,"TensorBuffer",()=>C.TensorBuffer),n.export(r,"Variable",()=>C.Variable),n.export(r,"Rank",()=>w.Rank),n.export(r,"sumOutType",()=>w.sumOutType),n.export(r,"upcastType",()=>w.upcastType),n.export(r,"Reduction",()=>S.Reduction),n.export(r,"customGrad",()=>R.customGrad),n.export(r,"grad",()=>R.grad),n.export(r,"grads",()=>R.grads),n.export(r,"valueAndGrad",()=>R.valueAndGrad),n.export(r,"valueAndGrads",()=>R.valueAndGrads),n.export(r,"variableGrads",()=>R.variableGrads),n.export(r,"Environment",()=>A.Environment),n.export(r,"env",()=>A.env),n.export(r,"ENV",()=>A.ENV),n.export(r,"nextFrame",()=>P.nextFrame),n.export(r,"KernelBackend",()=>O.KernelBackend),n.export(r,"DataStorage",()=>O.DataStorage),n.export(r,"version_core",()=>m.version),n.export(r,"browser",()=>l),n.export(r,"io",()=>s),n.export(r,"math",()=>a),n.export(r,"serialization",()=>c),n.export(r,"test_util",()=>f),n.export(r,"util",()=>h),n.export(r,"backend_util",()=>D),n.export(r,"broadcast_util",()=>o),n.export(r,"tensor_util",()=>d),n.export(r,"slice_util",()=>p),n.export(r,"gather_util",()=>i),n.export(r,"scatter_util",()=>u),n.export(r,"device_util",()=>$),n.export(r,"kernel_impls",()=>M);var s=e("./io/io"),a=e("./math"),o=e("./ops/broadcast_util"),l=e("./ops/browser"),i=e("./ops/gather_nd_util"),u=e("./ops/scatter_nd_util"),p=e("./ops/slice_util"),c=e("./serialization"),d=e("./tensor_util"),f=e("./test_util"),h=e("./util"),m=e("./version"),g=e("./optimizers/adadelta_optimizer"),x=e("./optimizers/adagrad_optimizer"),v=e("./optimizers/adam_optimizer"),y=e("./optimizers/adamax_optimizer"),b=e("./optimizers/momentum_optimizer"),_=e("./optimizers/optimizer"),k=e("./optimizers/optimizer_constructors"),j=e("./optimizers/rmsprop_optimizer"),I=e("./optimizers/sgd_optimizer"),C=e("./tensor"),w=e("./types"),T=e("./ops/ops");n.exportAll(T,r);var S=e("./ops/loss_ops_utils"),N=e("./train");n.exportAll(N,r);var E=e("./globals");n.exportAll(E,r);var F=e("./kernel_registry");n.exportAll(F,r);var R=e("./gradients"),A=e("./environment"),P=e("./browser_util"),D=e("./backends/backend_util"),$=e("./device_util"),M=e("./backends/kernel_impls"),O=e("./backends/backend"),V=e("./kernel_names");n.exportAll(V,r)},{"./io/io":"Zt59H","./math":"g4Szd","./ops/broadcast_util":"aouH8","./ops/browser":"2OU0B","./ops/gather_nd_util":"cFmDZ","./ops/scatter_nd_util":"1SOU1","./ops/slice_util":"l9lGg","./serialization":"3Y583","./tensor_util":"jgr40","./test_util":"hQHzA","./util":"gBRMK","./version":"8GskL","./optimizers/adadelta_optimizer":"1rtJl","./optimizers/adagrad_optimizer":"f9OX9","./optimizers/adam_optimizer":"i7Li7","./optimizers/adamax_optimizer":"gb2az","./optimizers/momentum_optimizer":"ka4Mb","./optimizers/optimizer":"11gW1","./optimizers/optimizer_constructors":"gVc89","./optimizers/rmsprop_optimizer":"iwr1K","./optimizers/sgd_optimizer":"aaxfI","./tensor":"cZ8UW","./types":"ahcVG","./ops/ops":"hRONF","./ops/loss_ops_utils":"5Eo2w","./train":"lRIoY","./globals":"dGn2S","./kernel_registry":"kQKsU","./gradients":"ab8zU","./environment":"i6ZjF","./browser_util":"a4Cf9","./backends/backend_util":"el7sG","./device_util":"b0HdX","./backends/kernel_impls":"onQC9","./backends/backend":"dsi8D","./kernel_names":"aqvy4","@parcel/transformer-js/src/esmodule-helpers.js":"9pCYc"}],Zt59H:[function(e,t,r){/** * @license * Copyright 2018 Google LLC. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. * ============================================================================= */var n=e("@parcel/transformer-js/src/esmodule-helpers.js");n.defineInteropFlag(r),n.export(r,"copyModel",()=>c.copyModel),n.export(r,"listModels",()=>c.listModels),n.export(r,"moveModel",()=>c.moveModel),n.export(r,"removeModel",()=>c.removeModel),n.export(r,"browserFiles",()=>s.browserFiles),n.export(r,"browserHTTPRequest",()=>a.browserHTTPRequest),n.export(r,"CompositeArrayBuffer",()=>p.CompositeArrayBuffer),n.export(r,"concatenateArrayBuffers",()=>o.concatenateArrayBuffers),n.export(r,"decodeWeights",()=>o.decodeWeights),n.export(r,"decodeWeightsStream",()=>o.decodeWeightsStream),n.export(r,"encodeWeights",()=>o.encodeWeights),n.export(r,"fromMemory",()=>l.fromMemory),n.export(r,"fromMemorySync",()=>l.fromMemorySync),n.export(r,"getLoadHandlers",()=>i.getLoadHandlers),n.export(r,"getModelArtifactsForJSON",()=>o.getModelArtifactsForJSON),n.export(r,"getModelArtifactsForJSONSync",()=>o.getModelArtifactsForJSONSync),n.export(r,"getModelArtifactsInfoForJSON",()=>o.getModelArtifactsInfoForJSON),n.export(r,"getSaveHandlers",()=>i.getSaveHandlers),n.export(r,"getWeightSpecs",()=>o.getWeightSpecs),n.export(r,"http",()=>a.http),n.export(r,"isHTTPScheme",()=>a.isHTTPScheme),n.export(r,"loadWeights",()=>u.loadWeights),n.export(r,"registerLoadRouter",()=>i.registerLoadRouter),n.export(r,"registerSaveRouter",()=>i.registerSaveRouter),n.export(r,"weightsLoaderFactory",()=>u.weightsLoaderFactory),n.export(r,"withSaveHandler",()=>l.withSaveHandler),n.export(r,"withSaveHandlerSync",()=>l.withSaveHandlerSync),e("./indexed_db"),e("./local_storage");var s=e("./browser_files"),a=e("./http"),o=e("./io_utils"),l=e("./passthrough"),i=e("./router_registry"),u=e("./weights_loader"),p=e("./composite_array_buffer"),c=e("./model_management")},{"./indexed_db":"jPhj2","./local_storage":"jio7e","./browser_files":"wwTuM","./http":"jxT4C","./io_utils":"dJfQ0","./passthrough":"1ILH2","./router_registry":"570tD","./weights_loader":"aam3R","./composite_array_buffer":"gCHLD","./model_management":"9ce9v","@parcel/transformer-js/src/esmodule-helpers.js":"9pCYc"}],wwTuM:[function(e,t,r){/** * @license * Copyright 2018 Google LLC. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. * ============================================================================= */var n=e("@parcel/transformer-js/src/esmodule-helpers.js");n.defineInteropFlag(r),n.export(r,"BrowserDownloads",()=>u),n.export(r,"browserDownloadsRouter",()=>c),n.export(r,"browserDownloads",()=>d),n.export(r,"browserFiles",()=>f),e("../flags");var s=e("../environment"),a=e("./io_utils"),o=e("./router_registry"),l=e("./composite_array_buffer");function i(e){return new Promise(e=>setTimeout(e)).then(e)}class u{constructor(e){if(!(0,s.env)().getBool("IS_BROWSER"))throw Error("browserDownloads() cannot proceed because the current environment is not a browser.");e.startsWith(u.URL_SCHEME)&&(e=e.slice(u.URL_SCHEME.length)),(null==e||0===e.length)&&(e="model"),this.modelJsonFileName=e+".json",this.weightDataFileName=e+".weights.bin"}async save(e){if("undefined"==typeof document)throw Error("Browser downloads are not supported in this environment since `document` is not present");let t=(0,l.CompositeArrayBuffer).join(e.weightData),r=window.URL.createObjectURL(new Blob([t],{type:"application/octet-stream"}));if(e.modelTopology instanceof ArrayBuffer)throw Error("BrowserDownloads.save() does not support saving model topology in binary formats yet.");{let t=[{paths:["./"+this.weightDataFileName],weights:e.weightSpecs}],n=(0,a.getModelJSONForModelArtifacts)(e,t),s=window.URL.createObjectURL(new Blob([JSON.stringify(n)],{type:"application/json"})),o=null==this.modelJsonAnchor?document.createElement("a"):this.modelJsonAnchor;if(o.download=this.modelJsonFileName,o.href=s,await i(()=>o.dispatchEvent(new MouseEvent("click"))),null!=e.weightData){let e=null==this.weightDataAnchor?document.createElement("a"):this.weightDataAnchor;e.download=this.weightDataFileName,e.href=r,await i(()=>e.dispatchEvent(new MouseEvent("click")))}return{modelArtifactsInfo:(0,a.getModelArtifactsInfoForJSON)(e)}}}}u.URL_SCHEME="downloads://";class p{constructor(e){if(null==e||e.length<1)throw 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 r=new FileReader;r.onload=r=>{let n=JSON.parse(r.target.result),s=n.modelTopology;if(null==s){t(Error(`modelTopology field is missing from file ${this.jsonFile.name}`));return}if(null==n.weightsManifest){t(Error(`weightManifest field is missing from file ${this.jsonFile.name}`));return}if(0===this.weightsFiles.length){e({modelTopology:s});return}e((0,a.getModelArtifactsForJSON)(n,e=>this.loadWeights(e)))},r.onerror=e=>t(`Failed to read model topology and weights manifest JSON from file '${this.jsonFile.name}'. BrowserFiles supports loading Keras-style tf.Model artifacts only.`),r.readAsText(this.jsonFile)})}loadWeights(e){let t=[],r=[];for(let n of e)t.push(...n.weights),r.push(...n.paths);let n=this.checkManifestAndWeightFiles(e);return Promise.all(r.map(e=>this.loadWeightsFile(e,n[e]))).then(e=>[t,e])}loadWeightsFile(e,t){return new Promise((r,n)=>{let s=new FileReader;s.onload=e=>{r(e.target.result)},s.onerror=t=>n(`Failed to weights data from file of path '${e}'.`),s.readAsArrayBuffer(t)})}checkManifestAndWeightFiles(e){let t=[],r=this.weightsFiles.map(e=>(0,a.basename)(e.name)),n={};for(let s of e)s.paths.forEach(e=>{let s=(0,a.basename)(e);if(-1!==t.indexOf(s))throw Error(`Duplicate file basename found in weights manifest: '${s}'`);if(t.push(s),-1===r.indexOf(s))throw Error(`Weight file with basename '${s}' is not provided.`);n[e]=this.weightsFiles[r.indexOf(s)]});if(t.length!==this.weightsFiles.length)throw Error(`Mismatch in the number of files in weights manifest (${t.length}) and the number of weight files provided (${this.weightsFiles.length}).`);return n}}let c=e=>(0,s.env)().getBool("IS_BROWSER")&&!Array.isArray(e)&&e.startsWith(u.URL_SCHEME)?d(e.slice(u.URL_SCHEME.length)):null;function d(e="model"){return new u(e)}function f(e){return new p(e)}(0,o.IORouterRegistry).registerSaveRouter(c)},{"../flags":"dT8ve","../environment":"i6ZjF","./io_utils":"dJfQ0","./router_registry":"570tD","./composite_array_buffer":"gCHLD","@parcel/transformer-js/src/esmodule-helpers.js":"9pCYc"}],jxT4C:[function(e,t,r){/** * @license * Copyright 2018 Google LLC. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. * ============================================================================= */var n=e("@parcel/transformer-js/src/esmodule-helpers.js");n.defineInteropFlag(r),n.export(r,"HTTPRequest",()=>p),n.export(r,"parseUrl",()=>c),n.export(r,"isHTTPScheme",()=>d),n.export(r,"httpRouter",()=>f),n.export(r,"http",()=>h),n.export(r,"browserHTTPRequest",()=>m);var s=e("../environment"),a=e("../util"),o=e("./io_utils"),l=e("./composite_array_buffer"),i=e("./router_registry"),u=e("./weights_loader");class p{constructor(e,t){if(this.DEFAULT_METHOD="POST",null==t&&(t={}),this.weightPathPrefix=t.weightPathPrefix,this.weightUrlConverter=t.weightUrlConverter,null!=t.fetchFunc?((0,a.assert)("function"==typeof t.fetchFunc,()=>"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=(0,s.env)().platform.fetch,(0,a.assert)(null!=e&&e.length>0,()=>"URL path for http must not be null, undefined or empty."),Array.isArray(e)&&(0,a.assert)(2===e.length,()=>`URL paths for http must have a length of 2, (actual length is ${e.length}).`),this.path=e,null!=t.requestInit&&null!=t.requestInit.body)throw 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 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 r=[{paths:["./model.weights.bin"],weights:e.weightSpecs}],n=(0,o.getModelJSONForModelArtifacts)(e,r);if(t.body.append("model.json",new Blob([JSON.stringify(n)],{type:"application/json"}),"model.json"),null!=e.weightData){let r=(0,l.CompositeArrayBuffer).join(e.weightData);t.body.append("model.weights.bin",new Blob([r],{type:"application/octet-stream"}),"model.weights.bin")}let s=await this.fetch(this.path,t);if(s.ok)return{modelArtifactsInfo:(0,o.getModelArtifactsInfoForJSON)(e),responses:[s]};throw Error(`BrowserHTTPRequest.save() failed due to HTTP response status ${s.status}.`)}async loadModelJSON(){let e;let t=await this.fetch(this.path,this.requestInit);if(!t.ok)throw 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.`);try{e=await t.json()}catch(t){let e=`Failed to parse model JSON of response from ${this.path}.`;throw this.path.endsWith(".pb")?e+=" 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.":e+=" Please make sure the server is serving valid JSON for this request.",Error(e)}let r=e.modelTopology,n=e.weightsManifest;if(null==r&&null==n)throw Error(`The JSON from HTTP path ${this.path} contains neither model topology or manifest for weights.`);return e}async load(){if(this.loadOptions.streamWeights)return this.loadStream();let e=await this.loadModelJSON();return(0,o.getModelArtifactsForJSON)(e,e=>this.loadWeights(e))}async loadStream(){let e=await this.loadModelJSON(),t=await this.getWeightUrls(e.weightsManifest),r=(0,o.getWeightSpecs)(e.weightsManifest);return Object.assign(Object.assign({},e),{weightSpecs:r,getWeightStream:()=>(0,u.streamWeights)(t,this.loadOptions)})}async getWeightUrls(e){let[t,r]=c(Array.isArray(this.path)?this.path[1]:this.path),n=this.weightPathPrefix||t,s=[],a=[];for(let t of e)for(let e of t.paths)null!=this.weightUrlConverter?a.push(this.weightUrlConverter(e)):s.push(n+e+r);return this.weightUrlConverter&&s.push(...await Promise.all(a)),s}async loadWeights(e){let t=await this.getWeightUrls(e);return[(0,o.getWeightSpecs)(e),await (0,u.loadWeightsAsArrayBuffer)(t,this.loadOptions)]}}function c(e){let t=e.lastIndexOf("/"),r=e.lastIndexOf("?");return[e.substring(0,t)+"/",r>t?e.substring(r):""]}function d(e){return null!=e.match(p.URL_SCHEME_REGEX)}p.URL_SCHEME_REGEX=/^https?:\/\//;let f=(e,t)=>{if("undefined"==typeof fetch&&(null==t||null==t.fetchFunc));else if(Array.isArray(e)?e.every(e=>d(e)):d(e))return h(e,t);return null};function h(e,t){return new p(e,t)}function m(e,t){return h(e,t)}(0,i.IORouterRegistry).registerSaveRouter(f),(0,i.IORouterRegistry).registerLoadRouter(f)},{"../environment":"i6ZjF","../util":"gBRMK","./io_utils":"dJfQ0","./composite_array_buffer":"gCHLD","./router_registry":"570tD","./weights_loader":"aam3R","@parcel/transformer-js/src/esmodule-helpers.js":"9pCYc"}],aam3R:[function(e,t,r){/** * @license * Copyright 2018 Google LLC. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. * ============================================================================= */var n=e("@parcel/transformer-js/src/esmodule-helpers.js");n.defineInteropFlag(r),n.export(r,"loadWeightsAsArrayBuffer",()=>p),n.export(r,"streamWeights",()=>c),n.export(r,"loadWeights",()=>d),n.export(r,"weightsLoaderFactory",()=>f);var s=e("../environment"),a=e("../util"),o=e("./composite_array_buffer"),l=e("./io_utils"),i=e("./progress"),u=e("./types");async function p(e,t){null==t&&(t={});let r=null==t.fetchFunc?(0,s.env)().platform.fetch:t.fetchFunc,n=e.map(e=>r(e,t.requestInit,{isBinary:!0})),a=(null==t.onProgress?await Promise.all(n):await (0,i.monitorPromisesProgress)(n,t.onProgress,0,.5)).map(e=>e.arrayBuffer());return null==t.onProgress?await Promise.all(a):await (0,i.monitorPromisesProgress)(a,t.onProgress,.5,1)}function c(e,t){var r;let n;let a=null==t.fetchFunc?(0,s.env)().platform.fetch:t.fetchFunc,o=0;return null===(r=t.onProgress)||void 0===r||r.call(t,0),new ReadableStream({pull:async r=>{for(var s;op(e,{requestInit:n}))(e,t,r)}function f(e){return async(t,r="",n)=>{let s=t.map(()=>!1),i={},p=null!=n?n.map(()=>!1):[],c=[];if(t.forEach((e,t)=>{let r=0;e.weights.forEach(e=>{let o="quantization"in e?e.quantization.dtype:e.dtype,l=u.DTYPE_VALUE_SIZE_MAP[o]*a.sizeFromShape(e.shape),d=()=>{s[t]=!0,null==i[t]&&(i[t]=[]),i[t].push({manifestEntry:e,groupOffset:r,sizeBytes:l})};null!=n?n.forEach((t,r)=>{t===e.name&&(d(),p[r]=!0)}):d(),c.push(e.name),r+=l})}),!p.every(e=>e)){let e=n.filter((e,t)=>!p[t]);throw Error(`Could not find weights in manifest with names: ${e.join(", ")}. Manifest JSON has weights with names: ${c.join(", ")}.`)}let d=s.reduce((e,t,r)=>(t&&e.push(r),e),[]),f=[];d.forEach(e=>{t[e].paths.forEach(e=>{let t=r+(r.endsWith("/")?"":"/")+e;f.push(t)})});let h=await e(f),m={},g=0;return d.forEach(e=>{let r=t[e].paths.length,n=new o.CompositeArrayBuffer(h.slice(g,g+r));i[e].forEach(e=>{let t=n.slice(e.groupOffset,e.groupOffset+e.sizeBytes),r=(0,l.decodeWeights)(t,[e.manifestEntry]);for(let e in r)m[e]=r[e]}),g+=r}),m}}},{"../environment":"i6ZjF","../util":"gBRMK","./composite_array_buffer":"gCHLD","./io_utils":"dJfQ0","./progress":"gDBys","./types":"kDVFi","@parcel/transformer-js/src/esmodule-helpers.js":"9pCYc"}],gDBys:[function(e,t,r){/** * @license * Copyright 2019 Google LLC. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. * ============================================================================= */var n=e("@parcel/transformer-js/src/esmodule-helpers.js");n.defineInteropFlag(r),n.export(r,"monitorPromisesProgress",()=>a);var s=e("../util");function a(e,t,r,n){var a,o;(0,s.assert)(null!=e&&Array.isArray(e)&&e.length>0,()=>"promises must be a none empty array"),a=r=null==r?0:r,o=n=null==n?1:n,(0,s.assert)(a>=0&&a<=1,()=>`Progress fraction must be in range [0, 1], but got startFraction ${a}`),(0,s.assert)(o>=0&&o<=1,()=>`Progress fraction must be in range [0, 1], but got endFraction ${o}`),(0,s.assert)(o>=a,()=>`startFraction must be no more than endFraction, but got startFraction ${a} and endFraction ${o}`);let l=0;return Promise.all(e.map(s=>(s.then(s=>(t(r+ ++l/e.length*(n-r)),s)),s)))}},{"../util":"gBRMK","@parcel/transformer-js/src/esmodule-helpers.js":"9pCYc"}],"1ILH2":[function(e,t,r){/** * @license * Copyright 2018 Google LLC. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. * ============================================================================= */var n=e("@parcel/transformer-js/src/esmodule-helpers.js");n.defineInteropFlag(r),n.export(r,"fromMemory",()=>l),n.export(r,"fromMemorySync",()=>i),n.export(r,"withSaveHandler",()=>u),n.export(r,"withSaveHandlerSync",()=>p);class s{constructor(e){this.modelArtifacts=e}load(){return this.modelArtifacts}}class a{constructor(e){this.saveHandler=e}save(e){return this.saveHandler(e)}}class o{constructor(e){e.load&&(this.load=()=>Promise.resolve(e.load())),e.save&&(this.save=t=>Promise.resolve(e.save(t)))}}function l(e,t,r,n){let s=arguments;return new o(i(...s))}function i(e,t,r,n){return 1!=arguments.length?(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 s({modelTopology:e,weightSpecs:t,weightData:r,trainingConfig:n})):null!=e.modelTopology||null!=e.weightSpecs?new s(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 s({modelTopology:e}))}function u(e){return new a(e)}function p(e){return new a(e)}},{"@parcel/transformer-js/src/esmodule-helpers.js":"9pCYc"}],g4Szd:[function(e,t,r){/** * @license * Copyright 2018 Google LLC. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. * ============================================================================= */var n=e("@parcel/transformer-js/src/esmodule-helpers.js");n.defineInteropFlag(r),n.export(r,"confusionMatrix",()=>s.confusionMatrix);var s=e("./ops/confusion_matrix")},{"./ops/confusion_matrix":"iUaNe","@parcel/transformer-js/src/esmodule-helpers.js":"9pCYc"}],iUaNe:[function(e,t,r){/** * @license * Copyright 2018 Google LLC. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. * ============================================================================= */var n=e("@parcel/transformer-js/src/esmodule-helpers.js");n.defineInteropFlag(r),n.export(r,"confusionMatrix_",()=>c),n.export(r,"confusionMatrix",()=>d);var s=e("../tensor_util_env"),a=e("../util"),o=e("./cast"),l=e("./mat_mul"),i=e("./one_hot"),u=e("./operation"),p=e("./transpose");function c(e,t,r){let n=(0,s.convertToTensor)(e,"labels","confusionMatrix"),u=(0,s.convertToTensor)(t,"predictions","confusionMatrix");a.assert(null==r||r>0&&Number.isInteger(r),()=>`If provided, numClasses must be a positive integer, but got ${r}`),a.assert(1===n.rank,()=>`Expected the rank of labels to be 1, but got ${n.rank}`),a.assert(1===u.rank,()=>`Expected the rank of predictions to be 1, but got ${u.rank}`),a.assert(n.shape[0]===u.shape[0],()=>`Mismatch in the number of examples: ${n.shape[0]} vs. ${u.shape[0]}. Labels and predictions should have the same number of elements.`),a.assert(r>0&&Number.isInteger(r),()=>`numClasses is required to be a positive integer, but got ${r}`);let c=(0,i.oneHot)((0,o.cast)(n,"int32"),r),d=(0,i.oneHot)((0,o.cast)(u,"int32"),r),f=(0,p.transpose)(c),h=(0,l.matMul)(f,d);return(0,o.cast)(h,"int32")}let d=/* @__PURE__ */(0,u.op)({confusionMatrix_:c})},{"../tensor_util_env":"g1Qlv","../util":"gBRMK","./cast":"ekSnT","./mat_mul":"9ZocJ","./one_hot":"z9rKs","./operation":"2kGjz","./transpose":"4OrXK","@parcel/transformer-js/src/esmodule-helpers.js":"9pCYc"}],"2OU0B":[function(e,t,r){let n;/** * @license * Copyright 2019 Google LLC. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. * ============================================================================= */var s=e("@parcel/transformer-js/src/esmodule-helpers.js");s.defineInteropFlag(r),s.export(r,"fromPixelsAsync",()=>g),s.export(r,"toPixels",()=>v),s.export(r,"draw",()=>y),s.export(r,"fromPixels",()=>b);var a=e("../engine"),o=e("../environment"),l=e("../kernel_names"),i=e("../kernel_registry"),u=e("../tensor"),p=e("../tensor_util_env"),c=e("./cast"),d=e("./operation"),f=e("./tensor3d");let h=!1;function m(e,t=3){let r,s;if(t>4)throw Error("Cannot construct Tensor with more than 4 channels from pixels.");if(null==e)throw Error("pixels passed to tf.browser.fromPixels() can not be null");let o=!1,u=!1,p=!1,c=!1,d=!1,h=!1;if(e.data instanceof Uint8Array)o=!0;else if("undefined"!=typeof ImageData&&e instanceof ImageData)u=!0;else if("undefined"!=typeof HTMLVideoElement&&e instanceof HTMLVideoElement)p=!0;else if("undefined"!=typeof HTMLImageElement&&e instanceof HTMLImageElement)c=!0;else if(null!=e.getContext)d=!0;else if("undefined"!=typeof ImageBitmap&&e instanceof ImageBitmap)h=!0;else throw 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(null!=(0,i.getKernel)(l.FromPixels,a.ENGINE.backendName))return(0,a.ENGINE).runKernel(l.FromPixels,{pixels:e},{numChannels:t});let[g,x]=p?[e.videoWidth,e.videoHeight]:[e.width,e.height];if(d)r=e.getContext("2d").getImageData(0,0,g,x).data;else if(u||o)r=e.data;else if(c||p||h){if(null==n){if("undefined"==typeof document){if("undefined"!=typeof OffscreenCanvas&&"undefined"!=typeof OffscreenCanvasRenderingContext2D)n=new OffscreenCanvas(1,1).getContext("2d");else throw Error("Cannot parse input in current context. Reason: OffscreenCanvas Context2D rendering is not supported.")}else n=document.createElement("canvas").getContext("2d",{willReadFrequently:!0})}n.canvas.width=g,n.canvas.height=x,n.drawImage(e,0,0,g,x),r=n.getImageData(0,0,g,x).data}if(4===t)s=new Int32Array(r);else{let e=g*x;s=new Int32Array(e*t);for(let n=0;n4||2===t)throw Error(`toPixels only supports depth of size 1, 3 or 4 but got ${t}`);if("float32"!==e.dtype&&"int32"!==e.dtype)throw Error(`Unsupported type for toPixels: ${e.dtype}. Please use float32 or int32 tensors.`)}async function v(e,t){let r=(0,p.convertToTensor)(e,"img","toPixels");if(!(e instanceof u.Tensor)){let e=r;r=(0,c.cast)(e,"int32"),e.dispose()}x(r);let[n,s]=r.shape.slice(0,2),o=2===r.rank?1:r.shape[2],d=await r.data(),f="float32"===r.dtype?255:1,m=new Uint8ClampedArray(s*n*4);for(let e=0;e1)throw Error(`Tensor values for a float32 Tensor must be in the range [0 - 1] but encountered ${s}.`)}else if("int32"===r.dtype&&(s<0||s>255))throw Error(`Tensor values for a int32 Tensor must be in the range [0 - 255] but encountered ${s}.`);1===o?(t[0]=s*f,t[1]=s*f,t[2]=s*f):t[n]=s*f}let n=4*e;m[n+0]=Math.round(t[0]),m[n+1]=Math.round(t[1]),m[n+2]=Math.round(t[2]),m[n+3]=Math.round(t[3])}if(null!=t){h||null==(0,i.getKernel)(l.Draw,a.ENGINE.backendName)||(console.warn("tf.browser.toPixels is not efficient to draw tensor on canvas. Please try tf.browser.draw instead."),h=!0),t.width=s,t.height=n;let e=t.getContext("2d"),r=new ImageData(m,s,n);e.putImageData(r,0,0)}return r!==e&&r.dispose(),m}function y(e,t,r){let n=(0,p.convertToTensor)(e,"img","draw");if(!(e instanceof u.Tensor)){let e=n;n=(0,c.cast)(e,"int32"),e.dispose()}x(n),function(e){let t=(null==e?void 0:e.alpha)||1;if(t>1||t<0)throw Error(`Alpha value ${t} is suppoed to be in range [0 - 1].`)}(null==r?void 0:r.imageOptions);let s={image:n};(0,a.ENGINE).runKernel(l.Draw,s,{canvas:t,options:r})}let b=/* @__PURE__ */(0,d.op)({fromPixels_:m})},{"../engine":"6eJyD","../environment":"i6ZjF","../kernel_names":"aqvy4","../kernel_registry":"kQKsU","../tensor":"cZ8UW","../tensor_util_env":"g1Qlv","./cast":"ekSnT","./operation":"2kGjz","./tensor3d":"fN8Yq","@parcel/transformer-js/src/esmodule-helpers.js":"9pCYc"}],cFmDZ:[function(e,t,r){var n=e("@parcel/transformer-js/src/esmodule-helpers.js");n.defineInteropFlag(r),n.export(r,"prepareAndValidate",()=>a);var s=e("../util");function a(e,t){let r=e.shape.length,n=t.shape.length;if(r<1)throw Error(`tf.gatherND() expects the input to be rank 1 or higher, but the rank was ${r}.`);if(n<1)throw Error(`tf.gatherND() expects the indices to be rank 1 or higher, but the rank was ${n}.`);if("int32"!==t.dtype)throw Error(`tf.gatherND() expects the indices to be int32 type, but the dtype was ${t.dtype}.`);if(t.shape[n-1]>r)throw Error(`index innermost dimension length must be<= tensor rank; saw: ${t.shape[n-1]} vs. ${r}`);if(0===(0,s.sizeFromShape)(e.shape))throw Error(`Requested more than 0 entries, but input is empty. Input shape: ${e.shape}.`);let a=t.shape,o=a[a.length-1],l=1;for(let e=0;ee/p),1].slice(0,o);return[u,l,p,c]}},{"../util":"gBRMK","@parcel/transformer-js/src/esmodule-helpers.js":"9pCYc"}],l9lGg:[function(e,t,r){/** * @license * Copyright 2021 Google LLC. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. * ============================================================================= */var n=e("@parcel/transformer-js/src/esmodule-helpers.js");n.defineInteropFlag(r),n.export(r,"assertParamsValid",()=>a),n.export(r,"maskToAxes",()=>o),n.export(r,"computeOutShape",()=>l),n.export(r,"stridesWithElidedDims",()=>i),n.export(r,"getNormalizedAxes",()=>p),n.export(r,"startIndicesWithElidedDims",()=>c),n.export(r,"stopIndicesWithElidedDims",()=>d),n.export(r,"stridesForAxis",()=>f),n.export(r,"startForAxis",()=>h),n.export(r,"stopForAxis",()=>m),n.export(r,"isSliceContinous",()=>g),n.export(r,"computeFlatOffset",()=>x),n.export(r,"parseSliceParams",()=>v),n.export(r,"sliceInfo",()=>y);var s=e("../util");function a(e,t,r){let n=e.shape.length;s.assert(n===t.length,()=>`Error in slice${n}D: Length of begin ${t} must match the rank of the array (${n}).`),s.assert(n===r.length,()=>`Error in slice${n}D: Length of size ${r} must match the rank of the array (${n}).`);for(let a=0;a`Error in slice${n}D: begin[${a}] + size[${a}] (${t[a]+r[a]}) would overflow input.shape[${a}] (${e.shape[a]})`)}function o(e){let t=[],r=0;for(;e>0;)1&e&&t.push(r),e/=2,r++;return t}function l(e,t,r){let n=[];for(let s=0;s0){let u=t[0],p=r+1;g=c(o,u,p,n,e),x=d(l,u,p,s,e),v=i(a,u,p,e)}else for(let t=0;t-1)a[s]=0;else{var l;let o=(l=s)<=t?l:l-(r-1),i=n[o];e&1<-1)o[s]=Number.MAX_SAFE_INTEGER;else{var i;let a=(i=s)<=t?i:i-(r-1),l=n[a];e&1<0?Number.MIN_SAFE_INTEGER:Number.MAX_SAFE_INTEGER);let u=n[a];return l<0&&(l+=u),l=s.clamp(0,l,u-1)}function m(e,t,r,n,a,o){let l=t[a],i=r[a]||1;(e&1<0?Number.MAX_SAFE_INTEGER:Number.MIN_SAFE_INTEGER);let u=n[a];return l<0&&(l+=u),l=i>0?s.clamp(0,l,u):s.clamp(-1,l,u-1)}function g(e,t,r){let n=r.length;for(let e=0;e1){n=e;break}for(let s=n+1;s0||r[s]!==e[s])return!1;return!0}function x(e,t){let r=e.length>0?e[e.length-1]:1;for(let n=0;n{s.assert(-1!==e,()=>"slice() does not support negative begin indexing.")}),a=(a=null==r?Array(o).fill(-1):"number"==typeof r?[r,...Array(o-1).fill(-1)]:r.lengtht>=0?t:(s.assert(-1===t,()=>`Negative size values should be exactly -1 but got ${t} for the slice() size at index ${r}.`),e.shape[r]-n[r])),[n,a]}function y(e,t,r,n,s,a,o,l,i){let u;if(null==n?(u=Array(t.length)).fill(1):u=n,null!=o&&(o&o-1)!=0)throw Error("Multiple ellipses in slice is not allowed.");let p=!1,c={dims:u.length,numAddAxisAfterEllipsis:0,begin:t.slice(),end:r.slice(),strides:u.slice(),beginMask:s,endMask:a,ellipsisMask:o,newAxisMask:l,shrinkAxisMask:i};for(let e=0;e0?0:-1,d.strides[t]>0?s:s-1];if(n&&d.strides[t]<=0)throw Error("only stride 1 allowed on non-range indexing.");m=m&&1===d.strides[t];let l=!!(d.beginMask&1<=s)throw Error(`slice index ${d.begin[t]} of dimension ${t} out of bounds.`)}else d.begin[t]=b(d.begin[t],0,d.strides[t],s,a,o),d.end[t]=b(d.end[t],1,d.strides[t],s,a,o);let e=1===d.strides[t]&&0===d.begin[t]&&d.end[t]===s;f=f&&e,h=h&&(0===t&&1===d.strides[t]||e)}else f=f&&1===d.strides[t]&&l,h=h&&(0===t&&1===d.strides[t]||l);let i=!1;if(d.beginValid&&d.endValid?(r=d.end[t]-d.begin[t],i=!0):n?(r=1,i=!0):l&&s>=0&&(r=d.strides[t]<0?-s:s,i=!0),i){let e;e=0===r||r<0!=d.strides[t]<0?0:Math.trunc(r/d.strides[t])+(r%d.strides[t]!=0?1:0),g.push(e)}else g.push(-1)}for(let e=0;e=0?x.push(g[t]):-2===t&&x.push(1)}return{finalShapeSparse:x.filter((e,t)=>-2!==d.finalShapeGatherIndices[t]),finalShape:x,isIdentity:f,sliceDim0:h,isSimpleSlice:m,begin:d.begin,end:d.end,strides:d.strides}}function b(e,t,r,n,s,a){if(s[t])return r>0?a[t]:a[t+1&1];{let t=e<0?n+e:e;return ta[1]?a[1]:t}}},{"../util":"gBRMK","@parcel/transformer-js/src/esmodule-helpers.js":"9pCYc"}],"8GskL":[function(e,t,r){/** @license See the LICENSE file. */var n=e("@parcel/transformer-js/src/esmodule-helpers.js");n.defineInteropFlag(r),n.export(r,"version",()=>s);let s="4.21.0"},{"@parcel/transformer-js/src/esmodule-helpers.js":"9pCYc"}],gVc89:[function(e,t,r){/** * @license * Copyright 2018 Google LLC. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. * ============================================================================= */var n=e("@parcel/transformer-js/src/esmodule-helpers.js");n.defineInteropFlag(r),n.export(r,"OptimizerConstructors",()=>c);var s=e("./adadelta_optimizer"),a=e("./adagrad_optimizer"),o=e("./adam_optimizer"),l=e("./adamax_optimizer"),i=e("./momentum_optimizer"),u=e("./rmsprop_optimizer"),p=e("./sgd_optimizer");class c{static sgd(e){return new p.SGDOptimizer(e)}static momentum(e,t,r=!1){return new i.MomentumOptimizer(e,t,r)}static rmsprop(e,t=.9,r=0,n=null,s=!1){return new u.RMSPropOptimizer(e,t,r,n,s)}static adam(e=.001,t=.9,r=.999,n=null){return new o.AdamOptimizer(e,t,r,n)}static adadelta(e=.001,t=.95,r=null){return new s.AdadeltaOptimizer(e,t,r)}static adamax(e=.002,t=.9,r=.999,n=null,s=0){return new l.AdamaxOptimizer(e,t,r,n,s)}static adagrad(e,t=.1){return new a.AdagradOptimizer(e,t)}}},{"./adadelta_optimizer":"1rtJl","./adagrad_optimizer":"f9OX9","./adam_optimizer":"i7Li7","./adamax_optimizer":"gb2az","./momentum_optimizer":"ka4Mb","./rmsprop_optimizer":"iwr1K","./sgd_optimizer":"aaxfI","@parcel/transformer-js/src/esmodule-helpers.js":"9pCYc"}],lRIoY:[function(e,t,r){/** * @license * Copyright 2018 Google LLC. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. * ============================================================================= */var n=e("@parcel/transformer-js/src/esmodule-helpers.js");n.defineInteropFlag(r),n.export(r,"train",()=>s);let s=e("./optimizers/optimizer_constructors").OptimizerConstructors},{"./optimizers/optimizer_constructors":"gVc89","@parcel/transformer-js/src/esmodule-helpers.js":"9pCYc"}],a4Cf9:[function(e,t,r){/** * @license * Copyright 2017 Google LLC. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. * ============================================================================= */var n=e("@parcel/transformer-js/src/esmodule-helpers.js");n.defineInteropFlag(r),n.export(r,"nextFrame",()=>a);let s="undefined"!=typeof requestAnimationFrame?requestAnimationFrame:"undefined"!=typeof setImmediate?setImmediate:e=>e();function a(){return new Promise(e=>s(()=>e()))}},{"@parcel/transformer-js/src/esmodule-helpers.js":"9pCYc"}],el7sG:[function(e,t,r){/** * @license * Copyright 2018 Google LLC. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. * ============================================================================= */var n=e("@parcel/transformer-js/src/esmodule-helpers.js");n.defineInteropFlag(r),n.export(r,"upcastType",()=>h.upcastType),n.export(r,"slice_util",()=>f),n.export(r,"segment_util",()=>S),n.export(r,"fromUint8ToStringArray",()=>N),n.export(r,"fromStringArrayToUint8",()=>E);var s=e("../util"),a=e("../ops/axis_util");n.exportAll(a,r);var o=e("../ops/broadcast_util");n.exportAll(o,r);var l=e("../ops/concat_util");n.exportAll(l,r);var i=e("../ops/conv_util");n.exportAll(i,r);var u=e("../ops/fused_util");n.exportAll(u,r);var p=e("../ops/fused_types");n.exportAll(p,r);var c=e("../ops/ragged_to_dense_util");n.exportAll(c,r);var d=e("../ops/reduce_util");n.exportAll(d,r);var f=e("../ops/slice_util"),h=e("../types"),m=e("../ops/rotate_util");n.exportAll(m,r);var g=e("../ops/array_ops_util");n.exportAll(g,r);var x=e("../ops/gather_nd_util");n.exportAll(x,r);var v=e("../ops/scatter_nd_util");n.exportAll(v,r);var y=e("../ops/selu_util");n.exportAll(y,r),n.exportAll(u,r);var b=e("../ops/erf_util");n.exportAll(b,r);var _=e("../log");n.exportAll(_,r);var k=e("../backends/complex_util");n.exportAll(k,r);var j=e("../backends/einsum_util");n.exportAll(j,r);var I=e("../ops/split_util");n.exportAll(I,r);var C=e("../ops/sparse/sparse_fill_empty_rows_util");n.exportAll(C,r);var w=e("../ops/sparse/sparse_reshape_util");n.exportAll(w,r);var T=e("../ops/sparse/sparse_segment_reduction_util");n.exportAll(T,r);var S=e("../ops/segment_util");function N(e){try{return e.map(e=>(0,s.decodeString)(e))}catch(e){throw Error(`Failed to decode encoded string bytes into utf-8, error: ${e}`)}}function E(e){return e.map(e=>(0,s.encodeString)(e))}},{"../util":"gBRMK","../ops/axis_util":"3ROd2","../ops/broadcast_util":"aouH8","../ops/concat_util":"kLwag","../ops/conv_util":"kmOtb","../ops/fused_util":"eVVb8","../ops/fused_types":"aV79B","../ops/ragged_to_dense_util":"fLYOf","../ops/reduce_util":"lnwaW","../ops/slice_util":"l9lGg","../types":"ahcVG","../ops/rotate_util":"afgsY","../ops/array_ops_util":"7nxcV","../ops/gather_nd_util":"cFmDZ","../ops/scatter_nd_util":"1SOU1","../ops/selu_util":"56ezi","../ops/erf_util":"b0T4u","../log":"dmXQF","../backends/complex_util":"8MHIk","../backends/einsum_util":"eCo0z","../ops/split_util":"agh03","../ops/sparse/sparse_fill_empty_rows_util":"7zpEt","../ops/sparse/sparse_reshape_util":"dVTUF","../ops/sparse/sparse_segment_reduction_util":"fn8Bk","../ops/segment_util":"6j9vS","@parcel/transformer-js/src/esmodule-helpers.js":"9pCYc"}],kLwag:[function(e,t,r){/** * @license * Copyright 2017 Google LLC. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. * ============================================================================= */var n=e("@parcel/transformer-js/src/esmodule-helpers.js");n.defineInteropFlag(r),n.export(r,"assertParamsConsistent",()=>a),n.export(r,"computeOutShape",()=>o);var s=e("../util");function a(e,t){let r=e[0].length;e.forEach((e,t)=>{s.assert(e.length===r,()=>`Error in concat${r}D: rank of tensors[${t}] must be the same as the rank of the rest (${r})`)}),s.assert(t>=0&&t`Error in concat${r}D: axis must be between 0 and ${r-1}.`);let n=e[0];e.forEach((e,a)=>{for(let o=0;o`Error in concat${r}D: Shape of tensors[${a}] (${e}) does not match the shape of the rest (${n}) along the non-concatenated axis ${a}.`)})}function o(e,t){let r=e[0].slice();for(let n=1;n=0){if(l>=0){if(l!==a)throw Error(`rt input.shape and shape=${t} are incompatible: rt input.shape[${s+e}] = ${a} but shape[${s+e}] = ${l}`)}else n[o]=a}}return n}function l(e){let t={FIRST_DIM_SIZE:s.FIRST_DIM_SIZE,VALUE_ROWIDS:s.VALUE_ROWIDS,ROW_LENGTHS:s.ROW_LENGTHS,ROW_SPLITS:s.ROW_SPLITS,ROW_LIMITS:s.ROW_LIMITS,ROW_STARTS:s.ROW_STARTS},r=[];for(let n of e)if(n in t)r.push(t[n]);else break;return r}function i(e){return 0===e.length?0:e[0]===s.FIRST_DIM_SIZE?e.length-1:e.length}function u(e,t){if(null==e||null==t)return;let r=e.length,n=t.length;if(r>=n)throw Error(`defaultValue.shape=${e} and ragged tensor flatValues.shape=${t}, are incompatible: defaultValue.rank = ${r} must be less than ragged tensor input flatValues.rank = ${n})`);for(let s=0;s=0&&n>=0&&1!==r&&r!==n)throw Error(`defaultValue.shape=${e}, and ragged tensor input flatValues.shape=${t} are incompatible: defaultValue.shape[${s-e.length}] = ${r} but ragged tensor input.flatValues.shape[${s-e.length}] = ${n}`)}}a.defineInteropFlag(r),a.export(r,"RowPartitionType",()=>s),a.export(r,"combineRaggedTensorToTensorShapes",()=>o),a.export(r,"getRowPartitionTypesHelper",()=>l),a.export(r,"getRaggedRank",()=>i),a.export(r,"validateDefaultValueShape",()=>u),(n=s||(s={}))[n.FIRST_DIM_SIZE=0]="FIRST_DIM_SIZE",n[n.VALUE_ROWIDS=1]="VALUE_ROWIDS",n[n.ROW_LENGTHS=2]="ROW_LENGTHS",n[n.ROW_SPLITS=3]="ROW_SPLITS",n[n.ROW_LIMITS=4]="ROW_LIMITS",n[n.ROW_STARTS=5]="ROW_STARTS"},{"@parcel/transformer-js/src/esmodule-helpers.js":"9pCYc"}],lnwaW:[function(e,t,r){/** * @license * Copyright 2017 Google LLC. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. * ============================================================================= */var n=e("@parcel/transformer-js/src/esmodule-helpers.js");n.defineInteropFlag(r),n.export(r,"PARALLELIZE_THRESHOLD",()=>a),n.export(r,"computeOptimalWindowSize",()=>o);var s=e("../util");let a=30;function o(e){return e<=a?e:(0,s.nearestDivisor)(e,Math.floor(Math.sqrt(e)))}},{"../util":"gBRMK","@parcel/transformer-js/src/esmodule-helpers.js":"9pCYc"}],afgsY:[function(e,t,r){/** * @license * Copyright 2020 Google LLC. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. * ============================================================================= */var n=e("@parcel/transformer-js/src/esmodule-helpers.js");function s(e,t,r){return[r*("number"==typeof e?e:e[0]),t*("number"==typeof e?e:e[1])]}n.defineInteropFlag(r),n.export(r,"getImageCenter",()=>s)},{"@parcel/transformer-js/src/esmodule-helpers.js":"9pCYc"}],"7nxcV":[function(e,t,r){/** * @license * Copyright 2018 Google LLC. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. * ============================================================================= */var n=e("@parcel/transformer-js/src/esmodule-helpers.js");function s(e,t,r,n=!0){let a=[];if(n)(a=a.concat(t.slice(0))).push(e[0]/r),a=a.concat(e.slice(1));else{a=a.concat(e[0]);let r=t.length;for(let n=0;n=2*t+1||n%2==1?s.push(n):r.push(n);n.push(...r),n.push(0),n.push(...s)}return n}function o(e,t,r,n=!0){let s=[];n?s.push(e[0]/r):s.push(e[0]*r);for(let r=1;rs),n.export(r,"getPermuted",()=>a),n.export(r,"getReshapedPermuted",()=>o),n.export(r,"getSliceBeginCoords",()=>l),n.export(r,"getSliceSize",()=>i)},{"@parcel/transformer-js/src/esmodule-helpers.js":"9pCYc"}],"56ezi":[function(e,t,r){/** * @license * Copyright 2018 Google LLC. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. * ============================================================================= */var n=e("@parcel/transformer-js/src/esmodule-helpers.js");n.defineInteropFlag(r),n.export(r,"SELU_SCALEALPHA",()=>s),n.export(r,"SELU_SCALE",()=>a);let s=1.7580993408473768,a=1.0507009873554805},{"@parcel/transformer-js/src/esmodule-helpers.js":"9pCYc"}],b0T4u:[function(e,t,r){/** * @license * Copyright 2018 Google LLC. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. * ============================================================================= */var n=e("@parcel/transformer-js/src/esmodule-helpers.js");n.defineInteropFlag(r),n.export(r,"ERF_P",()=>s),n.export(r,"ERF_A1",()=>a),n.export(r,"ERF_A2",()=>o),n.export(r,"ERF_A3",()=>l),n.export(r,"ERF_A4",()=>i),n.export(r,"ERF_A5",()=>u);let s=.3275911,a=.254829592,o=-.284496736,l=1.421413741,i=-1.453152027,u=1.061405429},{"@parcel/transformer-js/src/esmodule-helpers.js":"9pCYc"}],"8MHIk":[function(e,t,r){/** * @license * Copyright 2018 Google LLC. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. * ============================================================================= */var n=e("@parcel/transformer-js/src/esmodule-helpers.js");function s(e,t){if(e.length!==t.length)throw Error(`Cannot merge real and imag arrays of different lengths. real:${e.length}, imag: ${t.length}.`);let r=new Float32Array(2*e.length);for(let n=0;ns),n.export(r,"splitRealAndImagArrays",()=>a),n.export(r,"complexWithEvenIndex",()=>o),n.export(r,"complexWithOddIndex",()=>l),n.export(r,"getComplexWithIndex",()=>i),n.export(r,"assignToTypedArray",()=>u),n.export(r,"exponents",()=>p),n.export(r,"exponent",()=>c)},{"@parcel/transformer-js/src/esmodule-helpers.js":"9pCYc"}],eCo0z:[function(e,t,r){/** * @license * Copyright 2021 Google LLC. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. * ============================================================================= */var n=e("@parcel/transformer-js/src/esmodule-helpers.js");n.defineInteropFlag(r),n.export(r,"decodeEinsumEquation",()=>o),n.export(r,"getEinsumPermutation",()=>l),n.export(r,"checkEinsumDimSizes",()=>i),n.export(r,"getEinsumComputePath",()=>u),n.export(r,"isIdentityPermutation",()=>p);var s=e("../util_base");let a=/->/g;function o(e,t){let r=((e=e.replace(/\s/g,"")).length-e.replace(a,"").length)/2;if(r<1)throw Error("Equations without an arrow are not supported.");if(r>1)throw Error('Equation must contain exactly one arrow ("->").');let[n,o]=e.split("->");(0,s.assert)(-1===n.indexOf("..."),()=>'The ellipsis notation ("...") is not supported yet.');let l=n.split(","),i=l.length;if(t!==i)throw Error(`Expected ${i} input tensors, received ${t}`);if(i>2)throw Error("Support for more than 2 input tensors is not implemented yet.");let u=[];for(let e=0;e-1!==e.indexOf(t)))throw Error(`Output subscripts contain the label ${t} not present in the input subscripts.`);-1===u.indexOf(t)&&u.push(t)}for(let e=0;e-1!==e),expandDims:n}}function i(e,t,r){let n=Array(e);for(let e=0;e`Expected dimension ${n[t[e][r]]} at axis ${r} of input shaped ${JSON.stringify(a)}, but got dimension ${a[r]}`)}}function u(e,t){let r=[],n=0;0===e.length&&e.push(-1),n=e.length+1;for(let e=0;ee===t)}},{"../util_base":"8U7kO","@parcel/transformer-js/src/esmodule-helpers.js":"9pCYc"}],agh03:[function(e,t,r){var n=e("@parcel/transformer-js/src/esmodule-helpers.js");n.defineInteropFlag(r),n.export(r,"prepareSplitSize",()=>a);var s=e("../util");function a(e,t,r=0){let n=[];if("number"==typeof t)(0,s.assert)(e.shape[r]%t==0,()=>"Number of splits must evenly divide the axis."),n=Array(t).fill(e.shape[r]/t);else{let a=t.reduce((e,t)=>(-1===t&&(e+=1),e),0);(0,s.assert)(a<=1,()=>"There should be only one negative value in split array.");let o=t.indexOf(-1);if(-1!==o){let n=t.reduce((e,t)=>t>0?e+t:e);t[o]=e.shape[r]-n}(0,s.assert)(e.shape[r]===t.reduce((e,t)=>e+t),()=>"The sum of sizes must match the size of the axis dimension."),n=t}return n}},{"../util":"gBRMK","@parcel/transformer-js/src/esmodule-helpers.js":"9pCYc"}],"7zpEt":[function(e,t,r){/** * @license * Copyright 2021 Google LLC. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. * ============================================================================= */var n=e("@parcel/transformer-js/src/esmodule-helpers.js");function s(e){return`Received SparseTensor with denseShape[0] = 0 but indices.shape[0] = ${e}`}function a(e,t){return`indices(${e}, 0) is invalid: ${t}< 0`}function o(e,t,r){return`indices(${e}, 0) is invalid: ${t} >= ${r}`}n.defineInteropFlag(r),n.export(r,"getSparseFillEmptyRowsIndicesDenseShapeMismatch",()=>s),n.export(r,"getSparseFillEmptyRowsNegativeIndexErrorMessage",()=>a),n.export(r,"getSparseFillEmptyRowsOutOfRangeIndexErrorMessage",()=>o)},{"@parcel/transformer-js/src/esmodule-helpers.js":"9pCYc"}],dVTUF:[function(e,t,r){/** * @license * Copyright 2021 Google LLC. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. * ============================================================================= */var n=e("@parcel/transformer-js/src/esmodule-helpers.js");n.defineInteropFlag(r),n.export(r,"getSparseReshapeMultipleNegativeOneOutputDimErrorMessage",()=>a),n.export(r,"getSparseReshapeNegativeOutputDimErrorMessage",()=>o),n.export(r,"getSparseReshapeEmptyTensorZeroOutputDimErrorMessage",()=>l),n.export(r,"getSparseReshapeInputOutputMultipleErrorMessage",()=>i),n.export(r,"getSparseReshapeInputOutputMismatchErrorMessage",()=>u);var s=e("../../util");function a(e,t){return`only one output dimension may be -1, not both ${e} and ${t}`}function o(e,t){return`size ${e} must be non-negative, not ${t}`}function l(){return"reshape cannot infer the missing input size for an empty tensor unless all specified input sizes are non-zero"}function i(e,t){let r=(0,s.sizeFromShape)(e),n=(0,s.sizeFromShape)(t);return`Input to reshape is a SparseTensor with ${r} dense values, but the requested shape requires a multiple of ${n}. inputShape=${e} outputShape= ${t}`}function u(e,t){let r=(0,s.sizeFromShape)(e),n=(0,s.sizeFromShape)(t);return`Input to reshape is a tensor with ${r} dense values, but the requested shape has ${n}. inputShape=${e} outputShape=${t}`}},{"../../util":"gBRMK","@parcel/transformer-js/src/esmodule-helpers.js":"9pCYc"}],fn8Bk:[function(e,t,r){/** * @license * Copyright 2021 Google LLC. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. * ============================================================================= */var n=e("@parcel/transformer-js/src/esmodule-helpers.js");function s(){return"segment ids must be >= 0"}function a(){return"segment ids are not increasing"}function o(e,t){return`Segment id ${e} out of range [0, ${t}), possibly because segmentIds input is not sorted.`}function l(e,t,r){return`Bad: indices[${e}] == ${t} out of range [0, ${r})`}n.defineInteropFlag(r),n.export(r,"getSparseSegmentReductionNegativeSegmentIdsErrorMessage",()=>s),n.export(r,"getSparseSegmentReductionNonIncreasingSegmentIdsErrorMessage",()=>a),n.export(r,"getSparseSegmentReductionSegmentIdOutOfRangeErrorMessage",()=>o),n.export(r,"getSparseSegmentReductionIndicesOutOfRangeErrorMessage",()=>l)},{"@parcel/transformer-js/src/esmodule-helpers.js":"9pCYc"}],"6j9vS":[function(e,t,r){/** * @license * Copyright 2018 Google LLC. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. * ============================================================================= */var n=e("@parcel/transformer-js/src/esmodule-helpers.js");n.defineInteropFlag(r),n.export(r,"segOpComputeOptimalWindowSize",()=>o),n.export(r,"computeOutShape",()=>l),n.export(r,"collectGatherOpShapeInfo",()=>i);var s=e("../util"),a=e("./reduce_util");function o(e,t){let r,n=!1;for(e<=a.PARALLELIZE_THRESHOLD?(r=e,n=!0):r=(0,s.nearestDivisor)(e,Math.floor(Math.sqrt(e)));!n;)r>t||r===e?n=!0:r=(0,s.nearestDivisor)(e,r+1);return r}function l(e,t,r){let n=[],s=e.length;for(let a=0;as))throw Error(`Expect batchDims in the range of [-${s}, ${s}], but got ${n}`);if(n<0&&(n+=s),n>a)throw Error(`batchDims (${n}) must be less than rank(x) ( ${a}).`);if(rs.nonMaxSuppressionV3Impl),n.export(r,"nonMaxSuppressionV4Impl",()=>s.nonMaxSuppressionV4Impl),n.export(r,"nonMaxSuppressionV5Impl",()=>s.nonMaxSuppressionV5Impl),n.export(r,"whereImpl",()=>a.whereImpl);var s=e("./non_max_suppression_impl"),a=e("./where_impl")},{"./non_max_suppression_impl":"5hWvx","./where_impl":"iAW14","@parcel/transformer-js/src/esmodule-helpers.js":"9pCYc"}],"2cOos":[function(e,t,r){/** * @license * Copyright 2020 Google LLC. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. * ============================================================================= */var n=e("@parcel/transformer-js/src/esmodule-helpers.js");n.defineInteropFlag(r);var s=e("./base");n.exportAll(s,r),e("./register_all_kernels")},{"./base":"d0YaU","./register_all_kernels":"4bNpu","@parcel/transformer-js/src/esmodule-helpers.js":"9pCYc"}],d0YaU:[function(e,t,r){/** * @license * Copyright 2020 Google Inc. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. * ============================================================================= */var n=e("@parcel/transformer-js/src/esmodule-helpers.js");n.defineInteropFlag(r),n.export(r,"version_webgl",()=>o.version),n.export(r,"webgl",()=>i);var s=e("@tensorflow/tfjs-core"),a=e("./backend_webgl"),o=e("./version"),l=e("./webgl");n.exportAll(l,r),(0,s.device_util).isBrowser()&&(0,s.registerBackend)("webgl",()=>new a.MathBackendWebGL,2);let i={forceHalfFloat:l.forceHalfFloat}},{"@tensorflow/tfjs-core":"2nuhV","./backend_webgl":"1clUm","./version":"j1Udx","./webgl":"38nh6","@parcel/transformer-js/src/esmodule-helpers.js":"9pCYc"}],"1clUm":[function(e,t,r){/** * @license * Copyright 2017 Google LLC. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. * ============================================================================= */var n=e("@parcel/transformer-js/src/esmodule-helpers.js");n.defineInteropFlag(r),n.export(r,"EPSILON_FLOAT32",()=>I),n.export(r,"EPSILON_FLOAT16",()=>C),n.export(r,"getBinaryCache",()=>T),n.export(r,"MathBackendWebGL",()=>N),e("./flags_webgl");var s=e("@tensorflow/tfjs-core"),a=e("./canvas_util"),o=e("./decode_matrix_gpu"),l=e("./decode_matrix_packed_gpu"),i=e("./encode_float_gpu"),u=e("./encode_float_packed_gpu"),p=e("./encode_matrix_gpu"),c=e("./encode_matrix_packed_gpu"),d=e("./gpgpu_context"),f=e("./gpgpu_math"),h=e("./kernel_utils/shared"),m=e("./pack_gpu"),g=e("./reshape_packed_gpu"),x=e("./tex_util"),v=e("./texture_manager"),y=e("./unaryop_gpu"),b=e("./unaryop_packed_gpu"),_=e("./unpack_gpu"),k=e("./webgl_util");let j=s.kernel_impls.whereImpl,I=1e-7,C=1e-4,w={};function T(e){return e in w||(w[e]={}),w[e]}let S=(0,s.env)().getNumber("CPU_HANDOFF_SIZE_THRESHOLD");class N extends s.KernelBackend{nextDataId(){return N.nextDataId++}constructor(e){let 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,!(0,s.env)().getBool("HAS_WEBGL"))throw Error("WebGL is not supported on this device");if(null!=e){if(e instanceof d.GPGPUContext)t=e;else{let r=(0,a.getWebGLContext)((0,s.env)().getNumber("WEBGL_VERSION"),e);t=new d.GPGPUContext(r)}this.binaryCache={},this.gpgpuCreatedLocally=!1}else{let e=(0,a.getWebGLContext)((0,s.env)().getNumber("WEBGL_VERSION"));t=new d.GPGPUContext(e),this.binaryCache=T((0,s.env)().getNumber("WEBGL_VERSION")),this.gpgpuCreatedLocally=!0}this.gpgpu=t,this.canvas=this.gpgpu.gl.canvas,this.textureManager=new v.TextureManager(this.gpgpu),this.numMBBeforeWarning=null==(0,s.env)().global.screen?1024:(0,s.env)().global.screen.height*(0,s.env)().global.screen.width*window.devicePixelRatio*600/1024/1024,this.texData=new s.DataStorage(this,(0,s.engine)())}numDataIds(){return this.texData.numDataIds()-this.pendingDeletes}writeTexture(e,t,r,n,s,a){let o=this.makeTensorInfo(t,r),l=this.texData.get(o.dataId);l.isPacked=!1,l.texture={texture:e,texShape:[n,s]},l.texShape=[n,s];let i=k.getShapeAs3D(t),u=new p.EncodeMatrixProgram(i,!1,a),c=this.runWebGLProgram(u,[o],r,[[n,s]]);return c.shape=t,l.texture=null,this.disposeIntermediateTensorInfo(o),c.dataId}write(e,t,r){if(((0,s.env)().getBool("WEBGL_CHECK_NUMERICAL_PROBLEMS")||(0,s.env)().getBool("DEBUG"))&&this.checkNumericalProblems(e),"complex64"===r&&null!=e)throw 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:r,values:e,usage:x.TextureUsage.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,r,n,a){if((0,s.env)().getBool("DEBUG")&&this.checkNumericalProblems(t),"complex64"===n)throw Error("Cannot write to a complex64 dtype. Please use tf.complex(real, imag).");this.texData.set(e,{shape:r,dtype:n,values:t,usage:x.TextureUsage.UPLOAD,refCount:a})}disposeIntermediateTensorInfo(e){this.disposeData(e.dataId)}readSync(e){let t,r;let{values:n,dtype:a,complexTensorInfos:o,slice:l,shape:i,isPacked:u}=this.texData.get(e);if(null!=l){let t;t=u?new b.UnaryOpPackedProgram(i,y.CLONE):new y.UnaryOpProgram(i,y.CLONE);let r=this.runWebGLProgram(t,[{dataId:e,shape:i,dtype:a}],a),n=this.readSync(r.dataId);return this.disposeIntermediateTensorInfo(r),n}if(null!=n)return this.convertAndCacheOnCPU(e);if("string"===a)return n;let p=null!=this.activeTimers;if(p&&(t=(0,s.util).now()),"complex64"===a){let e=this.readSync(o.real.dataId),t=this.readSync(o.imag.dataId);r=(0,s.backend_util).mergeRealAndImagArrays(e,t)}else r=this.getValuesFromTexture(e);return p&&(this.downloadWaitMs+=(0,s.util).now()-t),this.convertAndCacheOnCPU(e,r)}async read(e){let t,r;if(this.pendingRead.has(e)){let t=this.pendingRead.get(e);return new Promise(e=>t.push(e))}let{values:n,shape:a,slice:o,dtype:l,complexTensorInfos:i,isPacked:u}=this.texData.get(e);if(null!=o){let t;t=u?new b.UnaryOpPackedProgram(a,y.CLONE):new y.UnaryOpProgram(a,y.CLONE);let r=this.runWebGLProgram(t,[{dataId:e,shape:a,dtype:l}],l),n=this.read(r.dataId);return this.disposeIntermediateTensorInfo(r),n}if(null!=n)return this.convertAndCacheOnCPU(e);if((0,s.env)().getBool("DEBUG")&&!(0,s.env)().getBool("WEBGL_DOWNLOAD_FLOAT_ENABLED")&&2===(0,s.env)().getNumber("WEBGL_VERSION"))throw Error("tensor.data() with WEBGL_DOWNLOAD_FLOAT_ENABLED=false and WEBGL_VERSION=2 not yet supported.");let p=null;if("complex64"!==l&&(0,s.env)().get("WEBGL_BUFFER_SUPPORTED")){t=this.decode(e);let r=this.texData.get(t.dataId);p=this.gpgpu.createBufferFromTexture(r.texture.texture,...x.getDenseTexShape(a))}if(this.pendingRead.set(e,[]),"complex64"!==l&&await this.gpgpu.createAndWaitForFence(),"complex64"===l){let e=await Promise.all([this.read(i.real.dataId),this.read(i.imag.dataId)]),t=e[0],n=e[1];r=(0,s.backend_util).mergeRealAndImagArrays(t,n)}else if(null==p)r=this.getValuesFromTexture(e);else{let e=(0,s.util).sizeFromShape(a);r=this.gpgpu.downloadFloat32MatrixFromBuffer(p,e)}if(null!=t&&this.disposeIntermediateTensorInfo(t),null!=p){let e=this.gpgpu.gl;k.callAndCheck(e,()=>e.deleteBuffer(p))}let c=this.convertAndCacheOnCPU(e,r),d=this.pendingRead.get(e);return this.pendingRead.delete(e),d.forEach(e=>e(c)),this.pendingDisposal.has(e)&&(this.pendingDisposal.delete(e),this.disposeData(e)&&(0,s.engine)().removeDataId(e,this),this.pendingDeletes--),c}readToGPU(e,t={}){let{values:r,shape:n,slice:a,dtype:o,isPacked:l,texture:i}=this.texData.get(e);if("complex64"===o)throw Error("Does not support reading texture for complex64 dtype.");if(null!=a){let r;r=l?new b.UnaryOpPackedProgram(n,y.CLONE):new y.UnaryOpProgram(n,y.CLONE);let s=this.runWebGLProgram(r,[{dataId:e,shape:n,dtype:o}],o),a=this.readToGPU(s,t);return this.disposeIntermediateTensorInfo(s),a}if(null==i){if(null!=r)throw Error("Data is not on GPU but on CPU.");throw Error("There is no data on GPU or CPU.")}let u=this.decode(e,t.customTexShape);return Object.assign({tensorRef:(0,s.engine)().makeTensorFromTensorInfo(u)},this.texData.get(u.dataId).texture)}bufferSync(e){let t=this.readSync(e.dataId);if("string"===e.dtype)try{let r=t.map(e=>(0,s.util).decodeString(e));return(0,s.buffer)(e.shape,e.dtype,r)}catch(e){throw Error("Failed to decode encoded string bytes into utf-8")}return(0,s.buffer)(e.shape,e.dtype,t)}checkNumericalProblems(e){if(null!=e)for(let t=0;t0}time(e){let t=this.activeTimers,r=[],n=!1;null==this.programTimersStack?(this.programTimersStack=r,n=!0):this.activeTimers.push(r),this.activeTimers=r,e();let a=(0,s.util).flatten(this.activeTimers.map(e=>e.query)).filter(e=>null!=e),o=(0,s.util).flatten(this.activeTimers.map(e=>e.name)).filter(e=>null!=e);this.activeTimers=t,n&&(this.programTimersStack=null);let l={uploadWaitMs:this.uploadWaitMs,downloadWaitMs:this.downloadWaitMs,kernelMs:null,wallMs:null};return(async()=>{if((0,s.env)().getNumber("WEBGL_DISJOINT_QUERY_TIMER_EXTENSION_RELIABLE")>0){let e=await Promise.all(a);l.kernelMs=(0,s.util).sum(e),l.getExtraProfileInfo=()=>e.map((e,t)=>({name:o[t],ms:e})).map(e=>`${e.name}: ${e.ms}`).join(", ")}else l.kernelMs={error:"WebGL query timers are not supported in this environment."};return this.uploadWaitMs=0,this.downloadWaitMs=0,l})()}memory(){return{unreliable:!1,numBytesInGPU:this.numBytesInGPU,numBytesInGPUAllocated:this.textureManager.numBytesAllocated,numBytesInGPUFree:this.textureManager.numBytesFree}}startTimer(){return(0,s.env)().getNumber("WEBGL_DISJOINT_QUERY_TIMER_EXTENSION_RELIABLE")>0?this.gpgpu.beginQuery():{startMs:(0,s.util).now(),endMs:null}}endTimer(e){return(0,s.env)().getNumber("WEBGL_DISJOINT_QUERY_TIMER_EXTENSION_RELIABLE")>0?this.gpgpu.endQuery():e.endMs=(0,s.util).now(),e}async getQueryTime(e){return(0,s.env)().getNumber("WEBGL_DISJOINT_QUERY_TIMER_EXTENSION_RELIABLE")>0?this.gpgpu.waitForQueryAndGetTime(e):e.endMs-e.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:r}=this.texData.get(e);return null!=r&&(this.disposeData(r.real.dataId,t),this.disposeData(r.imag.dataId,t)),this.texData.delete(e),!0}releaseGPUData(e){let{texture:t,dtype:r,texShape:n,usage:s,isPacked:a,slice:o}=this.texData.get(e),l=o&&o.origDataId||e,i=this.dataRefCount.get(l);i>1?this.dataRefCount.set(l,i-1):(this.dataRefCount.delete(l),null!=t&&(this.numBytesInGPU-=this.computeBytes(n,r),this.textureManager.releaseTexture(t,n,s,a)));let u=this.texData.get(e);u.texture=null,u.texShape=null,u.isPacked=!1,u.slice=null}getTexture(e){return this.uploadToGPU(e),this.texData.get(e).texture.texture}getDataInfo(e){return this.texData.get(e)}shouldExecuteOnCPU(e,t=S){return(0,s.env)().getBool("WEBGL_CPU_FORWARD")&&e.every(e=>null==this.texData.get(e.dataId).texture&&(0,s.util).sizeFromShape(e.shape)0&&(0,s.util).isString(r[0])){let a=r.map(e=>(0,s.util).encodeString(e));n=this.write(a,e,t)}else n=this.write(r,e,t);return this.texData.get(n).usage=null,{dataId:n,shape:e,dtype:t}}makeOutput(e,t,r){return(0,s.engine)().makeTensorFromTensorInfo(this.makeTensorInfo(e,t,r),this)}unpackTensor(e){let t=new _.UnpackProgram(e.shape);return this.runWebGLProgram(t,[e],e.dtype)}packTensor(e){let t=new m.PackProgram(e.shape);return this.runWebGLProgram(t,[e],e.dtype,null,!0)}packedReshape(e,t){let r=[k.getBatchDim(e.shape),...k.getRowsCols(e.shape)],n={dtype:e.dtype,shape:r,dataId:e.dataId},s=[k.getBatchDim(t),...k.getRowsCols(t)],a=new g.ReshapePackedProgram(s,r),o=this.runWebGLProgram(a,[n],e.dtype,[r],!0);return{dataId:o.dataId,shape:t,dtype:o.dtype}}decode(e,t){let r;let{isPacked:n,shape:a,dtype:i}=this.texData.get(e);if(null!=t){let e=(0,s.util).sizeFromShape(a),r=t[0]*t[1]*4;(0,s.util).assert(e<=r,()=>"customTexShape is too small. Row * Column * 4 should be equal or larger than the size of the tensor data.")}let u=k.getShapeAs3D(a);r=n?new l.DecodeMatrixPackedProgram(u):new o.DecodeMatrixProgram(u);let p=[null!=t?t:x.getDenseTexShape(u)],c=this.runWebGLProgram(r,[{shape:u,dtype:i,dataId:e}],i,p,!0,t);return{dtype:i,shape:a,dataId:c.dataId}}runWebGLProgram(e,t,r,n,a=!1,o){let l;let i=this.makeTensorInfo(e.outputShape,r),u=this.texData.get(i.dataId);if(e.packedOutput&&(u.isPacked=!0),e.outPackingScheme===x.PackingScheme.DENSE){let t=null!=o?o:x.getDenseTexShape(e.outputShape);u.texShape=t.map(e=>2*e)}if(null!=e.outTexUsage&&(u.usage=e.outTexUsage),0===(0,s.util).sizeFromShape(i.shape))return u.values=(0,s.util).getTypedArrayFromDType(i.dtype,0),i;let p=[],c=t.map(t=>{if("complex64"===t.dtype)throw Error("GPGPUProgram does not support complex64 input. For complex64 dtypes, please separate the program into real and imaginary parts.");let r=this.texData.get(t.dataId);if(null==r.texture){if(!e.packedInputs&&(0,s.util).sizeFromShape(t.shape)<=(0,s.env)().getNumber("WEBGL_SIZE_UPLOAD_UNIFORM"))return{shape:t.shape,texData:null,isUniform:!0,uniformValues:r.values};e.packedInputs&&(r.isPacked=!0,r.shape=t.shape)}if(this.uploadToGPU(t.dataId),!!r.isPacked!=!!e.packedInputs)t=r.isPacked?this.unpackTensor(t):this.packTensor(t),p.push(t),r=this.texData.get(t.dataId);else if(r.isPacked&&!k.isReshapeFree(r.shape,t.shape)){let e=t,n=t.shape;t.shape=r.shape,t=this.packedReshape(t,n),p.push(t),r=this.texData.get(t.dataId),e.shape=n}return{shape:t.shape,texData:r,isUniform:!1}});this.uploadToGPU(i.dataId);let d={shape:i.shape,texData:u,isUniform:!1},h=f.makeShaderKey(e,c,d),m=this.getAndSaveBinary(h,()=>f.compileProgram(this.gpgpu,e,c,d)),g=null!=this.activeTimers;g&&(l=this.startTimer()),(0,s.env)().get("ENGINE_COMPILE_ONLY")||f.runProgram(this.gpgpu,m,c,d,n),p.forEach(e=>this.disposeIntermediateTensorInfo(e)),g&&(l=this.endTimer(l),this.activeTimers.push({name:e.constructor.name,query:this.getQueryTime(l)}));let v=(0,s.env)().getNumber("WEBGL_FLUSH_THRESHOLD");if(v>0){let e=(0,s.util).now();e-this.lastGlFlushTime>v&&(this.gpgpu.gl.flush(),this.lastGlFlushTime=e)}if(!(0,s.env)().getBool("WEBGL_LAZILY_UNPACK")&&u.isPacked&&!1===a){let e=this.unpackTensor(i);return this.disposeIntermediateTensorInfo(i),e}return i}compileAndRun(e,t,r,n,s=!1){return r=r||t[0].dtype,this.runWebGLProgram(e,t,r,n,s)}getAndSaveBinary(e,t){return e in this.binaryCache||(this.binaryCache[e]=t()),this.binaryCache[e]}getTextureManager(){return this.textureManager}dispose(){this.disposed||((0,s.env)().getBool("IS_TEST")||Object.keys(this.binaryCache).forEach(e=>{this.gpgpu.deleteProgram(this.binaryCache[e].webGLProgram),delete this.binaryCache[e]}),this.textureManager.dispose(),null!=this.canvas&&"undefined"!=typeof HTMLCanvasElement&&this.canvas instanceof HTMLCanvasElement?this.canvas.remove():this.canvas=null,this.gpgpuCreatedLocally&&(this.gpgpu.program=null,this.gpgpu.dispose()),this.disposed=!0)}floatPrecision(){return null==this.floatPrecisionValue&&(this.floatPrecisionValue=(0,s.tidy)(()=>{if(!(0,s.env)().get("WEBGL_RENDER_FLOAT32_ENABLED")){let e=(0,s.env)().getBool("DEBUG");(0,s.env)().set("DEBUG",!1);let t=this.abs((0,s.scalar)(1e-8)).dataSync()[0];if((0,s.env)().set("DEBUG",e),t>0)return 32}return 16})),this.floatPrecisionValue}epsilon(){return 32===this.floatPrecision()?I:C}uploadToGPU(e){let t;let r=this.texData.get(e),{shape:n,dtype:a,values:o,texture:l,usage:i,isPacked:u}=r;if(null!=l)return;let d=null!=this.activeTimers;d&&(t=(0,s.util).now());let f=r.texShape;if(null==f&&(f=k.getTextureShapeFromLogicalShape(n,u),r.texShape=f),null!=o){let e;let l=k.getShapeAs3D(n),i=f[1],h=f[0],m=o instanceof Uint8Array||o instanceof Uint8ClampedArray;(u||!m)&&([i,h]=x.getPackedMatrixTextureShapeWidthHeight(f[0],f[1])),e=u?new c.EncodeMatrixPackedProgram(l,m):new p.EncodeMatrixProgram(l,m);let g=m?[h,i]:f,v=this.makeTensorInfo(g,a),y=this.texData.get(v.dataId);m?y.usage=x.TextureUsage.PIXELS:y.usage=x.TextureUsage.UPLOAD,y.texShape=g,this.gpgpu.uploadDenseMatrixToTexture(this.getTexture(v.dataId),i,h,o);let b=[[h,i]],_=this.runWebGLProgram(e,[v],a,b,!0),j=this.texData.get(_.dataId);r.texShape=j.texShape,r.isPacked=j.isPacked,r.usage=j.usage,(0,s.env)().get("ENGINE_COMPILE_ONLY")?this.disposeData(_.dataId):(r.texture=j.texture,r.values=null,this.texData.delete(_.dataId)),this.disposeIntermediateTensorInfo(v),d&&(this.uploadWaitMs+=(0,s.util).now()-t)}else{let e=this.acquireTexture(f,i,a,u);r.texture=e}}convertAndCacheOnCPU(e,t){let r=this.texData.get(e),{dtype:n}=r;return null!=t&&(r.values=function(e,t){if("float32"===t||"complex64"===t)return e;if("int32"===t||"bool"===t){let r="int32"===t?new Int32Array(e.length):new Uint8Array(e.length);for(let t=0;t1048576*this.numMBBeforeWarning){let e=(this.numBytesInGPU/1024/1024).toFixed(2);this.warnedAboutMemory=!0,console.warn(`High memory usage in GPU: ${e} MB, most likely due to a memory leak`)}return this.textureManager.acquireTexture(e,t,n)}computeBytes(e,t){return e[0]*e[1]*(0,s.util).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)}for(let[,t]of Object.entries(this.binaryCache)){let r=new Promise(e=>{try{this.checkCompletion_(t),e(!0)}catch(e){throw e}});e.push(r)}return Promise.all(e)}async checkCompletionAsync_(e){return this.gpgpu.gl.getProgramParameter(e.webGLProgram,this.gpgpu.parallelCompilationExtension.COMPLETION_STATUS_KHR)?this.checkCompletion_(e):(await (0,s.nextFrame)(),this.checkCompletionAsync_(e))}checkCompletion_(e){if(!1===this.gpgpu.gl.getProgramParameter(e.webGLProgram,this.gpgpu.gl.LINK_STATUS)){if(console.log(this.gpgpu.gl.getProgramInfoLog(e.webGLProgram)),!1===this.gpgpu.gl.getShaderParameter(e.fragmentShader,this.gpgpu.gl.COMPILE_STATUS))throw k.logShaderSourceAndInfoLog(e.source,this.gpgpu.gl.getShaderInfoLog(e.fragmentShader)),Error("Failed to compile fragment shader.");throw 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:r,infLoc:n,nanLoc:s,outShapeLocation:a,outShapeStridesLocation:o,outTexShapeLocation:l}=(0,f.getUniformLocations)(this.gpgpu,e.program,e.webGLProgram);e.variablesLocations=t,e.customUniformLocations=r,e.infLoc=n,e.nanLoc=s,e.outShapeLocation=a,e.outShapeStridesLocation=o,e.outTexShapeLocation=l}}createTensorFromGPUData(e,t,r){e.channels=e.channels||"RGBA";let{texture:n,height:a,width:o,channels:l}=e,i=(0,s.engine)().backend;if(!i.gpgpu.gl.isTexture(n))throw 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=i.writeTexture(n,t,r,a,o,l);return(0,s.engine)().makeTensorFromDataId(u,t,r,i)}}N.nextDataId=0},{"./flags_webgl":"93u9u","@tensorflow/tfjs-core":"2nuhV","./canvas_util":"6IMgE","./decode_matrix_gpu":"4D4OR","./decode_matrix_packed_gpu":"iUn2H","./encode_float_gpu":"evMMs","./encode_float_packed_gpu":"gaB4d","./encode_matrix_gpu":"6qQjr","./encode_matrix_packed_gpu":"8njF7","./gpgpu_context":"a8QiN","./gpgpu_math":"f1P40","./kernel_utils/shared":"01kMd","./pack_gpu":"j1gcG","./reshape_packed_gpu":"eOdKZ","./tex_util":"9R0ee","./texture_manager":"5CLPF","./unaryop_gpu":"iNthQ","./unaryop_packed_gpu":"k4CIw","./unpack_gpu":"3bIZY","./webgl_util":"90dxa","@parcel/transformer-js/src/esmodule-helpers.js":"9pCYc"}],"93u9u":[function(e,t,r){/** * @license * Copyright 2019 Google LLC. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. * ============================================================================= */var n=e("@tensorflow/tfjs-core"),s=e("./webgl_util");let a=(0,n.env)();a.registerFlag("HAS_WEBGL",()=>a.getNumber("WEBGL_VERSION")>0),a.registerFlag("WEBGL_VERSION",()=>(0,s.isWebGLVersionEnabled)(2)?2:(0,s.isWebGLVersionEnabled)(1)?1:0),a.registerFlag("WEBGL_CHECK_NUMERICAL_PROBLEMS",()=>!1),a.registerFlag("WEBGL_BUFFER_SUPPORTED",()=>2===a.get("WEBGL_VERSION")),a.registerFlag("WEBGL_CPU_FORWARD",()=>!0),a.registerFlag("WEBGL_FORCE_F16_TEXTURES",()=>!1),a.registerFlag("WEBGL_PACK",()=>a.getBool("HAS_WEBGL")),a.registerFlag("WEBGL_PACK_NORMALIZATION",()=>a.getBool("WEBGL_PACK")),a.registerFlag("WEBGL_PACK_CLIP",()=>a.getBool("WEBGL_PACK")),a.registerFlag("WEBGL_PACK_DEPTHWISECONV",()=>a.getBool("WEBGL_PACK")),a.registerFlag("WEBGL_PACK_BINARY_OPERATIONS",()=>a.getBool("WEBGL_PACK")),a.registerFlag("WEBGL_PACK_UNARY_OPERATIONS",()=>a.getBool("WEBGL_PACK")),a.registerFlag("WEBGL_PACK_ARRAY_OPERATIONS",()=>a.getBool("WEBGL_PACK")),a.registerFlag("WEBGL_PACK_IMAGE_OPERATIONS",()=>a.getBool("WEBGL_PACK")),a.registerFlag("WEBGL_PACK_REDUCE",()=>a.getBool("WEBGL_PACK")),a.registerFlag("WEBGL_LAZILY_UNPACK",()=>a.getBool("WEBGL_PACK")),a.registerFlag("WEBGL_CONV_IM2COL",()=>a.getBool("WEBGL_PACK")),a.registerFlag("WEBGL_PACK_CONV2DTRANSPOSE",()=>a.getBool("WEBGL_PACK")),a.registerFlag("WEBGL_MAX_TEXTURE_SIZE",()=>(0,s.getWebGLMaxTextureSize)(a.getNumber("WEBGL_VERSION"))),a.registerFlag("WEBGL_MAX_TEXTURES_IN_SHADER",()=>(0,s.getMaxTexturesInShader)(a.getNumber("WEBGL_VERSION"))),a.registerFlag("WEBGL_DISJOINT_QUERY_TIMER_EXTENSION_VERSION",()=>{let e=a.getNumber("WEBGL_VERSION");return 0===e?0:(0,s.getWebGLDisjointQueryTimerVersion)(e)}),a.registerFlag("WEBGL_DISJOINT_QUERY_TIMER_EXTENSION_RELIABLE",()=>a.getNumber("WEBGL_DISJOINT_QUERY_TIMER_EXTENSION_VERSION")>0&&!(0,n.device_util).isMobile()),a.registerFlag("WEBGL_RENDER_FLOAT32_CAPABLE",()=>(0,s.isCapableOfRenderingToFloatTexture)(a.getNumber("WEBGL_VERSION"))),a.registerFlag("WEBGL_RENDER_FLOAT32_ENABLED",()=>!a.getBool("WEBGL_FORCE_F16_TEXTURES")&&a.getBool("WEBGL_RENDER_FLOAT32_CAPABLE")),a.registerFlag("WEBGL_DOWNLOAD_FLOAT_ENABLED",()=>(0,s.isDownloadFloatTextureEnabled)(a.getNumber("WEBGL_VERSION"))),a.registerFlag("WEBGL_FENCE_API_ENABLED",()=>(0,s.isWebGLFenceEnabled)(a.getNumber("WEBGL_VERSION"))),a.registerFlag("WEBGL_SIZE_UPLOAD_UNIFORM",()=>a.getBool("WEBGL_RENDER_FLOAT32_ENABLED")?4:0),a.registerFlag("WEBGL_DELETE_TEXTURE_THRESHOLD",()=>-1,e=>{if("number"!=typeof e)throw Error(`WEBGL_DELETE_TEXTURE_THRESHOLD must be a number but got ${e}.`);if(e<0&&-1!==e)throw Error(`WEBGL_DELETE_TEXTURE_THRESHOLD must be -1 (indicating never delete) or at least 0, but got ${e}.`)}),a.registerFlag("WEBGL_FLUSH_THRESHOLD",()=>(0,n.device_util).isMobile()?1:-1,e=>{if("number"!=typeof e)throw Error(`WEBGL_FLUSH_THRESHOLD must be a number but got ${e}.`);if(e<0&&-1!==e)throw Error(`WEBGL_FLUSH_THRESHOLD must be -1 (indicating never manual flush) or at least 0, but got ${e}.`)}),a.registerFlag("CPU_HANDOFF_SIZE_THRESHOLD",()=>128),a.registerFlag("WEBGL_USE_SHAPES_UNIFORMS",()=>!1),a.registerFlag("TOPK_LAST_DIM_CPU_HANDOFF_SIZE_THRESHOLD",()=>1e5),a.registerFlag("TOPK_K_CPU_HANDOFF_THRESHOLD",()=>128),a.registerFlag("WEBGL_EXP_CONV",()=>!1),a.registerFlag("SOFTWARE_WEBGL_ENABLED",()=>a.getBool("IS_TEST")),a.registerFlag("WEBGL_MAX_SIZE_FOR_NARROW_TEXTURE",()=>1/0),a.registerFlag("WEBGL_AUTO_SQUARIFY_NARROW_TEXTURE_SHAPE",()=>!1),a.registerFlag("WEBGL2_ISNAN_CUSTOM",()=>!1),a.registerFlag("ENGINE_COMPILE_ONLY",()=>!1)},{"@tensorflow/tfjs-core":"2nuhV","./webgl_util":"90dxa"}],"90dxa":[function(e,t,r){let n,s;/** * @license * Copyright 2017 Google LLC. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. * ============================================================================= */var a=e("@parcel/transformer-js/src/esmodule-helpers.js");a.defineInteropFlag(r),a.export(r,"callAndCheck",()=>u),a.export(r,"canBeRepresented",()=>p),a.export(r,"getWebGLErrorMessage",()=>c),a.export(r,"getExtensionOrThrow",()=>d),a.export(r,"createVertexShader",()=>f),a.export(r,"createFragmentShader",()=>h),a.export(r,"logShaderSourceAndInfoLog",()=>g),a.export(r,"createProgram",()=>x),a.export(r,"linkProgram",()=>v),a.export(r,"validateProgram",()=>y),a.export(r,"createStaticVertexBuffer",()=>b),a.export(r,"createStaticIndexBuffer",()=>_),a.export(r,"getNumChannels",()=>k),a.export(r,"createTexture",()=>j),a.export(r,"validateTextureSize",()=>I),a.export(r,"createFramebuffer",()=>C),a.export(r,"bindVertexBufferToProgramAttribute",()=>w),a.export(r,"bindTextureUnit",()=>T),a.export(r,"unbindTextureUnit",()=>S),a.export(r,"getProgramUniformLocationOrThrow",()=>N),a.export(r,"getProgramUniformLocation",()=>E),a.export(r,"bindTextureToProgramUniformSampler",()=>F),a.export(r,"bindCanvasToFramebuffer",()=>R),a.export(r,"bindColorTextureToFramebuffer",()=>A),a.export(r,"unbindColorTextureFromFramebuffer",()=>P),a.export(r,"validateFramebuffer",()=>D),a.export(r,"getFramebufferErrorMessage",()=>$),a.export(r,"getBatchDim",()=>V),a.export(r,"getRowsCols",()=>B),a.export(r,"getShapeAs3D",()=>L),a.export(r,"getTextureShapeFromLogicalShape",()=>G),a.export(r,"isReshapeFree",()=>z),a.export(r,"getWebGLMaxTextureSize",()=>U),a.export(r,"resetMaxTextureSize",()=>Y),a.export(r,"resetMaxTexturesInShader",()=>W),a.export(r,"getMaxTexturesInShader",()=>q),a.export(r,"getWebGLDisjointQueryTimerVersion",()=>K),a.export(r,"hasExtension",()=>H),a.export(r,"isWebGLVersionEnabled",()=>X),a.export(r,"isCapableOfRenderingToFloatTexture",()=>Q),a.export(r,"isDownloadFloatTextureEnabled",()=>J),a.export(r,"isWebGLFenceEnabled",()=>ee),a.export(r,"assertNotComplex",()=>et);var o=e("@tensorflow/tfjs-core"),l=e("./canvas_util"),i=e("./tex_util");function u(e,t){let r=t();return(0,o.env)().getBool("DEBUG")&&function(e){let t=e.getError();if(t!==e.NO_ERROR)throw Error("WebGL Error: "+c(e,t))}(e),r}function p(e){return!!((0,o.env)().getBool("WEBGL_RENDER_FLOAT32_ENABLED")||0===e||596e-10Math.abs(e))}function c(e,t){switch(t){case e.NO_ERROR:return"NO_ERROR";case e.INVALID_ENUM:return"INVALID_ENUM";case e.INVALID_VALUE:return"INVALID_VALUE";case e.INVALID_OPERATION:return"INVALID_OPERATION";case e.INVALID_FRAMEBUFFER_OPERATION:return"INVALID_FRAMEBUFFER_OPERATION";case e.OUT_OF_MEMORY:return"OUT_OF_MEMORY";case e.CONTEXT_LOST_WEBGL:return"CONTEXT_LOST_WEBGL";default:return`Unknown error code ${t}`}}function d(e,t){return M(e,()=>e.getExtension(t),'Extension "'+t+'" not supported on this browser.')}function f(e,t){let r=M(e,()=>e.createShader(e.VERTEX_SHADER),"Unable to create vertex WebGLShader.");if(u(e,()=>e.shaderSource(r,t)),u(e,()=>e.compileShader(r)),!1===e.getShaderParameter(r,e.COMPILE_STATUS))throw console.log(e.getShaderInfoLog(r)),Error("Failed to compile vertex shader.");return r}function h(e,t){let r=M(e,()=>e.createShader(e.FRAGMENT_SHADER),"Unable to create fragment WebGLShader.");if(u(e,()=>e.shaderSource(r,t)),u(e,()=>e.compileShader(r)),(0,o.env)().get("ENGINE_COMPILE_ONLY"))return r;if(!1===e.getShaderParameter(r,e.COMPILE_STATUS))throw g(t,e.getShaderInfoLog(r)),Error("Failed to compile fragment shader.");return r}let m=/ERROR: [0-9]+:([0-9]+):/g;function g(e,t){let r=m.exec(t);if(null==r){console.log(`Couldn't parse line number in error: ${t}`),console.log(e);return}let n=+r[1],s=e.split("\n"),a=s.length.toString().length+2,l=s.map((e,t)=>(0,o.util).rightPad((t+1).toString(),a)+e),i=0;for(let e=0;ee.createProgram(),"Unable to create WebGLProgram.")}function v(e,t){if(u(e,()=>e.linkProgram(t)),!(0,o.env)().get("ENGINE_COMPILE_ONLY")&&!1===e.getProgramParameter(t,e.LINK_STATUS))throw console.log(e.getProgramInfoLog(t)),Error("Failed to link vertex and fragment shaders.")}function y(e,t){if(u(e,()=>e.validateProgram(t)),!1===e.getProgramParameter(t,e.VALIDATE_STATUS))throw console.log(e.getProgramInfoLog(t)),Error("Shader program validation failed.")}function b(e,t){let r=M(e,()=>e.createBuffer(),"Unable to create WebGLBuffer");return u(e,()=>e.bindBuffer(e.ARRAY_BUFFER,r)),u(e,()=>e.bufferData(e.ARRAY_BUFFER,t,e.STATIC_DRAW)),r}function _(e,t){let r=M(e,()=>e.createBuffer(),"Unable to create WebGLBuffer");return u(e,()=>e.bindBuffer(e.ELEMENT_ARRAY_BUFFER,r)),u(e,()=>e.bufferData(e.ELEMENT_ARRAY_BUFFER,t,e.STATIC_DRAW)),r}function k(){return 2===(0,o.env)().getNumber("WEBGL_VERSION")?1:4}function j(e){return M(e,()=>e.createTexture(),"Unable to create WebGLTexture.")}function I(e,t){let r=(0,o.env)().getNumber("WEBGL_MAX_TEXTURE_SIZE");if(e<=0||t<=0)throw Error(`Requested texture size [${e}x${t}] is invalid.`);if(e>r||t>r)throw Error(`Requested texture size [${e}x${t}] greater than WebGL maximum on this browser / GPU [${r}x${r}].`)}function C(e){return M(e,()=>e.createFramebuffer(),"Unable to create WebGLFramebuffer.")}function w(e,t,r,n,s,a,o){let l=e.getAttribLocation(t,r);return -1!==l&&(u(e,()=>e.bindBuffer(e.ARRAY_BUFFER,n)),u(e,()=>e.vertexAttribPointer(l,s,e.FLOAT,!1,a,o)),u(e,()=>e.enableVertexAttribArray(l)),!0)}function T(e,t,r){O(e,r),u(e,()=>e.activeTexture(e.TEXTURE0+r)),u(e,()=>e.bindTexture(e.TEXTURE_2D,t))}function S(e,t){O(e,t),u(e,()=>e.activeTexture(e.TEXTURE0+t)),u(e,()=>e.bindTexture(e.TEXTURE_2D,null))}function N(e,t,r){return M(e,()=>e.getUniformLocation(t,r),'uniform "'+r+'" not present in program.')}function E(e,t,r){return e.getUniformLocation(t,r)}function F(e,t,r,n){u(e,()=>T(e,t,n)),u(e,()=>e.uniform1i(r,n))}function R(e){u(e,()=>e.bindFramebuffer(e.FRAMEBUFFER,null)),u(e,()=>e.viewport(0,0,e.canvas.width,e.canvas.height)),u(e,()=>e.scissor(0,0,e.canvas.width,e.canvas.height))}function A(e,t,r){u(e,()=>e.bindFramebuffer(e.FRAMEBUFFER,r)),u(e,()=>e.framebufferTexture2D(e.FRAMEBUFFER,e.COLOR_ATTACHMENT0,e.TEXTURE_2D,t,0))}function P(e,t){u(e,()=>e.bindFramebuffer(e.FRAMEBUFFER,t)),u(e,()=>e.framebufferTexture2D(e.FRAMEBUFFER,e.COLOR_ATTACHMENT0,e.TEXTURE_2D,null,0))}function D(e){let t=e.checkFramebufferStatus(e.FRAMEBUFFER);if(t!==e.FRAMEBUFFER_COMPLETE)throw Error("Error binding framebuffer: "+$(e,t))}function $(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 M(e,t,r){let n=u(e,()=>t());if(null==n)throw Error(r);return n}function O(e,t){let r=e.MAX_COMBINED_TEXTURE_IMAGE_UNITS-1,n=t+e.TEXTURE0;if(nr){let e=`[gl.TEXTURE0, gl.TEXTURE${r}]`;throw Error(`textureUnit must be in ${e}.`)}}function V(e,t=2){return(0,o.util).sizeFromShape(e.slice(0,e.length-t))}function B(e){if(0===e.length)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 L(e){let t=[1,1,1];return 0===e.length||1===e.length&&1===e[0]||(t=[V(e),...B(e)]),t}function G(e,t=!1){let r=(0,o.env)().getNumber("WEBGL_MAX_TEXTURE_SIZE"),n=(0,o.env)().getNumber("WEBGL_MAX_SIZE_FOR_NARROW_TEXTURE");n===1/0&&(0,o.env)().getBool("WEBGL_AUTO_SQUARIFY_NARROW_TEXTURE_SHAPE")&&(n=r/2),t&&(r*=2,n*=2,1===(e=e.map((t,r)=>r>=e.length-2?(0,o.util).nearestLargerEven(e[r]):e[r])).length&&(e=[2,e[0]])),2!==e.length&&(e=(0,o.util).squeezeShape(e).newShape);let s=(0,o.util).sizeFromShape(e),a=null;e.length<=1&&s<=r?a=[1,s]:2===e.length&&e[0]<=r&&e[1]<=r?a=e:3===e.length&&e[0]*e[1]<=r&&e[2]<=r?a=[e[0]*e[1],e[2]]:3===e.length&&e[0]<=r&&e[1]*e[2]<=r?a=[e[0],e[1]*e[2]]:4===e.length&&e[0]*e[1]*e[2]<=r&&e[3]<=r?a=[e[0]*e[1]*e[2],e[3]]:4===e.length&&e[0]<=r&&e[1]*e[2]*e[3]<=r&&(a=[e[0],e[1]*e[2]*e[3]]);let l=null!=a&&Math.max(...a)>n&&Math.min(...a)<=(t?2:1)&&Math.min(...a)>0;if(null==a||l){if(t){let t=V(e),r=2,n=2;e.length&&([r,n]=B(e)),s=r/2*t*(n/2),a=(0,o.util).sizeToSquarishShape(s).map(e=>2*e)}else a=(0,o.util).sizeToSquarishShape(s)}return a}function z(e,t){if(e=e.slice(-2),t=t.slice(-2),(0,o.util).arraysEqual(e,t)||!e.length||!t.length||0===e[0]||0===e[1]||0===t[0]||0===t[1])return!0;if(e.length!==t.length){let r=e[e.length-1],n=t[t.length-1];if(r===n||r%2==0&&n%2==0&&(1===e[0]||1===t[0]))return!0}return e[1]===t[1]&&e[0]%2==0&&t[0]%2==0}function U(e){if(null==n){let t=(0,l.getWebGLContext)(e);n=t.getParameter(t.MAX_TEXTURE_SIZE)}return n}function Y(){n=null}function W(){s=null}function q(e){if(null==s){let t=(0,l.getWebGLContext)(e);s=t.getParameter(t.MAX_TEXTURE_IMAGE_UNITS)}return Math.min(16,s)}function K(e){if(0===e)return 0;let t=(0,l.getWebGLContext)(e);return H(t,"EXT_disjoint_timer_query_webgl2")&&2===e?2:H(t,"EXT_disjoint_timer_query")?1:0}function H(e,t){return null!=e.getExtension(t)}function X(e){try{let t=(0,l.getWebGLContext)(e);if(null!=t)return!0}catch(e){console.log("Error when getting WebGL context: ",e)}return!1}function Q(e){if(0===e)return!1;let t=(0,l.getWebGLContext)(e);if(1===e){if(!H(t,"OES_texture_float"))return!1}else if(!H(t,"EXT_color_buffer_float"))return!1;return Z(t)}function J(e){if(0===e)return!1;let t=(0,l.getWebGLContext)(e);if(1===e){if(!H(t,"OES_texture_float")||!H(t,"WEBGL_color_buffer_float"))return!1}else{if(H(t,"EXT_color_buffer_float"))return Z(t);let e="EXT_color_buffer_half_float";if(H(t,e)){let r=t.getExtension(e);return function(e,t){let r=(0,i.getTextureConfig)(e,t),n=e.createTexture();e.bindTexture(e.TEXTURE_2D,n),e.texImage2D(e.TEXTURE_2D,0,r.internalFormatHalfFloat,1,1,0,r.textureFormatFloat,r.textureTypeHalfFloat,null);let s=e.createFramebuffer();e.bindFramebuffer(e.FRAMEBUFFER,s),e.framebufferTexture2D(e.FRAMEBUFFER,e.COLOR_ATTACHMENT0,e.TEXTURE_2D,n,0);let a=e.checkFramebufferStatus(e.FRAMEBUFFER)===e.FRAMEBUFFER_COMPLETE;return e.bindTexture(e.TEXTURE_2D,null),e.bindFramebuffer(e.FRAMEBUFFER,null),e.deleteTexture(n),e.deleteFramebuffer(s),a}(t,r)}return!1}return Z(t)}function Z(e){let t=(0,i.getTextureConfig)(e),r=e.createTexture();e.bindTexture(e.TEXTURE_2D,r),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,r,0);let s=e.checkFramebufferStatus(e.FRAMEBUFFER)===e.FRAMEBUFFER_COMPLETE;return e.bindTexture(e.TEXTURE_2D,null),e.bindFramebuffer(e.FRAMEBUFFER,null),e.deleteTexture(r),e.deleteFramebuffer(n),s}function ee(e){return 2===e&&null!=(0,l.getWebGLContext)(e).fenceSync}function et(e,t){Array.isArray(e)||(e=[e]),e.forEach(e=>{null!=e&&(0,o.util).assert("complex64"!==e.dtype,()=>`${t} does not support complex64 tensors in the WebGL backend.`)})}},{"@tensorflow/tfjs-core":"2nuhV","./canvas_util":"6IMgE","./tex_util":"9R0ee","@parcel/transformer-js/src/esmodule-helpers.js":"9pCYc"}],"6IMgE":[function(e,t,r){/** * @license * Copyright 2018 Google LLC. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. * ============================================================================= */var n=e("@parcel/transformer-js/src/esmodule-helpers.js");n.defineInteropFlag(r),n.export(r,"clearWebGLContext",()=>l),n.export(r,"setWebGLContext",()=>i),n.export(r,"getWebGLContext",()=>function e(t,r){if(!(t in a)||null!=r){let e=function(e,t){if(1!==e&&2!==e)throw Error("Cannot get WebGL rendering context, WebGL is disabled.");let r=null==t?function(e){if(!(0,s.env)().getBool("IS_SAFARI")&&"undefined"!=typeof OffscreenCanvas&&2===e)return new OffscreenCanvas(300,150);if("undefined"!=typeof document)return document.createElement("canvas");throw Error("Cannot create a canvas in this context")}(e):t;return(r.addEventListener("webglcontextlost",t=>{t.preventDefault(),delete a[e]},!1),(0,s.env)().getBool("SOFTWARE_WEBGL_ENABLED")&&(o.failIfMajorPerformanceCaveat=!1),1===e)?r.getContext("webgl",o)||r.getContext("experimental-webgl",o):r.getContext("webgl2",o)}(t,r);if(null===e)return console.log("Could not get context for WebGL version",t),null;a[t]=e}let n=a[t];return null==n||n.isContextLost()?(delete a[t],e(t)):(n.disable(n.DEPTH_TEST),n.disable(n.STENCIL_TEST),n.disable(n.BLEND),n.disable(n.DITHER),n.disable(n.POLYGON_OFFSET_FILL),n.disable(n.SAMPLE_COVERAGE),n.enable(n.SCISSOR_TEST),n.enable(n.CULL_FACE),n.cullFace(n.BACK),a[t])});var s=e("@tensorflow/tfjs-core");let a={},o={alpha:!1,antialias:!1,premultipliedAlpha:!1,preserveDrawingBuffer:!1,depth:!1,stencil:!1,failIfMajorPerformanceCaveat:!0};function l(e){delete a[e]}function i(e,t){a[e]=t}},{"@tensorflow/tfjs-core":"2nuhV","@parcel/transformer-js/src/esmodule-helpers.js":"9pCYc"}],"9R0ee":[function(e,t,r){/** * @license * Copyright 2017 Google LLC. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. * ============================================================================= */var n,s,a,o,l,i,u=e("@parcel/transformer-js/src/esmodule-helpers.js");u.defineInteropFlag(r),u.export(r,"PackingScheme",()=>o),u.export(r,"TextureUsage",()=>l),u.export(r,"PhysicalTextureType",()=>i),u.export(r,"getUnpackedMatrixTextureShapeWidthHeight",()=>c),u.export(r,"getUnpackedArraySizeFromMatrixSize",()=>d),u.export(r,"getColorMatrixTextureShapeWidthHeight",()=>f),u.export(r,"getDenseTexShape",()=>h),u.export(r,"getMatrixSizeFromUnpackedArraySize",()=>m),u.export(r,"decodeMatrixFromUnpackedColorRGBAArray",()=>g),u.export(r,"getPackedMatrixTextureShapeWidthHeight",()=>x),u.export(r,"getPackedRGBAArraySizeFromMatrixShape",()=>v),u.export(r,"getTextureConfig",()=>y);var p=e("@tensorflow/tfjs-core");function c(e,t){return[t,e]}function d(e,t){return e*t}function f(e,t){return[4*t,e]}function h(e){let t=Math.ceil((0,p.util).sizeFromShape(e)/4);return(0,p.util).sizeToSquarishShape(t)}function m(e,t){if(e%t!=0)throw Error(`unpackedSize (${e}) must be a multiple of ${t}`);return e/t}function g(e,t,r){let n=e.length*r/4;if(t.length= ${n}`);let s=0;for(let n=0;ni);var s=e("./glsl_version"),a=e("./gpgpu_math"),o=e("./shader_compiler_util"),l=e("./tex_util");class i{constructor(e){this.variableNames=["A"],this.packedInputs=!1,this.packedOutput=!0,this.outPackingScheme=l.PackingScheme.DENSE,this.customUniforms=[{name:"texShape",type:"ivec2"}];let t=(0,s.getGlslDifferences)();this.outputShape=e,this.enableShapeUniforms=(0,a.useShapeUniforms)(this.outputShape.length),this.userCode=` ivec3 outCoordsFromFlatIndex(int index) { ${this.enableShapeUniforms?o.getOutputLogicalCoordinatesFromFlatIndexByUniform(["r","c","d"],e):o.getLogicalCoordinatesFromFlatIndex(["r","c","d"],e)} return ivec3(r, c, d); } void main() { ivec2 resTexRC = ivec2(resultUV.yx * vec2(texShape[0], texShape[1])); int index = 4 * (resTexRC.x * texShape[1] + resTexRC.y); vec4 result = vec4(0.); for (int i=0; i<4; i++) { int flatIndex = index + i; ivec3 rc = outCoordsFromFlatIndex(flatIndex); result[i] = getA(rc.x, rc.y, rc.z); } ${t.output} = result; } `}}},{"./glsl_version":"aKRJc","./gpgpu_math":"f1P40","./shader_compiler_util":"6NnjI","./tex_util":"9R0ee","@parcel/transformer-js/src/esmodule-helpers.js":"9pCYc"}],aKRJc:[function(e,t,r){/** * @license * Copyright 2018 Google LLC. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. * ============================================================================= */var n=e("@parcel/transformer-js/src/esmodule-helpers.js");n.defineInteropFlag(r),n.export(r,"getGlslDifferences",()=>a);var s=e("@tensorflow/tfjs-core");function a(){let e,t,r,n,a,o,l,i,u,p;return 2===(0,s.env)().getNumber("WEBGL_VERSION")?(e="#version 300 es",t="in",r="out",n="in",a="texture",o="outputColor",l="out vec4 outputColor;",i=(0,s.env)().getBool("WEBGL2_ISNAN_CUSTOM")?` bool isnan_custom(float val) { uint floatToUint = floatBitsToUint(val); return (floatToUint & 0x7fffffffu) > 0x7f800000u; } bvec4 isnan_custom(vec4 val) { return bvec4(isnan_custom(val.x), isnan_custom(val.y), isnan_custom(val.z), isnan_custom(val.w)); } #define isnan(value) isnan_custom(value) `:"",u="",p=` #define round(value) newRound(value) int newRound(float value) { return int(floor(value + 0.5)); } ivec4 newRound(vec4 value) { return ivec4(floor(value + vec4(0.5))); } `):(e="",t="attribute",r="varying",n="varying",a="texture2D",o="gl_FragColor",l="",i=` #define isnan(value) isnan_custom(value) bool isnan_custom(float val) { return (val > 0. || val< 1. || val == 0.) ? false : true; } bvec4 isnan_custom(vec4 val) { return bvec4(isnan(val.x), isnan(val.y), isnan(val.z), isnan(val.w)); } `,u=` uniform float INFINITY; bool isinf(float val) { return abs(val) == INFINITY; } bvec4 isinf(vec4 val) { return equal(abs(val), vec4(INFINITY)); } `,p=` int round(float value) { return int(floor(value + 0.5)); } ivec4 round(vec4 value) { return ivec4(floor(value + vec4(0.5))); } `),{version:e,attribute:t,varyingVs:r,varyingFs:n,texture2D:a,output:o,defineOutput:l,defineSpecialNaN:i,defineSpecialInf:u,defineRound:p}}},{"@tensorflow/tfjs-core":"2nuhV","@parcel/transformer-js/src/esmodule-helpers.js":"9pCYc"}],f1P40:[function(e,t,r){/** * @license * Copyright 2017 Google LLC. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. * ============================================================================= */var n=e("@parcel/transformer-js/src/esmodule-helpers.js");n.defineInteropFlag(r),n.export(r,"compileProgram",()=>l),n.export(r,"getUniformLocations",()=>i),n.export(r,"runProgram",()=>p),n.export(r,"makeShaderKey",()=>c),n.export(r,"useShapeUniforms",()=>d);var s=e("@tensorflow/tfjs-core"),a=e("./shader_compiler"),o=e("./webgl_util");function l(e,t,r,n){let l=r.map((e,r)=>{let n={logicalShape:e.shape,texShape:e.isUniform?null:e.texData.texShape,isUniform:e.isUniform,isPacked:!e.isUniform&&e.texData.isPacked,flatOffset:null};return null!=e.texData&&null!=e.texData.slice&&e.texData.slice.flatOffset>0&&(n.flatOffset=e.texData.slice.flatOffset),{name:t.variableNames[r],shapeInfo:n}}),u=l.map(e=>e.shapeInfo),p={logicalShape:n.shape,texShape:n.texData.texShape,isUniform:!1,isPacked:n.texData.isPacked,flatOffset:null},c=a.makeShader(l,p,t),d=(0,o.createFragmentShader)(e.gl,c),f=e.createProgram(d);return(0,s.env)().get("ENGINE_COMPILE_ONLY")?{program:t,fragmentShader:d,source:c,webGLProgram:f,inShapeInfos:u,outShapeInfo:p,variablesLocations:null,customUniformLocations:null,infLoc:null,nanLoc:null,outShapeLocation:null,outShapeStridesLocation:null,outTexShapeLocation:null}:(e.buildVao(f),Object.assign({program:t,fragmentShader:d,source:c,webGLProgram:f,inShapeInfos:u,outShapeInfo:p},i(e,t,f)))}function i(e,t,r){let n,a,o;let l=[],i=[],u=null,p=null;for(let n of(p=e.getUniformLocation(r,"NAN",!1),1===(0,s.env)().getNumber("WEBGL_VERSION")&&(u=e.getUniformLocation(r,"INFINITY",!1)),t.variableNames)){let s={name:n,uniform:e.getUniformLocation(r,n,!1),offset:e.getUniformLocation(r,`offset${n}`,!1)};t.enableShapeUniforms&&(s.shape=e.getUniformLocation(r,`${n}Shape`,!1),s.texShape=e.getUniformLocation(r,`${n}TexShape`,!1)),l.push(s)}if(t.enableShapeUniforms&&(n=e.getUniformLocation(r,"outShape",!1),o=e.getUniformLocation(r,"outShapeStrides",!1),a=e.getUniformLocation(r,"outTexShape",!1)),t.customUniforms)for(let n of t.customUniforms)i.push(e.getUniformLocation(r,n.name,!1));return{variablesLocations:l,customUniformLocations:i,infLoc:u,nanLoc:p,outShapeLocation:n,outShapeStridesLocation:o,outTexShapeLocation:a}}function u(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((e,r)=>{let n=e.logicalShape,a=t[r],o=a.shape;if(!(0,s.util).arraysEqual(n,o))throw Error(`Binary was compiled with different shapes than the current args. Shapes ${n} and ${o} must match`);if(e.isUniform&&a.isUniform)return;let l=e.texShape,i=a.isUniform?null:a.texData.texShape;if(!(0,s.util).arraysEqual(l,i))throw Error(`Binary was compiled with different texture shapes than the current args. Shape ${l} and ${i} must match`)})}function p(e,t,r,n,o){t.program.enableShapeUniforms||(u(t.inShapeInfos,r),u([t.outShapeInfo],[n]));let l=n.texData.texture,i=n.texData.texShape;n.texData.isPacked?e.setOutputPackedMatrixTexture(l.texture,i[0],i[1]):e.setOutputMatrixTexture(l.texture,i[0],i[1]),e.setProgram(t.webGLProgram),e.bindVertexArray(t.webGLProgram.vao),1===(0,s.env)().getNumber("WEBGL_VERSION")&&null!==t.infLoc&&e.gl.uniform1f(t.infLoc,1/0),null!==t.nanLoc&&e.gl.uniform1f(t.nanLoc,NaN);for(let n=0;n(0,s.util).sizeFromShape(o.shape))e.gl.uniform1f(l,o.uniformValues[0]);else{let t=o.uniformValues;t instanceof Float32Array||(t=new Float32Array(t)),e.gl.uniform1fv(l,t)}continue}null!=o.texData.slice&&null!=i&&e.gl.uniform1i(i,o.texData.slice.flatOffset),e.setInputMatrixTexture(o.texData.texture.texture,l,n)}}let p=t.outShapeLocation;if(p)switch(n.shape.length){case 1:e.gl.uniform1iv(p,new Int32Array(n.shape));break;case 2:e.gl.uniform2iv(p,new Int32Array(n.shape));break;case 3:e.gl.uniform3iv(p,new Int32Array(n.shape));break;case 4:e.gl.uniform4iv(p,new Int32Array(n.shape))}if(t.outShapeStridesLocation){let r=(0,s.util).computeStrides(n.shape);switch(n.shape.length){case 2:e.gl.uniform1iv(t.outShapeStridesLocation,new Int32Array(r));break;case 3:e.gl.uniform2iv(t.outShapeStridesLocation,new Int32Array(r));break;case 4:e.gl.uniform3iv(t.outShapeStridesLocation,new Int32Array(r))}}if(t.outTexShapeLocation&&e.gl.uniform2i(t.outTexShapeLocation,n.texData.texShape[0],n.texData.texShape[1]),t.program.customUniforms&&o)for(let r=0;r{let o=null!=t.texData&&null!=t.texData.slice&&t.texData.slice.flatOffset>0;if(e.enableShapeUniforms&&!t.isUniform){let l=t.texData.texShape,{useSqueezeShape:i,uniformShape:u,keptDims:p}=a.getUniformInfoFromShape(e.packedInputs,t.shape,l),c="",d="",f="";if(1===u.length&&e.packedInputs){let e=[Math.ceil(l[0]/2),Math.ceil(l[1]/2)];c=`${e[0]>1}_${e[1]>1}`}else if(2!==u.length||e.packedInputs){if(u.length>2&&!e.packedInputs){let e=(0,s.util).computeStrides(u);f=`${e[0]===l[1]}_${e[e.length-1]===l[1]}`}}else d=`${u[0]>1}_${u[1]>1}`;let h=t.shape.length,m=2===u.length&&(0,s.util).arraysEqual(t.shape,l),g=1===(0,s.util).sizeFromShape(t.shape),x=(0,s.backend_util).getBroadcastDims(t.shape,r.shape),v=!e.packedInputs&&h===r.shape.length&&(0,s.util).arraysEqual(l,r.texData.texShape),y=e.packedInputs||u.length>2?"":`${l[0]>1}_${l[1]>1}`;n+=`${h}_${v}_${i?p:""}_${u.length}_${g}_${x}_${m}_${c}_${d}_${f}_${y}_${o}`}else{let e=t.isUniform?"uniform":t.texData.texShape;n+=`${t.shape}_${e}_${o}`}});let o=e.userCode;return e.constructor.name+("_"+n+"_"+o)+`${(0,s.env)().getNumber("WEBGL_VERSION")}`}function d(e){return(0,s.env)().getBool("WEBGL_USE_SHAPES_UNIFORMS")&&e<=4}},{"@tensorflow/tfjs-core":"2nuhV","./shader_compiler":"3kYYB","./webgl_util":"90dxa","@parcel/transformer-js/src/esmodule-helpers.js":"9pCYc"}],"3kYYB":[function(e,t,r){/** * @license * Copyright 2017 Google LLC. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. * ============================================================================= */var n=e("@parcel/transformer-js/src/esmodule-helpers.js");n.defineInteropFlag(r),n.export(r,"makeShader",()=>i),n.export(r,"getCoordsDataType",()=>g),n.export(r,"getUniformInfoFromShape",()=>x),n.export(r,"squeezeInputInfo",()=>v);var s=e("@tensorflow/tfjs-core"),a=e("./glsl_version"),o=e("./shader_compiler_util");let{getBroadcastDims:l}=s.backend_util;function i(e,t,r){let n,i;let b=[];if(e.forEach(e=>{let t=(0,s.util).sizeFromShape(e.shapeInfo.logicalShape);if(e.shapeInfo.isUniform?b.push(`uniform float ${e.name}${t>1?`[${t}]`:""};`):(b.push(`uniform sampler2D ${e.name};`),b.push(`uniform int offset${e.name};`)),r.enableShapeUniforms){let{uniformShape:t}=x(r.packedInputs,e.shapeInfo.logicalShape,e.shapeInfo.texShape);switch(t.length){case 1:b.push(`uniform int ${e.name}Shape;`);break;case 2:b.push(`uniform ivec2 ${e.name}Shape;`);break;case 3:b.push(`uniform ivec3 ${e.name}Shape;`);break;case 4:b.push(`uniform ivec4 ${e.name}Shape;`)}b.push(`uniform ivec2 ${e.name}TexShape;`)}}),r.enableShapeUniforms){switch(t.logicalShape.length){case 1:b.push("uniform int outShape;");break;case 2:b.push("uniform ivec2 outShape;"),b.push("uniform int outShapeStrides;");break;case 3:b.push("uniform ivec3 outShape;"),b.push("uniform ivec2 outShapeStrides;");break;case 4:b.push("uniform ivec4 outShape;"),b.push("uniform ivec3 outShapeStrides;")}b.push("uniform ivec2 outTexShape;")}r.customUniforms&&r.customUniforms.forEach(e=>{b.push(`uniform ${e.type} ${e.name}${e.arrayIndex?`[${e.arrayIndex}]`:""};`)});let _=b.join("\n"),k=e.map(e=>(function(e,t,r=!1,n){let o="";r?o+=function e(t,r){switch(t.shapeInfo.logicalShape.length){case 0:return function(e){let t=e.name,r="get"+t.charAt(0).toUpperCase()+t.slice(1),n=(0,a.getGlslDifferences)();return` vec4 ${r}() { return ${n.texture2D}(${t}, halfCR); } `}(t);case 1:return function(e,t){let r=e.name,n="get"+r.charAt(0).toUpperCase()+r.slice(1),s=e.shapeInfo.texShape,o=(0,a.getGlslDifferences)();if(t)return` vec4 ${n}(int index) { ivec2 packedTexShape = ivec2(ceil(float(${r}TexShape[0]) / 2.0), ceil(float(${r}TexShape[1]) / 2.0)); vec2 uv = packedUVfrom1D( packedTexShape[0], packedTexShape[1], index); return ${o.texture2D}(${r}, uv); } `;let l=[Math.ceil(s[0]/2),Math.ceil(s[1]/2)];return` vec4 ${n}(int index) { vec2 uv = packedUVfrom1D( ${l[0]}, ${l[1]}, index); return ${o.texture2D}(${r}, uv); } `}(t,r);case 2:return function(e,t){let r=e.shapeInfo.logicalShape,n=e.name,o="get"+n.charAt(0).toUpperCase()+n.slice(1),l=e.shapeInfo.texShape,i=l[0],u=l[1],p=(0,a.getGlslDifferences)();if(null!=l&&(0,s.util).arraysEqual(r,l))return t?` vec4 ${o}(int row, int col) { vec2 uv = (vec2(col, row) + halfCR) / vec2(${n}TexShape[1], ${n}TexShape[0]); return ${p.texture2D}(${n}, uv); } `:` vec4 ${o}(int row, int col) { vec2 uv = (vec2(col, row) + halfCR) / vec2(${u}.0, ${i}.0); return ${p.texture2D}(${n}, uv); } `;if(t)return` vec4 ${o}(int row, int col) { ivec2 packedTexShape = ivec2(ceil(float(${n}TexShape[0]) / 2.0), ceil(float(${n}TexShape[1]) / 2.0)); int valuesPerRow = int(ceil(float(${n}Shape[1]) / 2.0)); vec2 uv = packedUVfrom2D(valuesPerRow, packedTexShape[0], packedTexShape[1], row, col); return ${p.texture2D}(${n}, uv); } `;let c=[Math.ceil(l[0]/2),Math.ceil(l[1]/2)],d=Math.ceil(r[1]/2);return` vec4 ${o}(int row, int col) { vec2 uv = packedUVfrom2D(${d}, ${c[0]}, ${c[1]}, row, col); return ${p.texture2D}(${n}, uv); } `}(t,r);case 3:return function(t,r){let n=t.shapeInfo.logicalShape,s=t.name,o="get"+s.charAt(0).toUpperCase()+s.slice(1),l=t.shapeInfo.texShape,i=[Math.ceil(l[0]/2),Math.ceil(l[1]/2)];if(1===n[0]){let s=v(t,n.slice(1));return` ${e(s,r)} vec4 ${o}(int b, int row, int col) { return ${o}(${y(["b","row","col"],[1,2])}); } `}let u=(0,a.getGlslDifferences)();if(r)return` vec4 ${o}(int b, int row, int col) { ivec2 packedTexShape = ivec2(ceil(float(${s}TexShape[0]) / 2.0), ceil(float(${s}TexShape[1]) / 2.0)); int valuesPerRow = int(ceil(float(${s}Shape[2]) / 2.0)); int texelsInBatch = valuesPerRow * int(ceil(float(${s}Shape[1]) / 2.0)); vec2 uv = packedUVfrom3D( packedTexShape[0], packedTexShape[1], texelsInBatch, valuesPerRow, b, row, col); return ${u.texture2D}(${s}, uv); } `;let p=i[0],c=i[1],d=Math.ceil(n[2]/2),f=d*Math.ceil(n[1]/2);return` vec4 ${o}(int b, int row, int col) { vec2 uv = packedUVfrom3D( ${p}, ${c}, ${f}, ${d}, b, row, col); return ${u.texture2D}(${s}, uv); } `}(t,r);default:return function(e,t){let r=e.name,n="get"+r.charAt(0).toUpperCase()+r.slice(1),s=(0,a.getGlslDifferences)();if(t)return` vec4 ${n}(int b2, int b, int row, int col) { int valuesPerRow = int(ceil(float(${r}Shape[3]) / 2.0)); int texelsInBatch = valuesPerRow * int(ceil(float(${r}Shape[2]) / 2.0)); int index = b * texelsInBatch + (row / 2) * valuesPerRow + (col / 2); texelsInBatch *= ${r}Shape[1]; index = b2 * texelsInBatch + index; ivec2 packedTexShape = ivec2(ceil(float(${r}TexShape[0]) / 2.0), ceil(float(${r}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 ${s.texture2D}(${r}, uv); } `;let o=e.shapeInfo.logicalShape,l=o.length,i=e.shapeInfo.texShape,u=[Math.ceil(i[0]/2),Math.ceil(i[1]/2)],p=u[0],c=u[1],d=Math.ceil(o[l-1]/2),f=d*Math.ceil(o[l-2]/2),h="int b, int row, int col",m=`b * ${f} + (row / 2) * ${d} + (col / 2)`;for(let e=2;e=1?"coords = 0;":u.map(e=>`coords.${d[e+c]} = 0;`).join("\n");let f="";f=i<2&&o>0?"coords":e.shapeInfo.logicalShape.map((e,t)=>`coords.${d[t+c]}`).join(", ");let h="return outputValue;",m=1===(0,s.util).sizeFromShape(e.shapeInfo.logicalShape),x=1===(0,s.util).sizeFromShape(t.logicalShape);if(1!==o||m||x){if(m&&!x)h=1===i?` return vec4(outputValue.x, outputValue.x, 0., 0.); `:` return vec4(outputValue.x); `;else if(u.length){let e=o-2,t=o-1;u.indexOf(e)>-1&&u.indexOf(t)>-1?h="return vec4(outputValue.x);":u.indexOf(e)>-1?h="return vec4(outputValue.x, outputValue.y, outputValue.x, outputValue.y);":u.indexOf(t)>-1&&(h="return vec4(outputValue.xx, outputValue.zz);")}}else h=` return vec4(outputValue.xy, outputValue.xy); `;return` vec4 ${"get"+a+"AtOutCoords"}() { ${p} coords = getOutputCoords(); ${r} vec4 outputValue = get${a}(${f}); ${h} } `}(e,t):o+=function(e,t){let r;let n=e.name,a=n.charAt(0).toUpperCase()+n.slice(1),o="get"+a+"AtOutCoords",i=t.texShape,u=e.shapeInfo.texShape,p=e.shapeInfo.logicalShape.length,c=t.logicalShape.length;if(!e.shapeInfo.isUniform&&p===c&&null==e.shapeInfo.flatOffset&&(0,s.util).arraysEqual(u,i))return` float ${o}() { return sampleTexture(${n}, resultUV); } `;let d=g(c),f=l(e.shapeInfo.logicalShape,t.logicalShape),h=c-p,m=["x","y","z","w","u","v"];r=0===p?"":c<2&&f.length>=1?"coords = 0;":f.map(e=>`coords.${m[e+h]} = 0;`).join("\n");let x="";return x=c<2&&p>0?"coords":e.shapeInfo.logicalShape.map((e,t)=>`coords.${m[t+h]}`).join(", "),` float ${o}() { ${d} coords = getOutputCoords(); ${r} return get${a}(${x}); } `}(e,t)),o})(e,t,r.packedInputs,r.enableShapeUniforms)).join("\n"),j=t.texShape,I=(0,a.getGlslDifferences)(),C=` float sampleTexture(sampler2D textureSampler, vec2 uv) { return ${I.texture2D}(textureSampler, uv).r; } `,w=`${I.version} precision highp float; precision highp int; precision highp sampler2D; ${I.varyingFs} vec2 resultUV; ${I.defineOutput} const vec2 halfCR = vec2(0.5, 0.5); struct ivec5 { int x; int y; int z; int w; int u; }; struct ivec6 { int x; int y; int z; int w; int u; int v; }; uniform float NAN; ${I.defineSpecialNaN} ${I.defineSpecialInf} ${I.defineRound} int imod(int x, int y) { return x - y * (x / y); } int idiv(int a, int b, float sign) { int res = a / b; int mod = imod(a, b); if (sign< 0. && mod != 0) { res -= 1; } return res; } //Based on the work of Dave Hoskins //https://www.shadertoy.com/view/4djSRW #define HASHSCALE1 443.8975 float random(float seed){ vec2 p = resultUV * seed; vec3 p3 = fract(vec3(p.xyx) * HASHSCALE1); p3 += dot(p3, p3.yzx + 19.19); return fract((p3.x + p3.y) * p3.z); } ${u} ${p} ${c} `;return t.isPacked?(n=function(e,t,r){switch(e.length){case 0:return f();case 1:return function(e,t,r){let n=[Math.ceil(t[0]/2),Math.ceil(t[1]/2)];return 1===n[0]?r?` int getOutputCoords() { return 2 * int(resultUV.x * ceil(float(outTexShape[1]) / 2.0)); } `:` int getOutputCoords() { return 2 * int(resultUV.x * ${n[1]}.0); } `:1===n[1]?r?` int getOutputCoords() { return 2 * int(resultUV.y * ceil(float(outTexShape[0]) / 2.0)); } `:` int getOutputCoords() { return 2 * int(resultUV.y * ${n[0]}.0); } `:r?` int getOutputCoords() { ivec2 packedTexShape = ivec2(ceil(float(outTexShape[0]) / 2.0), ceil(float(outTexShape[1]) / 2.0)); ivec2 resTexRC = ivec2(resultUV.yx * vec2(packedTexShape[0], packedTexShape[1])); return 2 * (resTexRC.x * packedTexShape[1] + resTexRC.y); } `:` int getOutputCoords() { ivec2 resTexRC = ivec2(resultUV.yx * vec2(${n[0]}, ${n[1]})); return 2 * (resTexRC.x * ${n[1]} + resTexRC.y); } `}(0,t,r);case 2:return function(e,t,r){let n=[Math.ceil(t[0]/2),Math.ceil(t[1]/2)];if((0,s.util).arraysEqual(e,t))return r?` 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])); } `:` ivec2 getOutputCoords() { return 2 * ivec2(resultUV.yx * vec2(${n[0]}, ${n[1]})); } `;let a=Math.ceil(e[1]/2);return r?` 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)); ivec2 resTexRC = ivec2(resultUV.yx * vec2(packedTexShape[0], packedTexShape[1])); int index = resTexRC.x * packedTexShape[1] + resTexRC.y; int r = 2 * (index / texelsInLogicalRow); int c = imod(index, texelsInLogicalRow) * 2; return ivec2(r, c); } `:` ivec2 getOutputCoords() { ivec2 resTexRC = ivec2(resultUV.yx * vec2(${n[0]}, ${n[1]})); int index = resTexRC.x * ${n[1]} + resTexRC.y; int r = 2 * (index / ${a}); int c = imod(index, ${a}) * 2; return ivec2(r, c); } `}(e,t,r);case 3:return function(e,t,r){if(r)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)); int texelsInBatch = texelsInLogicalRow * int(ceil(float(outShape[1]) / 2.0)); ivec2 resTexRC = ivec2(resultUV.yx * vec2(packedTexShape[0], packedTexShape[1])); int index = resTexRC.x * packedTexShape[1] + resTexRC.y; int b = index / texelsInBatch; index -= b * texelsInBatch; int r = 2 * (index / texelsInLogicalRow); int c = imod(index, texelsInLogicalRow) * 2; return ivec3(b, r, c); } `;let n=[Math.ceil(t[0]/2),Math.ceil(t[1]/2)],s=Math.ceil(e[2]/2),a=s*Math.ceil(e[1]/2);return` ivec3 getOutputCoords() { ivec2 resTexRC = ivec2(resultUV.yx * vec2(${n[0]}, ${n[1]})); int index = resTexRC.x * ${n[1]} + resTexRC.y; int b = index / ${a}; index -= b * ${a}; int r = 2 * (index / ${s}); int c = imod(index, ${s}) * 2; return ivec3(b, r, c); } `}(e,t,r);default:return function(e,t,r){if(r)return` ivec4 getOutputCoords() { ivec2 packedTexShape = ivec2(ceil(float(outTexShape[0]) / 2.0), ceil(float(outTexShape[1]) / 2.0)); ivec2 resTexRC = ivec2(resultUV.yx * vec2(packedTexShape[0], packedTexShape[1])); int index = resTexRC.x * packedTexShape[1] + resTexRC.y; int texelsInLogicalRow = int(ceil(float(outShape[3]) / 2.0)); int texelsInBatch = texelsInLogicalRow * int(ceil(float(outShape[2]) / 2.0)); int texelsInBatchN = texelsInBatch * outShape[1]; int b2 = index / texelsInBatchN; index -= b2 * texelsInBatchN; int b = index / texelsInBatch; index -= b * texelsInBatch; int r = 2 * (index / texelsInLogicalRow); int c = imod(index, texelsInLogicalRow) * 2; return ivec4(b2, b, r, c); } `;let n=[Math.ceil(t[0]/2),Math.ceil(t[1]/2)],s=Math.ceil(e[e.length-1]/2),a=s*Math.ceil(e[e.length-2]/2),o=a,l="",i="b, r, c";for(let t=2;t1&&!(0,s.util).arraysEqual(t,r)&&n.lengthe[t]).join(", ")}},{"@tensorflow/tfjs-core":"2nuhV","./glsl_version":"aKRJc","./shader_compiler_util":"6NnjI","@parcel/transformer-js/src/esmodule-helpers.js":"9pCYc"}],"6NnjI":[function(e,t,r){/** * @license * Copyright 2018 Google LLC. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. * ============================================================================= */var n=e("@parcel/transformer-js/src/esmodule-helpers.js");n.defineInteropFlag(r),n.export(r,"getLogicalCoordinatesFromFlatIndex",()=>a),n.export(r,"getOutputLogicalCoordinatesFromFlatIndexByUniform",()=>o),n.export(r,"getLogicalCoordinatesFromFlatIndexByUniform",()=>l),n.export(r,"dotify",()=>u),n.export(r,"getFlatIndexFrom3D",()=>p),n.export(r,"getFlatIndexFrom3DOutput",()=>c),n.export(r,"ENCODE_FLOAT_SNIPPET",()=>d);var s=e("@tensorflow/tfjs-core");function a(e,t,r="index"){let n=(0,s.util).computeStrides(t);return n.map((t,s)=>{let a=`int ${e[s]} = ${r} / ${t}`,o=s===n.length-1?`int ${e[s+1]} = ${r} - ${e[s]} * ${t}`:`index -= ${e[s]} * ${t}`;return`${a}; ${o};`}).join("")}function o(e,t,r="index"){let n=(0,s.util).computeStrides(t);return n.map((t,s)=>{let a=`int ${e[s]} = ${r} / outShapeStrides[${s}]`,o=s===n.length-1?`int ${e[s+1]} = ${r} - ${e[s]} * outShapeStrides[${s}]`:`index -= ${e[s]} * outShapeStrides[${s}]`;return`${a}; ${o};`}).join("")}function l(e,t,r="index"){let n=function(e,t){let r=e.length,n=e.map(e=>`${t}[${e}]`),s=Array(r-1);s[r-2]=n[r-1];for(let e=r-3;e>=0;--e)s[e]=`(${s[e+1]} * ${n[e+1]})`;return s}(e.map((e,t)=>t),t);return n.map((t,s)=>{let a=`int ${e[s]} = ${r} / ${n[s]}`,o=s===n.length-1?`int ${e[s+1]} = ${r} - ${e[s]} * ${n[s]}`:`index -= ${e[s]} * ${n[s]}`;return`${a}; ${o};`}).join("")}function i(e){return 1===e.length?`${e[0]}`:`vec${e.length}(${e.join(",")})`}function u(e,t){if(e.length!==t.length)throw Error(`Vectors to be dotted must be of the same length -got ${e.length} and ${t.length}`);let r=[],n=Math.floor(e.length/4),s=e.length%4;for(let s=0;s`float(${e})`),a=a.map(e=>`float(${e})`)),r.push(`${i(s)}, ${i(a)}`)}return r.map((e,t)=>`dot(${e})`).join("+")}function p(e){let t=(0,s.util).computeStrides(e).map(e=>e.toString());return` int getFlatIndex(ivec3 coords) { return coords.x * ${t[0]} + coords.y * ${t[1]} + coords.z; } `}function c(){return` int getFlatIndex(ivec3 coords) { return coords.x * outShapeStrides[0] + coords.y * outShapeStrides[1] + coords.z; } `}let d=` const float FLOAT_MAX = 1.70141184e38; const float FLOAT_MIN = 1.17549435e-38; lowp vec4 encode_float(highp float v) { if (isnan(v)) { return vec4(255, 255, 255, 255); } highp float av = abs(v); if(av< FLOAT_MIN) { return vec4(0.0, 0.0, 0.0, 0.0); } else if(v >FLOAT_MAX) { return vec4(0.0, 0.0, 128.0, 127.0) / 255.0; } else if(v< -FLOAT_MAX) { return vec4(0.0, 0.0, 128.0, 255.0) / 255.0; } highp vec4 c = vec4(0,0,0,0); highp float e = floor(log2(av)); highp float m = exp2(fract(log2(av))) - 1.0; c[2] = floor(128.0 * m); m -= c[2] / 128.0; c[1] = floor(32768.0 * m); m -= c[1] / 32768.0; c[0] = floor(8388608.0 * m); highp float ebias = e + 127.0; c[3] = floor(ebias / 2.0); ebias -= c[3] * 2.0; c[2] += floor(ebias) * 128.0; c[3] += 128.0 * step(0.0, -v); return c / 255.0; } `},{"@tensorflow/tfjs-core":"2nuhV","@parcel/transformer-js/src/esmodule-helpers.js":"9pCYc"}],iUn2H:[function(e,t,r){/** * @license * Copyright 2019 Google LLC. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. * ============================================================================= */var n=e("@parcel/transformer-js/src/esmodule-helpers.js");n.defineInteropFlag(r),n.export(r,"DecodeMatrixPackedProgram",()=>i);var s=e("./glsl_version"),a=e("./gpgpu_math"),o=e("./shader_compiler_util"),l=e("./tex_util");class i{constructor(e){this.variableNames=["A"],this.packedInputs=!0,this.packedOutput=!0,this.outPackingScheme=l.PackingScheme.DENSE,this.customUniforms=[{name:"texShape",type:"ivec2"}];let t=(0,s.getGlslDifferences)();this.outputShape=e,this.enableShapeUniforms=(0,a.useShapeUniforms)(this.outputShape.length),this.userCode=` ivec3 outCoordsFromFlatIndex(int index) { ${this.enableShapeUniforms?o.getOutputLogicalCoordinatesFromFlatIndexByUniform(["r","c","d"],e):o.getLogicalCoordinatesFromFlatIndex(["r","c","d"],e)} return ivec3(r, c, d); } void main() { ivec2 resTexRC = ivec2(resultUV.yx * vec2(texShape[0], texShape[1])); int index = 4 * (resTexRC.x * texShape[1] + resTexRC.y); vec4 result = vec4(0.); for (int i=0; i<4; i++) { int flatIndex = index + i; ivec3 rc = outCoordsFromFlatIndex(flatIndex); result[i] = getChannel(getA(rc.x, rc.y, rc.z), vec2(rc.y, rc.z)); } ${t.output} = result; } `}}},{"./glsl_version":"aKRJc","./gpgpu_math":"f1P40","./shader_compiler_util":"6NnjI","./tex_util":"9R0ee","@parcel/transformer-js/src/esmodule-helpers.js":"9pCYc"}],evMMs:[function(e,t,r){/** * @license * Copyright 2018 Google LLC. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. * ============================================================================= */var n=e("@parcel/transformer-js/src/esmodule-helpers.js");n.defineInteropFlag(r),n.export(r,"EncodeFloatProgram",()=>l);var s=e("./glsl_version"),a=e("./shader_compiler_util"),o=e("./tex_util");class l{constructor(e){this.variableNames=["A"],this.outTexUsage=o.TextureUsage.DOWNLOAD;let t=(0,s.getGlslDifferences)();this.outputShape=e,this.userCode=` ${a.ENCODE_FLOAT_SNIPPET} void main() { float x = getAAtOutCoords(); ${t.output} = encode_float(x); } `}}},{"./glsl_version":"aKRJc","./shader_compiler_util":"6NnjI","./tex_util":"9R0ee","@parcel/transformer-js/src/esmodule-helpers.js":"9pCYc"}],gaB4d:[function(e,t,r){/** * @license * Copyright 2018 Google LLC. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. * ============================================================================= */var n=e("@parcel/transformer-js/src/esmodule-helpers.js");n.defineInteropFlag(r),n.export(r,"EncodeFloatPackedProgram",()=>l);var s=e("./glsl_version"),a=e("./shader_compiler_util"),o=e("./tex_util");class l{constructor(e){this.variableNames=["A"],this.packedInputs=!0,this.packedOutput=!1,this.outTexUsage=o.TextureUsage.DOWNLOAD;let t=(0,s.getGlslDifferences)();this.outputShape=e,this.userCode=` ${a.ENCODE_FLOAT_SNIPPET} void main() { ivec3 coords = getOutputCoords(); float x = getChannel(getAAtOutCoords(), vec2(coords.y, coords.z)); ${t.output} = encode_float(x); } `}}},{"./glsl_version":"aKRJc","./shader_compiler_util":"6NnjI","./tex_util":"9R0ee","@parcel/transformer-js/src/esmodule-helpers.js":"9pCYc"}],"6qQjr":[function(e,t,r){/** * @license * Copyright 2018 Google LLC. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. * ============================================================================= */var n=e("@parcel/transformer-js/src/esmodule-helpers.js");n.defineInteropFlag(r),n.export(r,"EncodeMatrixProgram",()=>i);var s=e("./glsl_version"),a=e("./gpgpu_math"),o=e("./shader_compiler_util");let l={R:0,G:1,B:2,A:3};class i{constructor(e,t=!1,r="RGBA"){this.variableNames=["A"],this.customUniforms=[{name:"texShape",type:"ivec2"}];let n=(0,s.getGlslDifferences)();this.outputShape=e,this.enableShapeUniforms=(0,a.useShapeUniforms)(this.outputShape.length);let i="result";t&&(i="floor(result * 255. + 0.5)");let u="";for(let e=0;el);var s=e("./glsl_version"),a=e("./gpgpu_math"),o=e("./shader_compiler_util");class l{constructor(e,t=!1){this.variableNames=["A"],this.packedInputs=!1,this.packedOutput=!0,this.customUniforms=[{name:"texShape",type:"ivec2"}];let r=(0,s.getGlslDifferences)();this.outputShape=e,this.enableShapeUniforms=(0,a.useShapeUniforms)(this.outputShape.length);let n="",l="result";t&&(l="floor(result * 255. + 0.5)");for(let t=0;t<=1;t++)for(let s=0;s<=1;s++){let a=2*t+s;n+=` localCoords = coords; if(localCoords[2] + ${s} < ${this.enableShapeUniforms?"outShape[2]":`${e[2]}`}) { localCoords[2] += ${s}; if (localCoords[1] + ${t} < ${this.enableShapeUniforms?"outShape[1]":`${e[1]}`}) { localCoords[1] += ${t}; flatIndex = getFlatIndex(localCoords); offset = imod(flatIndex, 4); flatIndex = idiv(flatIndex, 4, 1.); int r = flatIndex / texShape[1]; int c = imod(flatIndex, texShape[1]); vec2 uv = (vec2(c, r) + halfCR) / vec2(texShape[1], texShape[0]); values = ${r.texture2D}(A, uv); if (offset == 0) { result[${a}] = values[0]; } else if (offset == 1) { result[${a}] = values[1]; } else if (offset == 2) { result[${a}] = values[2]; } else { result[${a}] = values[3]; } } } `}this.userCode=` ${this.enableShapeUniforms?o.getFlatIndexFrom3DOutput():o.getFlatIndexFrom3D(e)} void main() { ivec3 coords = getOutputCoords(); vec4 result = vec4(0.); int flatIndex, r, c, offset; ivec3 localCoords; vec2 uv; vec4 values; ${n} ${r.output} = ${l}; } `}}},{"./glsl_version":"aKRJc","./gpgpu_math":"f1P40","./shader_compiler_util":"6NnjI","@parcel/transformer-js/src/esmodule-helpers.js":"9pCYc"}],a8QiN:[function(e,t,r){/** * @license * Copyright 2017 Google LLC. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. * ============================================================================= */var n=e("@parcel/transformer-js/src/esmodule-helpers.js");n.defineInteropFlag(r),n.export(r,"GPGPUContext",()=>u),n.export(r,"linearSearchLastTrue",()=>p);var s=e("@tensorflow/tfjs-core"),a=e("./canvas_util"),o=e("./gpgpu_util"),l=e("./tex_util"),i=e("./webgl_util");class u{constructor(e){this.outputTexture=null,this.program=null,this.disposed=!1,this.itemsToPoll=[];let t=(0,s.env)().getNumber("WEBGL_VERSION");if(null!=e?(this.gl=e,(0,a.setWebGLContext)(t,e)):this.gl=(0,a.getWebGLContext)(t),e=this.gl,2===(0,s.env)().getNumber("WEBGL_VERSION")){let t=e;this.createVertexArray=()=>i.callAndCheck(t,()=>t.createVertexArray()),this.bindVertexArray=e=>i.callAndCheck(t,()=>t.bindVertexArray(e)),this.deleteVertexArray=e=>i.callAndCheck(t,()=>t.deleteVertexArray(e)),this.getVertexArray=()=>i.callAndCheck(t,()=>t.getParameter(t.VERTEX_ARRAY_BINDING))}else if(null!=e){let t=e.getExtension("OES_vertex_array_object");if(null==t)throw Error("All WebGL1 implementations are expected to offer OES_vertex_array_object.");this.createVertexArray=()=>i.callAndCheck(e,()=>t.createVertexArrayOES()),this.bindVertexArray=r=>i.callAndCheck(e,()=>t.bindVertexArrayOES(r)),this.deleteVertexArray=r=>i.callAndCheck(e,()=>t.deleteVertexArrayOES(r)),this.getVertexArray=()=>i.callAndCheck(e,()=>e.getParameter(t.VERTEX_ARRAY_BINDING_OES))}let r="WEBGL_color_buffer_float",n="EXT_color_buffer_half_float";if(this.parallelCompilationExtension=this.gl.getExtension("KHR_parallel_shader_compile"),1===(0,s.env)().getNumber("WEBGL_VERSION")){let e="OES_texture_half_float";if(this.textureFloatExtension=i.getExtensionOrThrow(this.gl,"OES_texture_float"),i.hasExtension(this.gl,e))this.textureHalfFloatExtension=i.getExtensionOrThrow(this.gl,e);else if((0,s.env)().get("WEBGL_FORCE_F16_TEXTURES"))throw 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(r),i.hasExtension(this.gl,n))this.colorBufferHalfFloatExtension=i.getExtensionOrThrow(this.gl,n);else if((0,s.env)().get("WEBGL_FORCE_F16_TEXTURES"))throw Error("GL context does not support color renderable half floats, yet the environment flag WEBGL_FORCE_F16_TEXTURES is set to true.")}else if(r="EXT_color_buffer_float",i.hasExtension(this.gl,r))this.colorBufferFloatExtension=this.gl.getExtension(r);else if(i.hasExtension(this.gl,n))this.colorBufferHalfFloatExtension=this.gl.getExtension(n);else throw Error("GL context does not support color renderable floats");this.vertexBuffer=o.createVertexBuffer(this.gl),this.indexBuffer=o.createIndexBuffer(this.gl),this.framebuffer=i.createFramebuffer(this.gl),this.textureConfig=l.getTextureConfig(this.gl,this.textureHalfFloatExtension)}get debug(){return(0,s.env)().getBool("DEBUG")}dispose(){if(this.disposed)return;null!=this.program&&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."),null!=this.outputTexture&&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;i.callAndCheck(e,()=>e.finish()),i.callAndCheck(e,()=>e.bindFramebuffer(e.FRAMEBUFFER,null)),i.callAndCheck(e,()=>e.deleteFramebuffer(this.framebuffer)),i.callAndCheck(e,()=>e.bindBuffer(e.ARRAY_BUFFER,null)),i.callAndCheck(e,()=>e.bindBuffer(e.ELEMENT_ARRAY_BUFFER,null)),i.callAndCheck(e,()=>e.deleteBuffer(this.indexBuffer)),this.disposed=!0}createFloat32MatrixTexture(e,t){return this.throwIfDisposed(),o.createFloat32MatrixTexture(this.gl,e,t,this.textureConfig)}createFloat16MatrixTexture(e,t){return this.throwIfDisposed(),o.createFloat16MatrixTexture(this.gl,e,t,this.textureConfig)}createUnsignedBytesMatrixTexture(e,t){return this.throwIfDisposed(),o.createUnsignedBytesMatrixTexture(this.gl,e,t,this.textureConfig)}uploadPixelDataToTexture(e,t){this.throwIfDisposed(),o.uploadPixelDataToTexture(this.gl,e,t)}uploadDenseMatrixToTexture(e,t,r,n){this.throwIfDisposed(),o.uploadDenseMatrixToTexture(this.gl,e,t,r,n,this.textureConfig)}createFloat16PackedMatrixTexture(e,t){return this.throwIfDisposed(),o.createFloat16PackedMatrixTexture(this.gl,e,t,this.textureConfig)}createPackedMatrixTexture(e,t){return this.throwIfDisposed(),o.createPackedMatrixTexture(this.gl,e,t,this.textureConfig)}deleteMatrixTexture(e){this.throwIfDisposed(),this.outputTexture===e&&(i.unbindColorTextureFromFramebuffer(this.gl,this.framebuffer),this.outputTexture=null),i.callAndCheck(this.gl,()=>this.gl.deleteTexture(e))}downloadByteEncodedFloatMatrixFromOutputTexture(e,t,r){return this.downloadMatrixDriver(e,()=>o.downloadByteEncodedFloatMatrixFromOutputTexture(this.gl,t,r,this.textureConfig))}downloadPackedMatrixFromBuffer(e,t,r,n,s,a){return o.downloadPackedMatrixFromBuffer(this.gl,e,t,r,n,s,a,this.textureConfig)}downloadFloat32MatrixFromBuffer(e,t){return o.downloadFloat32MatrixFromBuffer(this.gl,e,t)}createBufferFromTexture(e,t,r){this.bindTextureToFrameBuffer(e);let n=o.createBufferFromOutputTexture(this.gl,t,r,this.textureConfig);return this.unbindTextureToFrameBuffer(),n}createAndWaitForFence(){let e=this.createFence(this.gl);return this.pollFence(e)}createFence(e){let t,r;if((0,s.env)().getBool("WEBGL_FENCE_API_ENABLED")){let n=e.fenceSync(e.SYNC_GPU_COMMANDS_COMPLETE,0);e.flush(),r=()=>{let t=e.clientWaitSync(n,0,0);return t===e.ALREADY_SIGNALED||t===e.CONDITION_SATISFIED},t=n}else(0,s.env)().getNumber("WEBGL_DISJOINT_QUERY_TIMER_EXTENSION_VERSION")>0?(t=this.beginQuery(),this.endQuery(),r=()=>this.isQueryAvailable(t,(0,s.env)().getNumber("WEBGL_DISJOINT_QUERY_TIMER_EXTENSION_VERSION"))):r=()=>!0;return{query:t,isFencePassed:r}}downloadMatrixFromPackedTexture(e,t,r){return this.downloadMatrixDriver(e,()=>o.downloadMatrixFromPackedOutputTexture(this.gl,t,r))}createProgram(e){this.throwIfDisposed();let t=this.gl;null==this.vertexShader&&(this.vertexShader=o.createVertexShader(t));let r=i.createProgram(t);i.callAndCheck(t,()=>t.attachShader(r,this.vertexShader)),i.callAndCheck(t,()=>t.attachShader(r,e)),i.linkProgram(t,r);let n=Object.assign(r,{vao:this.createVertexArray()});return this.debug&&i.validateProgram(t,n),n}buildVao(e){this.setProgram(e),this.bindVertexArray(e.vao);let t=this.gl;i.callAndCheck(t,()=>t.bindBuffer(t.ELEMENT_ARRAY_BUFFER,this.indexBuffer)),o.bindVertexProgramAttributeStreams(t,e,this.vertexBuffer)}deleteProgram(e){this.throwIfDisposed(),e===this.program&&(this.program=null),null!=e&&(i.callAndCheck(this.gl,()=>this.gl.deleteProgram(e)),this.deleteVertexArray(e.vao))}setProgram(e){this.throwIfDisposed(),this.program=e,null!=this.program&&this.debug&&i.validateProgram(this.gl,this.program),i.callAndCheck(this.gl,()=>this.gl.useProgram(e))}getUniformLocation(e,t,r=!0){return(this.throwIfDisposed(),r)?i.getProgramUniformLocationOrThrow(this.gl,e,t):i.getProgramUniformLocation(this.gl,e,t)}getAttributeLocation(e,t){return this.throwIfDisposed(),i.callAndCheck(this.gl,()=>this.gl.getAttribLocation(e,t))}getUniformLocationNoThrow(e,t){return this.throwIfDisposed(),this.gl.getUniformLocation(e,t)}setInputMatrixTexture(e,t,r){this.throwIfDisposed(),this.throwIfNoProgram(),i.bindTextureToProgramUniformSampler(this.gl,e,t,r)}setOutputMatrixTexture(e,t,r){this.setOutputMatrixTextureDriver(e,r,t)}setOutputPackedMatrixTexture(e,t,r){this.throwIfDisposed();let[n,s]=l.getPackedMatrixTextureShapeWidthHeight(t,r);this.setOutputMatrixTextureDriver(e,n,s)}setOutputMatrixWriteRegion(e,t,r,n){this.setOutputMatrixWriteRegionDriver(r,e,n,t)}setOutputPackedMatrixWriteRegion(e,t,r,n){throw Error("setOutputPackedMatrixWriteRegion not implemented.")}debugValidate(){null!=this.program&&i.validateProgram(this.gl,this.program),i.validateFramebuffer(this.gl)}executeProgram(){this.throwIfDisposed(),this.throwIfNoProgram();let e=this.gl;this.debug&&(console.assert(this.getVertexArray()===this.program.vao,"VAO changed between setProgram and executeProgram!"),this.debugValidate()),i.callAndCheck(e,()=>e.drawElements(e.TRIANGLES,6,e.UNSIGNED_SHORT,0))}blockUntilAllProgramsCompleted(){this.throwIfDisposed(),i.callAndCheck(this.gl,()=>this.gl.finish())}getQueryTimerExtension(){return null==this.disjointQueryTimerExtension&&(this.disjointQueryTimerExtension=i.getExtensionOrThrow(this.gl,2===(0,s.env)().getNumber("WEBGL_DISJOINT_QUERY_TIMER_EXTENSION_VERSION")?"EXT_disjoint_timer_query_webgl2":"EXT_disjoint_timer_query")),this.disjointQueryTimerExtension}getQueryTimerExtensionWebGL2(){return this.getQueryTimerExtension()}getQueryTimerExtensionWebGL1(){return this.getQueryTimerExtension()}beginQuery(){if(2===(0,s.env)().getNumber("WEBGL_DISJOINT_QUERY_TIMER_EXTENSION_VERSION")){let e=this.gl,t=this.getQueryTimerExtensionWebGL2(),r=e.createQuery();return e.beginQuery(t.TIME_ELAPSED_EXT,r),r}let e=this.getQueryTimerExtensionWebGL1(),t=e.createQueryEXT();return e.beginQueryEXT(e.TIME_ELAPSED_EXT,t),t}endQuery(){if(2===(0,s.env)().getNumber("WEBGL_DISJOINT_QUERY_TIMER_EXTENSION_VERSION")){let e=this.gl,t=this.getQueryTimerExtensionWebGL2();e.endQuery(t.TIME_ELAPSED_EXT);return}let e=this.getQueryTimerExtensionWebGL1();e.endQueryEXT(e.TIME_ELAPSED_EXT)}async waitForQueryAndGetTime(e){return await (0,s.util).repeatedTry(()=>this.disposed||this.isQueryAvailable(e,(0,s.env)().getNumber("WEBGL_DISJOINT_QUERY_TIMER_EXTENSION_VERSION"))),this.getQueryTime(e,(0,s.env)().getNumber("WEBGL_DISJOINT_QUERY_TIMER_EXTENSION_VERSION"))}getQueryTime(e,t){if(0===t)return null;if(2===t){let t=this.gl;return t.getQueryParameter(e,t.QUERY_RESULT)/1e6}{let t=this.getQueryTimerExtensionWebGL1();return t.getQueryObjectEXT(e,t.QUERY_RESULT_EXT)/1e6}}isQueryAvailable(e,t){if(0===t)return!0;if(2===t){let t=this.gl,r=this.getQueryTimerExtensionWebGL2(),n=t.getQueryParameter(e,t.QUERY_RESULT_AVAILABLE);return null==this.disjoint&&(this.disjoint=this.gl.getParameter(r.GPU_DISJOINT_EXT)),n&&!this.disjoint}{let t=this.getQueryTimerExtensionWebGL1(),r=t.getQueryObjectEXT(e,t.QUERY_RESULT_AVAILABLE_EXT);return null==this.disjoint&&(this.disjoint=this.gl.getParameter(t.GPU_DISJOINT_EXT)),r&&!this.disjoint}}pollFence(e){return new Promise(t=>{this.addItemToPoll(()=>e.isFencePassed(),()=>t())})}pollItems(){let e=p(this.itemsToPoll.map(e=>e.isDoneFn));for(let t=0;t<=e;++t){let{resolveFn:e}=this.itemsToPoll[t];e()}this.itemsToPoll=this.itemsToPoll.slice(e+1)}addItemToPoll(e,t){let r;this.itemsToPoll.push({isDoneFn:e,resolveFn:t}),this.itemsToPoll.length>1||("setTimeoutCustom"in(0,s.env)().platform&&(r=(0,s.env)().platform.setTimeoutCustom.bind((0,s.env)().platform)),(0,s.util).repeatedTry(()=>(this.pollItems(),0===this.itemsToPoll.length),()=>0,null,r))}bindTextureToFrameBuffer(e){this.throwIfDisposed(),i.bindColorTextureToFramebuffer(this.gl,e,this.framebuffer),this.debug&&i.validateFramebuffer(this.gl)}unbindTextureToFrameBuffer(){null!=this.outputTexture?(i.bindColorTextureToFramebuffer(this.gl,this.outputTexture,this.framebuffer),this.debug&&i.validateFramebuffer(this.gl)):i.unbindColorTextureFromFramebuffer(this.gl,this.framebuffer)}downloadMatrixDriver(e,t){this.bindTextureToFrameBuffer(e);let r=t();return this.unbindTextureToFrameBuffer(),r}setOutputMatrixTextureDriver(e,t,r){this.throwIfDisposed();let n=this.gl;i.bindColorTextureToFramebuffer(n,e,this.framebuffer),this.debug&&i.validateFramebuffer(n),this.outputTexture=e,i.callAndCheck(n,()=>n.viewport(0,0,t,r)),i.callAndCheck(n,()=>n.scissor(0,0,t,r))}setOutputMatrixWriteRegionDriver(e,t,r,n){this.throwIfDisposed(),i.callAndCheck(this.gl,()=>this.gl.scissor(e,t,r,n))}throwIfDisposed(){if(this.disposed)throw Error("Attempted to use disposed GPGPUContext.")}throwIfNoProgram(){if(null==this.program)throw Error("No GPU program is currently set.")}}function p(e){let t=0;for(;ti),n.export(r,"createVertexBuffer",()=>u),n.export(r,"createIndexBuffer",()=>p),n.export(r,"getInternalFormatForFloat32MatrixTexture",()=>d),n.export(r,"createFloat32MatrixTexture",()=>f),n.export(r,"getInternalFormatForFloat16MatrixTexture",()=>h),n.export(r,"createFloat16MatrixTexture",()=>m),n.export(r,"getInternalFormatForUnsignedBytesMatrixTexture",()=>g),n.export(r,"createUnsignedBytesMatrixTexture",()=>x),n.export(r,"getInternalFormatForPackedMatrixTexture",()=>v),n.export(r,"createPackedMatrixTexture",()=>y),n.export(r,"getInternalFormatForFloat16PackedMatrixTexture",()=>b),n.export(r,"createFloat16PackedMatrixTexture",()=>_),n.export(r,"bindVertexProgramAttributeStreams",()=>k),n.export(r,"uploadDenseMatrixToTexture",()=>j),n.export(r,"uploadPixelDataToTexture",()=>I),n.export(r,"createBufferFromOutputTexture",()=>C),n.export(r,"downloadFloat32MatrixFromBuffer",()=>w),n.export(r,"downloadByteEncodedFloatMatrixFromOutputTexture",()=>T),n.export(r,"downloadPackedMatrixFromBuffer",()=>S),n.export(r,"downloadMatrixFromPackedOutputTexture",()=>N);var s=e("@tensorflow/tfjs-core"),a=e("./glsl_version"),o=e("./tex_util"),l=e("./webgl_util");function i(e){let t=(0,a.getGlslDifferences)(),r=`${t.version} precision highp float; ${t.attribute} vec3 clipSpacePos; ${t.attribute} vec2 uv; ${t.varyingVs} vec2 resultUV; void main() { gl_Position = vec4(clipSpacePos, 1); resultUV = uv; }`;return l.createVertexShader(e,r)}function u(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 l.createStaticVertexBuffer(e,t)}function p(e){let t=new Uint16Array([0,1,2,2,1,3]);return l.createStaticIndexBuffer(e,t)}function c(e,t,r,n,a,o){l.validateTextureSize(t,r);let i=l.createTexture(e),u=e.TEXTURE_2D;return l.callAndCheck(e,()=>e.bindTexture(u,i)),l.callAndCheck(e,()=>e.texParameteri(u,e.TEXTURE_WRAP_S,e.CLAMP_TO_EDGE)),l.callAndCheck(e,()=>e.texParameteri(u,e.TEXTURE_WRAP_T,e.CLAMP_TO_EDGE)),l.callAndCheck(e,()=>e.texParameteri(u,e.TEXTURE_MIN_FILTER,e.NEAREST)),l.callAndCheck(e,()=>e.texParameteri(u,e.TEXTURE_MAG_FILTER,e.NEAREST)),1===(0,s.env)().getNumber("WEBGL_VERSION")?l.callAndCheck(e,()=>e.texImage2D(u,0,n,t,r,0,a,o,null)):l.callAndCheck(e,()=>e.texStorage2D(u,1,n,t,r)),l.callAndCheck(e,()=>e.bindTexture(e.TEXTURE_2D,null)),{texture:i,texShape:[r,t]}}function d(e){return e.internalFormatFloat}function f(e,t,r,n){let[s,a]=o.getUnpackedMatrixTextureShapeWidthHeight(t,r);return c(e,s,a,d(n),n.textureFormatFloat,e.FLOAT)}function h(e){return e.internalFormatHalfFloat}function m(e,t,r,n){let[s,a]=o.getUnpackedMatrixTextureShapeWidthHeight(t,r);return c(e,s,a,h(n),n.textureFormatFloat,n.textureTypeHalfFloat)}function g(e){return e.downloadTextureFormat}function x(e,t,r,n){let[s,a]=o.getUnpackedMatrixTextureShapeWidthHeight(t,r);return c(e,s,a,g(n),e.RGBA,e.UNSIGNED_BYTE)}function v(e){return e.internalFormatPackedFloat}function y(e,t,r,n){let[s,a]=o.getPackedMatrixTextureShapeWidthHeight(t,r);return c(e,s,a,v(n),e.RGBA,e.FLOAT)}function b(e){return e.internalFormatPackedHalfFloat}function _(e,t,r,n){let[s,a]=o.getPackedMatrixTextureShapeWidthHeight(t,r);return c(e,s,a,b(n),e.RGBA,n.textureTypeHalfFloat)}function k(e,t,r){return l.callAndCheck(e,()=>e.bindBuffer(e.ARRAY_BUFFER,r)),l.bindVertexBufferToProgramAttribute(e,t,"clipSpacePos",r,3,20,0)&&l.bindVertexBufferToProgramAttribute(e,t,"uv",r,2,20,12)}function j(e,t,r,n,a,o){let i,u,p;l.callAndCheck(e,()=>e.bindTexture(e.TEXTURE_2D,t)),a instanceof Uint8Array?(i=new Uint8Array(r*n*4),u=e.UNSIGNED_BYTE,p=e.RGBA):(i=new Float32Array(r*n*4),u=e.FLOAT,p=o.internalFormatPackedFloat),i.set(a),2===(0,s.env)().getNumber("WEBGL_VERSION")?l.callAndCheck(e,()=>e.texSubImage2D(e.TEXTURE_2D,0,0,0,r,n,e.RGBA,u,i)):l.callAndCheck(e,()=>e.texImage2D(e.TEXTURE_2D,0,p,r,n,0,e.RGBA,u,i)),l.callAndCheck(e,()=>e.bindTexture(e.TEXTURE_2D,null))}function I(e,t,r){l.callAndCheck(e,()=>e.bindTexture(e.TEXTURE_2D,t)),r.data instanceof Uint8Array?2===(0,s.env)().getNumber("WEBGL_VERSION")?l.callAndCheck(e,()=>e.texSubImage2D(e.TEXTURE_2D,0,0,0,r.width,r.height,e.RGBA,e.UNSIGNED_BYTE,r.data)):l.callAndCheck(e,()=>e.texImage2D(e.TEXTURE_2D,0,e.RGBA,r.width,r.height,0,e.RGBA,e.UNSIGNED_BYTE,r.data)):2===(0,s.env)().getNumber("WEBGL_VERSION")?l.callAndCheck(e,()=>e.texSubImage2D(e.TEXTURE_2D,0,0,0,e.RGBA,e.UNSIGNED_BYTE,r)):l.callAndCheck(e,()=>e.texImage2D(e.TEXTURE_2D,0,e.RGBA,e.RGBA,e.UNSIGNED_BYTE,r)),l.callAndCheck(e,()=>e.bindTexture(e.TEXTURE_2D,null))}function C(e,t,r,n){let s=e.createBuffer();l.callAndCheck(e,()=>e.bindBuffer(e.PIXEL_PACK_BUFFER,s));let a=16*t*r;return l.callAndCheck(e,()=>e.bufferData(e.PIXEL_PACK_BUFFER,a,e.STREAM_READ)),l.callAndCheck(e,()=>e.readPixels(0,0,r,t,e.RGBA,e.FLOAT,0)),l.callAndCheck(e,()=>e.bindBuffer(e.PIXEL_PACK_BUFFER,null)),s}function w(e,t,r){let n=new Float32Array(r);return e.bindBuffer(e.PIXEL_PACK_BUFFER,t),e.getBufferSubData(e.PIXEL_PACK_BUFFER,0,n),e.bindBuffer(e.PIXEL_PACK_BUFFER,null),n}function T(e,t,r,n){let[s,a]=o.getUnpackedMatrixTextureShapeWidthHeight(t,r),i=new Uint8Array(o.getUnpackedArraySizeFromMatrixSize(t*r,4));return l.callAndCheck(e,()=>e.readPixels(0,0,s,a,n.downloadTextureFormat,e.UNSIGNED_BYTE,i)),new Float32Array(i.buffer)}function S(e,t,r,n,s,a,l,i){let u=new Float32Array(o.getPackedRGBAArraySizeFromMatrixShape(a,l));return e.bindBuffer(e.PIXEL_PACK_BUFFER,t),e.getBufferSubData(e.PIXEL_PACK_BUFFER,0,u),e.bindBuffer(e.PIXEL_PACK_BUFFER,null),u}function N(e,t,r){let n=new Float32Array(t*r*4);return l.callAndCheck(e,()=>e.readPixels(0,0,r,t,e.RGBA,e.FLOAT,n)),n}},{"@tensorflow/tfjs-core":"2nuhV","./glsl_version":"aKRJc","./tex_util":"9R0ee","./webgl_util":"90dxa","@parcel/transformer-js/src/esmodule-helpers.js":"9pCYc"}],"01kMd":[function(e,t,r){/** * @license * Copyright 2020 Google LLC. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. * ============================================================================= */var n=e("@parcel/transformer-js/src/esmodule-helpers.js");n.defineInteropFlag(r),n.export(r,"addImplCPU",()=>s),n.export(r,"bincountImplCPU",()=>a),n.export(r,"bincountReduceImplCPU",()=>o),n.export(r,"bitwiseAndImplCPU",()=>l),n.export(r,"castImplCPU",()=>i),n.export(r,"ceilImplCPU",()=>u),n.export(r,"concatImplCPU",()=>p),n.export(r,"equalImplCPU",()=>c),n.export(r,"expImplCPU",()=>d),n.export(r,"expm1ImplCPU",()=>f),n.export(r,"floorImplCPU",()=>h),n.export(r,"gatherNdImplCPU",()=>m),n.export(r,"gatherV2ImplCPU",()=>g),n.export(r,"greaterEqualImplCPU",()=>v),n.export(r,"greaterImplCPU",()=>x),n.export(r,"lessEqualImplCPU",()=>b),n.export(r,"lessImplCPU",()=>y),n.export(r,"linSpaceImplCPU",()=>_),n.export(r,"logImplCPU",()=>k),n.export(r,"maxImplCPU",()=>j),n.export(r,"maximumImplCPU",()=>I),n.export(r,"minimumImplCPU",()=>C),n.export(r,"multiplyImplCPU",()=>w),n.export(r,"negImplCPU",()=>T),n.export(r,"notEqualImplCPU",()=>S),n.export(r,"prodImplCPU",()=>N),n.export(r,"raggedGatherImplCPU",()=>E),n.export(r,"raggedRangeImplCPU",()=>F),n.export(r,"raggedTensorToTensorImplCPU",()=>R),n.export(r,"scatterImplCPU",()=>D),n.export(r,"sigmoidImplCPU",()=>$),n.export(r,"simpleAbsImplCPU",()=>M),n.export(r,"sliceImplCPU",()=>O),n.export(r,"sparseFillEmptyRowsImplCPU",()=>V),n.export(r,"sparseReshapeImplCPU",()=>B),n.export(r,"sparseSegmentReductionImplCPU",()=>L),n.export(r,"sqrtImplCPU",()=>G),n.export(r,"staticRegexReplaceImplCPU",()=>z),n.export(r,"stridedSliceImplCPU",()=>U),n.export(r,"stringNGramsImplCPU",()=>Y),n.export(r,"stringSplitImplCPU",()=>W),n.export(r,"stringToHashBucketFastImplCPU",()=>q),n.export(r,"subImplCPU",()=>K),n.export(r,"rangeImplCPU",()=>A),n.export(r,"rsqrtImplCPU",()=>P),n.export(r,"tileImplCPU",()=>H),n.export(r,"topKImplCPU",()=>X),n.export(r,"transposeImplCPU",()=>Q),n.export(r,"uniqueImplCPU",()=>J);let{addImpl:s,bincountImpl:a,bincountReduceImpl:o,bitwiseAndImpl:l,castImpl:i,ceilImpl:u,concatImpl:p,equalImpl:c,expImpl:d,expm1Impl:f,floorImpl:h,gatherNdImpl:m,gatherV2Impl:g,greaterImpl:x,greaterEqualImpl:v,lessImpl:y,lessEqualImpl:b,linSpaceImpl:_,logImpl:k,maxImpl:j,maximumImpl:I,minimumImpl:C,multiplyImpl:w,negImpl:T,notEqualImpl:S,prodImpl:N,raggedGatherImpl:E,raggedRangeImpl:F,raggedTensorToTensorImpl:R,rangeImpl:A,rsqrtImpl:P,scatterImpl:D,sigmoidImpl:$,simpleAbsImpl:M,sliceImpl:O,sparseFillEmptyRowsImpl:V,sparseReshapeImpl:B,sparseSegmentReductionImpl:L,sqrtImpl:G,staticRegexReplaceImpl:z,stridedSliceImpl:U,stringNGramsImpl:Y,stringSplitImpl:W,stringToHashBucketFastImpl:q,subImpl:K,tileImpl:H,topKImpl:X,transposeImpl:Q,uniqueImpl:J}=e("@tensorflow/tfjs-backend-cpu/dist/shared")},{"@tensorflow/tfjs-backend-cpu/dist/shared":"kaeD0","@parcel/transformer-js/src/esmodule-helpers.js":"9pCYc"}],kaeD0:[function(e,t,r){/** * @license * Copyright 2020 Google LLC. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. * ============================================================================= */var n=e("@parcel/transformer-js/src/esmodule-helpers.js");n.defineInteropFlag(r),n.export(r,"simpleAbsImpl",()=>s.simpleAbsImpl),n.export(r,"addImpl",()=>a.addImpl),n.export(r,"bincountImpl",()=>o.bincountImpl),n.export(r,"bincountReduceImpl",()=>o.bincountReduceImpl),n.export(r,"bitwiseAndImpl",()=>l.bitwiseAndImpl),n.export(r,"castImpl",()=>i.castImpl),n.export(r,"ceilImpl",()=>u.ceilImpl),n.export(r,"concatImpl",()=>p.concatImpl),n.export(r,"equalImpl",()=>c.equalImpl),n.export(r,"expImpl",()=>d.expImpl),n.export(r,"expm1Impl",()=>f.expm1Impl),n.export(r,"floorImpl",()=>h.floorImpl),n.export(r,"floorDivImpl",()=>m.floorDivImpl),n.export(r,"gatherNdImpl",()=>g.gatherNdImpl),n.export(r,"gatherV2Impl",()=>x.gatherV2Impl),n.export(r,"greaterImpl",()=>v.greaterImpl),n.export(r,"greaterEqualImpl",()=>y.greaterEqualImpl),n.export(r,"lessImpl",()=>b.lessImpl),n.export(r,"lessEqualImpl",()=>_.lessEqualImpl),n.export(r,"linSpaceImpl",()=>k.linSpaceImpl),n.export(r,"logImpl",()=>j.logImpl),n.export(r,"maxImpl",()=>I.maxImpl),n.export(r,"maximumImpl",()=>C.maximumImpl),n.export(r,"minimumImpl",()=>w.minimumImpl),n.export(r,"multiplyImpl",()=>T.multiplyImpl),n.export(r,"negImpl",()=>S.negImpl),n.export(r,"notEqualImpl",()=>N.notEqualImpl),n.export(r,"prodImpl",()=>E.prodImpl),n.export(r,"raggedGatherImpl",()=>F.raggedGatherImpl),n.export(r,"raggedRangeImpl",()=>R.raggedRangeImpl),n.export(r,"raggedTensorToTensorImpl",()=>A.raggedTensorToTensorImpl),n.export(r,"rangeImpl",()=>P.rangeImpl),n.export(r,"rsqrtImpl",()=>D.rsqrtImpl),n.export(r,"scatterImpl",()=>$.scatterImpl),n.export(r,"sigmoidImpl",()=>M.sigmoidImpl),n.export(r,"sliceImpl",()=>O.sliceImpl),n.export(r,"sparseFillEmptyRowsImpl",()=>V.sparseFillEmptyRowsImpl),n.export(r,"sparseReshapeImpl",()=>B.sparseReshapeImpl),n.export(r,"sparseSegmentReductionImpl",()=>L.sparseSegmentReductionImpl),n.export(r,"sqrtImpl",()=>G.sqrtImpl),n.export(r,"squaredDifferenceImpl",()=>z.squaredDifferenceImpl),n.export(r,"staticRegexReplaceImpl",()=>U.staticRegexReplaceImpl),n.export(r,"stridedSliceImpl",()=>Y.stridedSliceImpl),n.export(r,"stringNGramsImpl",()=>W.stringNGramsImpl),n.export(r,"stringSplitImpl",()=>q.stringSplitImpl),n.export(r,"stringToHashBucketFastImpl",()=>K.stringToHashBucketFastImpl),n.export(r,"subImpl",()=>H.subImpl),n.export(r,"tileImpl",()=>X.tileImpl),n.export(r,"topKImpl",()=>Q.topKImpl),n.export(r,"transposeImpl",()=>J.transposeImpl),n.export(r,"uniqueImpl",()=>Z.uniqueImpl);var s=e("./kernels/Abs"),a=e("./kernels/Add"),o=e("./kernels/Bincount_impl"),l=e("./kernels/BitwiseAnd"),i=e("./kernels/Cast"),u=e("./kernels/Ceil"),p=e("./kernels/Concat_impl"),c=e("./kernels/Equal"),d=e("./kernels/Exp"),f=e("./kernels/Expm1"),h=e("./kernels/Floor"),m=e("./kernels/FloorDiv"),g=e("./kernels/GatherNd_Impl"),x=e("./kernels/GatherV2_impl"),v=e("./kernels/Greater"),y=e("./kernels/GreaterEqual"),b=e("./kernels/Less"),_=e("./kernels/LessEqual"),k=e("./kernels/LinSpace_impl"),j=e("./kernels/Log"),I=e("./kernels/Max_impl"),C=e("./kernels/Maximum"),w=e("./kernels/Minimum"),T=e("./kernels/Multiply"),S=e("./kernels/Neg"),N=e("./kernels/NotEqual"),E=e("./kernels/Prod"),F=e("./kernels/RaggedGather_impl"),R=e("./kernels/RaggedRange_impl"),A=e("./kernels/RaggedTensorToTensor_impl"),P=e("./kernels/Range_impl"),D=e("./kernels/Rsqrt"),$=e("./kernels/Scatter_impl"),M=e("./kernels/Sigmoid"),O=e("./kernels/Slice"),V=e("./kernels/SparseFillEmptyRows_impl"),B=e("./kernels/SparseReshape_impl"),L=e("./kernels/SparseSegmentReduction_impl"),G=e("./kernels/Sqrt"),z=e("./kernels/SquaredDifference"),U=e("./kernels/StaticRegexReplace"),Y=e("./kernels/StridedSlice_impl"),W=e("./kernels/StringNGrams_impl"),q=e("./kernels/StringSplit_impl"),K=e("./kernels/StringToHashBucketFast_impl"),H=e("./kernels/Sub"),X=e("./kernels/Tile_impl"),Q=e("./kernels/TopK_impl"),J=e("./kernels/Transpose_impl"),Z=e("./kernels/Unique_impl")},{"./kernels/Abs":"hFqOq","./kernels/Add":"6fWFl","./kernels/Bincount_impl":"l6nVN","./kernels/BitwiseAnd":"iYAYZ","./kernels/Cast":"ep8e6","./kernels/Ceil":"5zveO","./kernels/Concat_impl":"hktsy","./kernels/Equal":"cApXD","./kernels/Exp":"7zaJk","./kernels/Expm1":"gvpte","./kernels/Floor":"jQTXs","./kernels/FloorDiv":"40JHE","./kernels/GatherNd_Impl":"3CatI","./kernels/GatherV2_impl":"8ZlmI","./kernels/Greater":"fz1zC","./kernels/GreaterEqual":"blrhL","./kernels/Less":"6Z0Og","./kernels/LessEqual":"2Wkg5","./kernels/LinSpace_impl":"6p1Nu","./kernels/Log":"7TObE","./kernels/Max_impl":"bUPEH","./kernels/Maximum":"9MgzM","./kernels/Minimum":"bIhZ4","./kernels/Multiply":"k52uJ","./kernels/Neg":"1Innr","./kernels/NotEqual":"8Jfov","./kernels/Prod":"kTBVD","./kernels/RaggedGather_impl":"fcLqF","./kernels/RaggedRange_impl":"iG5nk","./kernels/RaggedTensorToTensor_impl":"ljPoB","./kernels/Range_impl":"ktDJX","./kernels/Rsqrt":"59k7y","./kernels/Scatter_impl":"f9QJS","./kernels/Sigmoid":"foyl4","./kernels/Slice":"loZC8","./kernels/SparseFillEmptyRows_impl":"lHwnD","./kernels/SparseReshape_impl":"1QTPX","./kernels/SparseSegmentReduction_impl":"8zLRT","./kernels/Sqrt":"2h5qI","./kernels/SquaredDifference":"h63Nj","./kernels/StaticRegexReplace":"6gC9H","./kernels/StridedSlice_impl":"3U7SN","./kernels/StringNGrams_impl":"j3eTT","./kernels/StringSplit_impl":"fAlpl","./kernels/StringToHashBucketFast_impl":"lFait","./kernels/Sub":"7SQVx","./kernels/Tile_impl":"fdvO1","./kernels/TopK_impl":"2JZKB","./kernels/Transpose_impl":"1HpxI","./kernels/Unique_impl":"an8b2","@parcel/transformer-js/src/esmodule-helpers.js":"9pCYc"}],hFqOq:[function(e,t,r){/** * @license * Copyright 2020 Google LLC. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the License); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an AS IS BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. * ============================================================================= */var n=e("@parcel/transformer-js/src/esmodule-helpers.js");n.defineInteropFlag(r),n.export(r,"simpleAbsImpl",()=>o),n.export(r,"abs",()=>l),n.export(r,"absConfig",()=>i);var s=e("@tensorflow/tfjs-core"),a=e("../cpu_util");function o(e){let t=new Float32Array(e.length);for(let r=0;r{let{x:t}=e.inputs,r=e.backend;(0,a.assertNotComplex)(t,"abs");let n=new Float32Array((0,s.util).sizeFromShape(t.shape));return n=o(r.data.get(t.dataId).values),r.makeOutput(n,t.shape,t.dtype)},i={kernelName:s.Abs,backendName:"cpu",kernelFunc:l}},{"@tensorflow/tfjs-core":"2nuhV","../cpu_util":"f1aYU","@parcel/transformer-js/src/esmodule-helpers.js":"9pCYc"}],f1aYU:[function(e,t,r){/** * @license * Copyright 2019 Google LLC. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. * ============================================================================= */var n=e("@parcel/transformer-js/src/esmodule-helpers.js");n.defineInteropFlag(r),n.export(r,"assertNotComplex",()=>a);var s=e("@tensorflow/tfjs-core");function a(e,t){Array.isArray(e)||(e=[e]),e.forEach(e=>{null!=e&&(0,s.util).assert("complex64"!==e.dtype,()=>`${t} does not support complex64 tensors in the CPU backend.`)})}},{"@tensorflow/tfjs-core":"2nuhV","@parcel/transformer-js/src/esmodule-helpers.js":"9pCYc"}],"6fWFl":[function(e,t,r){/** * @license * Copyright 2020 Google LLC. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. * ============================================================================= */var n=e("@parcel/transformer-js/src/esmodule-helpers.js");n.defineInteropFlag(r),n.export(r,"addImpl",()=>l),n.export(r,"addComplexImpl",()=>i),n.export(r,"add",()=>u),n.export(r,"addConfig",()=>p);var s=e("@tensorflow/tfjs-core"),a=e("../utils/binary_impl"),o=e("../utils/binary_utils");let l=(0,a.createSimpleBinaryKernelImpl)((e,t)=>e+t),i=(0,o.createComplexBinaryKernelImpl)((e,t,r,n)=>({real:e+r,imag:t+n})),u=(0,o.binaryKernelFunc)(s.Add,l,i),p={kernelName:s.Add,backendName:"cpu",kernelFunc:u}},{"@tensorflow/tfjs-core":"2nuhV","../utils/binary_impl":"8pFjz","../utils/binary_utils":"8GweL","@parcel/transformer-js/src/esmodule-helpers.js":"9pCYc"}],"8pFjz":[function(e,t,r){/** * @license * Copyright 2020 Google LLC. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. * ============================================================================= */var n=e("@parcel/transformer-js/src/esmodule-helpers.js");n.defineInteropFlag(r),n.export(r,"createSimpleBinaryKernelImpl",()=>a);var s=e("@tensorflow/tfjs-core");function a(e){return(t,r,n,a,o)=>{let l=(0,s.backend_util).assertAndGetBroadcastShape(t,r),i=l.length,u=(0,s.util).computeStrides(l),p=(0,s.util).sizeFromShape(l),c=(0,s.util).getTypedArrayFromDType(o,p),d=t.length,f=r.length,h=(0,s.util).computeStrides(t),m=(0,s.util).computeStrides(r),g=(0,s.backend_util).getBroadcastDims(t,l),x=(0,s.backend_util).getBroadcastDims(r,l);if(g.length+x.length===0)for(let t=0;to[e]=0);let l=(0,s.util).locToIndex(o,d,h),p=r.slice(-f);x.forEach(e=>p[e]=0);let v=(0,s.util).locToIndex(p,f,m);c[t]=e(n[l],a[v])}return[c,l]}}},{"@tensorflow/tfjs-core":"2nuhV","@parcel/transformer-js/src/esmodule-helpers.js":"9pCYc"}],"8GweL":[function(e,t,r){/** * @license * Copyright 2020 Google LLC. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. * ============================================================================= */var n=e("@parcel/transformer-js/src/esmodule-helpers.js");n.defineInteropFlag(r),n.export(r,"binaryKernelFunc",()=>i),n.export(r,"createComplexBinaryKernelImpl",()=>u);var s=e("@tensorflow/tfjs-core"),a=e("../cpu_util"),o=e("../kernels/Cast"),l=e("../kernels/Complex");function i(e,t,r,n){return null==r?({inputs:r,backend:o})=>{let{a:l,b:i}=r;(0,a.assertNotComplex)([l,i],e);let u=o.data.get(l.dataId).values,p=o.data.get(i.dataId).values,c="string"===l.dtype?(0,s.backend_util).fromUint8ToStringArray(u):u,d="string"===l.dtype?(0,s.backend_util).fromUint8ToStringArray(p):p,f=n||l.dtype,[h,m]=t(l.shape,i.shape,c,d,f);return o.makeTensorInfo(m,f,h)}:({inputs:e,backend:s})=>{let{a,b:i}=e;if("complex64"===a.dtype||"complex64"===i.dtype){let e=(0,o.cast)({inputs:{x:a},backend:s,attrs:{dtype:"complex64"}}),t=s.data.get(e.dataId),n=t.complexTensorInfos.real,u=t.complexTensorInfos.imag,p=s.data.get(n.dataId).values,c=s.data.get(u.dataId).values,d=(0,o.cast)({inputs:{x:i},backend:s,attrs:{dtype:"complex64"}}),f=s.data.get(d.dataId),h=f.complexTensorInfos.real,m=f.complexTensorInfos.imag,g=s.data.get(h.dataId).values,x=s.data.get(m.dataId).values,[v,y,b]=r(a.shape,i.shape,p,c,g,x),_=s.makeTensorInfo(b,"float32",v),k=s.makeTensorInfo(b,"float32",y),j=(0,l.complex)({inputs:{real:_,imag:k},backend:s});return s.disposeIntermediateTensorInfo(e),s.disposeIntermediateTensorInfo(d),s.disposeIntermediateTensorInfo(_),s.disposeIntermediateTensorInfo(k),j}{let e=s.data.get(a.dataId).values,r=s.data.get(i.dataId).values,o=n||a.dtype,[l,u]=t(a.shape,i.shape,e,r,o);return s.makeTensorInfo(u,o,l)}}}function u(e){return(t,r,n,a,o,l)=>{let i=(0,s.backend_util).assertAndGetBroadcastShape(t,r),u=(0,s.util).sizeFromShape(i),p=i.length,c=(0,s.util).computeStrides(i),d=(0,s.util).getTypedArrayFromDType("float32",u),f=(0,s.util).getTypedArrayFromDType("float32",u),h=(0,s.backend_util).getBroadcastDims(t,i),m=(0,s.backend_util).getBroadcastDims(r,i),g=(0,s.backend_util).mergeRealAndImagArrays(n,a),x=(0,s.backend_util).mergeRealAndImagArrays(o,l),v=t.length,y=(0,s.util).computeStrides(t),b=r.length,_=(0,s.util).computeStrides(r);if(h.length+m.length===0)for(let t=0;tn[e]=0);let a=(0,s.util).locToIndex(n,v,y),o=r.slice(-b);m.forEach(e=>o[e]=0);let l=(0,s.util).locToIndex(o,b,_),i=e(g[2*a],g[2*a+1],x[2*l],x[2*l+1]);d[t]=i.real,f[t]=i.imag}return[d,f,i]}}},{"@tensorflow/tfjs-core":"2nuhV","../cpu_util":"f1aYU","../kernels/Cast":"ep8e6","../kernels/Complex":"6RuMJ","@parcel/transformer-js/src/esmodule-helpers.js":"9pCYc"}],ep8e6:[function(e,t,r){/** * @license * Copyright 2020 Google LLC. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. * ============================================================================= */var n=e("@parcel/transformer-js/src/esmodule-helpers.js");n.defineInteropFlag(r),n.export(r,"castImpl",()=>p),n.export(r,"cast",()=>c),n.export(r,"castConfig",()=>d);var s=e("@tensorflow/tfjs-core"),a=e("../utils/binary_impl"),o=e("../utils/zeros_impl"),l=e("./Complex"),i=e("./Identity"),u=e("./Real");function p(e,t,r,n){if("int32"===n)return[t,"int32",Int32Array.from(e)];if("bool"===n){let n=(0,s.util).toTypedArray([0],r),[o,l]=(0,a.createSimpleBinaryKernelImpl)((e,t)=>e!==t?1:0)(t,[],e,n,"bool");return[l,"bool",o]}throw Error(`Error in Cast: failed to cast ${r} to ${n}`)}function c(e){let{inputs:t,backend:r,attrs:n}=e,{x:a}=t,{dtype:d}=n;if("complex64"===d){if("complex64"===a.dtype)return(0,i.identity)({inputs:{x:a},backend:r});let e=(0,o.zeros)(r,a.shape,a.dtype),t=c({inputs:{x:a},backend:r,attrs:{dtype:"float32"}}),n=(0,l.complex)({inputs:{real:t,imag:e},backend:r});return r.disposeIntermediateTensorInfo(e),r.disposeIntermediateTensorInfo(t),n}if("complex64"===a.dtype){let e=(0,u.real)({inputs:{input:a},backend:r}),t=c({inputs:{x:e},backend:r,attrs:{dtype:d}});return r.disposeIntermediateTensorInfo(e),t}if(!(0,s.util).hasEncodingLoss(a.dtype,d)){let e=(0,i.identity)({inputs:{x:a},backend:r});return{dataId:e.dataId,shape:e.shape,dtype:d}}let[f,h,m]=p(r.data.get(a.dataId).values,a.shape,a.dtype,d);return r.makeTensorInfo(f,h,m)}let d={kernelName:s.Cast,backendName:"cpu",kernelFunc:c}},{"@tensorflow/tfjs-core":"2nuhV","../utils/binary_impl":"8pFjz","../utils/zeros_impl":"9xDy5","./Complex":"6RuMJ","./Identity":"3hjd4","./Real":"fn30c","@parcel/transformer-js/src/esmodule-helpers.js":"9pCYc"}],"9xDy5":[function(e,t,r){/** * @license * Copyright 2020 Google LLC. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. * ============================================================================= */var n=e("@parcel/transformer-js/src/esmodule-helpers.js");n.defineInteropFlag(r),n.export(r,"zeros",()=>function e(t,r,n="float32"){if("complex64"===n){let n=e(t,r,"float32"),s=e(t,r,"float32");return(0,a.complex)({inputs:{real:n,imag:s},backend:t})}let o=(0,s.util).makeZerosTypedArray((0,s.util).sizeFromShape(r),n);return t.makeTensorInfo(r,n,o)});var s=e("@tensorflow/tfjs-core"),a=e("../kernels/Complex")},{"@tensorflow/tfjs-core":"2nuhV","../kernels/Complex":"6RuMJ","@parcel/transformer-js/src/esmodule-helpers.js":"9pCYc"}],"6RuMJ":[function(e,t,r){/** * @license * Copyright 2020 Google LLC. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. * ============================================================================= */var n=e("@parcel/transformer-js/src/esmodule-helpers.js");function s(e){let{inputs:t,backend:r}=e,{real:n,imag:s}=t,a=r.data.get(n.dataId).values,o=r.data.get(s.dataId).values,l=r.makeTensorInfo(n.shape,"complex64");return r.data.get(l.dataId).complexTensorInfos={real:r.makeTensorInfo(n.shape,"float32",a),imag:r.makeTensorInfo(s.shape,"float32",o)},l}n.defineInteropFlag(r),n.export(r,"complex",()=>s),n.export(r,"complexConfig",()=>a);let a={kernelName:e("@tensorflow/tfjs-core").Complex,backendName:"cpu",kernelFunc:s}},{"@tensorflow/tfjs-core":"2nuhV","@parcel/transformer-js/src/esmodule-helpers.js":"9pCYc"}],"3hjd4":[function(e,t,r){/** * @license * Copyright 2020 Google LLC. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. * ============================================================================= */var n=e("@parcel/transformer-js/src/esmodule-helpers.js");function s(e){let{inputs:t,backend:r}=e,{x:n}=t;return r.incRef(n.dataId),{dataId:n.dataId,shape:n.shape,dtype:n.dtype}}n.defineInteropFlag(r),n.export(r,"identity",()=>s),n.export(r,"identityConfig",()=>a);let a={kernelName:e("@tensorflow/tfjs-core").Identity,backendName:"cpu",kernelFunc:s}},{"@tensorflow/tfjs-core":"2nuhV","@parcel/transformer-js/src/esmodule-helpers.js":"9pCYc"}],fn30c:[function(e,t,r){/** * @license * Copyright 2020 Google LLC. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. * ============================================================================= */var n=e("@parcel/transformer-js/src/esmodule-helpers.js");function s(e){let{inputs:t,backend:r}=e,{input:n}=t,s=r.data.get(n.dataId).complexTensorInfos.real,a=r.data.get(s.dataId).values;return r.makeTensorInfo(s.shape,s.dtype,a)}n.defineInteropFlag(r),n.export(r,"real",()=>s),n.export(r,"realConfig",()=>a);let a={kernelName:e("@tensorflow/tfjs-core").Real,backendName:"cpu",kernelFunc:s}},{"@tensorflow/tfjs-core":"2nuhV","@parcel/transformer-js/src/esmodule-helpers.js":"9pCYc"}],l6nVN:[function(e,t,r){/** * @license * Copyright 2020 Google LLC. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. * ============================================================================= */var n=e("@parcel/transformer-js/src/esmodule-helpers.js");n.defineInteropFlag(r),n.export(r,"bincountImpl",()=>a),n.export(r,"bincountReduceImpl",()=>o);var s=e("@tensorflow/tfjs-core");function a(e,t,r,n,a){let o=(0,s.util).sizeFromShape(n),l=(0,s.util).makeZerosTypedArray(a,r);for(let r=0;r=a||(o>0?l[n]+=t[r]:l[n]+=1)}return l}function o(e,t,r,n=!1){let a=e.shape[0],l=e.shape[1],i=(0,s.buffer)([a,r],t.dtype);for(let s=0;s=r||(n?i.set(1,s,o):t.size>0?i.set(i.get(s,o)+t.get(s,a),s,o):i.set(i.get(s,o)+1,s,o))}return i}},{"@tensorflow/tfjs-core":"2nuhV","@parcel/transformer-js/src/esmodule-helpers.js":"9pCYc"}],iYAYZ:[function(e,t,r){/** * @license * Copyright 2023 Google LLC. * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. * ============================================================================= */var n=e("@parcel/transformer-js/src/esmodule-helpers.js");n.defineInteropFlag(r),n.export(r,"bitwiseAndImpl",()=>l),n.export(r,"bitwiseAnd",()=>i),n.export(r,"bitwiseAndConfig",()=>u);var s=e("@tensorflow/tfjs-core"),a=e("../utils/binary_impl"),o=e("../utils/binary_utils");let l=(0,a.createSimpleBinaryKernelImpl)((e,t)=>e&t),i=(0,o.binaryKernelFunc)(s.BitwiseAnd,l),u={kernelName:s.BitwiseAnd,backendName:"cpu",kernelFunc:i}},{"@tensorflow/tfjs-core":"2nuhV","../utils/binary_impl":"8pFjz","../utils/binary_utils":"8GweL","@parcel/transformer-js/src/esmodule-helpers.js":"9pCYc"}],"5zveO":[function(e,t,r){/** * @license * Copyright 2020 Google LLC. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the License); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an AS IS BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. * ============================================================================= */var n=e("@parcel/transformer-js/src/esmodule-helpers.js");n.defineInteropFlag(r),n.export(r,"ceilImpl",()=>l),n.export(r,"ceil",()=>i),n.export(r,"ceilConfig",()=>u);var s=e("@tensorflow/tfjs-core"),a=e("../utils/unary_impl"),o=e("../utils/unary_utils");let l=(0,a.createSimpleUnaryImpl)(e=>Math.ceil(e)),i=(0,o.unaryKernelFuncFromImpl)(s.Ceil,l),u={kernelName:s.Ceil,backendName:"cpu",kernelFunc:i}},{"@tensorflow/tfjs-core":"2nuhV","../utils/unary_impl":"4sYQv","../utils/unary_utils":"i8gKT","@parcel/transformer-js/src/esmodule-helpers.js":"9pCYc"}],"4sYQv":[function(e,t,r){/** * @license * Copyright 2020 Google LLC. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. * ============================================================================= */var n=e("@parcel/transformer-js/src/esmodule-helpers.js");n.defineInteropFlag(r),n.export(r,"createSimpleUnaryImpl",()=>a);var s=e("@tensorflow/tfjs-core");function a(e){return(t,r,n)=>{let a=(0,s.util).getArrayFromDType(r,t.length);for(let r=0;rl),n.export(r,"unaryKernelFuncFromImpl",()=>i);var s=e("@tensorflow/tfjs-core"),a=e("../cpu_util"),o=e("./unary_impl");function l(e,t,r){return i(e,(0,o.createSimpleUnaryImpl)(t),r)}function i(e,t,r){return({inputs:n,attrs:o,backend:l})=>{let i;let{x:u}=n;(0,a.assertNotComplex)(u,e);let p=l.data.get(u.dataId).values;if("string"===u.dtype){if(!Array.isArray(p))throw Error("String tensor's value was not an instance of Array");i=(0,s.backend_util).fromUint8ToStringArray(p)}else i=p;let c=r||u.dtype,d=t(i,c,o);return l.makeTensorInfo(u.shape,c,d)}}},{"@tensorflow/tfjs-core":"2nuhV","../cpu_util":"f1aYU","./unary_impl":"4sYQv","@parcel/transformer-js/src/esmodule-helpers.js":"9pCYc"}],hktsy:[function(e,t,r){/** * @license * Copyright 2020 Google LLC. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. * ============================================================================= */var n=e("@parcel/transformer-js/src/esmodule-helpers.js");n.defineInteropFlag(r),n.export(r,"concatImpl",()=>a);var s=e("@tensorflow/tfjs-core");function a(e,t,r,n){let a=(0,s.util).getArrayFromDType(r,(0,s.util).sizeFromShape(t));if(n&&"string"!==r){let t=0;e.forEach(e=>{let r=(0,s.util).sizeFromShape(e.shape);a.set(e.vals,t),t+=r})}else{let n=0;e.forEach(e=>{let o="string"===r?(0,s.backend_util).fromUint8ToStringArray(e.vals):e.vals,l=0;for(let r=0;rl),n.export(r,"equal",()=>i),n.export(r,"equalConfig",()=>u);var s=e("@tensorflow/tfjs-core"),a=e("../utils/binary_impl"),o=e("../utils/binary_utils");let l=(0,a.createSimpleBinaryKernelImpl)((e,t)=>e===t?1:0),i=(0,o.binaryKernelFunc)(s.Equal,l,null,"bool"),u={kernelName:s.Equal,backendName:"cpu",kernelFunc:i}},{"@tensorflow/tfjs-core":"2nuhV","../utils/binary_impl":"8pFjz","../utils/binary_utils":"8GweL","@parcel/transformer-js/src/esmodule-helpers.js":"9pCYc"}],"7zaJk":[function(e,t,r){/** * @license * Copyright 2020 Google LLC. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the License); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an AS IS BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. * ============================================================================= */var n=e("@parcel/transformer-js/src/esmodule-helpers.js");n.defineInteropFlag(r),n.export(r,"expImpl",()=>l),n.export(r,"exp",()=>i),n.export(r,"expConfig",()=>u);var s=e("@tensorflow/tfjs-core"),a=e("../utils/unary_impl"),o=e("../utils/unary_utils");let l=(0,a.createSimpleUnaryImpl)(e=>Math.exp(e)),i=(0,o.unaryKernelFuncFromImpl)(s.Exp,l,"float32"),u={kernelName:s.Exp,backendName:"cpu",kernelFunc:i}},{"@tensorflow/tfjs-core":"2nuhV","../utils/unary_impl":"4sYQv","../utils/unary_utils":"i8gKT","@parcel/transformer-js/src/esmodule-helpers.js":"9pCYc"}],gvpte:[function(e,t,r){/** * @license * Copyright 2020 Google LLC. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the License); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an AS IS BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. * ============================================================================= */var n=e("@parcel/transformer-js/src/esmodule-helpers.js");n.defineInteropFlag(r),n.export(r,"expm1Impl",()=>l),n.export(r,"expm1",()=>i),n.export(r,"expm1Config",()=>u);var s=e("@tensorflow/tfjs-core"),a=e("../utils/unary_impl"),o=e("../utils/unary_utils");let l=(0,a.createSimpleUnaryImpl)(e=>Math.expm1(e)),i=(0,o.unaryKernelFuncFromImpl)(s.Expm1,l),u={kernelName:s.Expm1,backendName:"cpu",kernelFunc:i}},{"@tensorflow/tfjs-core":"2nuhV","../utils/unary_impl":"4sYQv","../utils/unary_utils":"i8gKT","@parcel/transformer-js/src/esmodule-helpers.js":"9pCYc"}],jQTXs:[function(e,t,r){/** * @license * Copyright 2020 Google LLC. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the License); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an AS IS BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. * ============================================================================= */var n=e("@parcel/transformer-js/src/esmodule-helpers.js");n.defineInteropFlag(r),n.export(r,"floorImpl",()=>l),n.export(r,"floor",()=>i),n.export(r,"floorConfig",()=>u);var s=e("@tensorflow/tfjs-core"),a=e("../utils/unary_impl"),o=e("../utils/unary_utils");let l=(0,a.createSimpleUnaryImpl)(e=>Math.floor(e)),i=(0,o.unaryKernelFuncFromImpl)(s.Floor,l),u={kernelName:s.Floor,backendName:"cpu",kernelFunc:i}},{"@tensorflow/tfjs-core":"2nuhV","../utils/unary_impl":"4sYQv","../utils/unary_utils":"i8gKT","@parcel/transformer-js/src/esmodule-helpers.js":"9pCYc"}],"40JHE":[function(e,t,r){/** * @license * Copyright 2020 Google LLC. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. * ============================================================================= */var n=e("@parcel/transformer-js/src/esmodule-helpers.js");n.defineInteropFlag(r),n.export(r,"floorDivImpl",()=>l),n.export(r,"floorDiv",()=>i),n.export(r,"floorDivConfig",()=>u);var s=e("@tensorflow/tfjs-core"),a=e("../utils/binary_impl"),o=e("../utils/binary_utils");let l=(0,a.createSimpleBinaryKernelImpl)((e,t)=>Math.floor(e/t)),i=(0,o.binaryKernelFunc)(s.FloorDiv,l,null,"int32"),u={kernelName:s.FloorDiv,backendName:"cpu",kernelFunc:i}},{"@tensorflow/tfjs-core":"2nuhV","../utils/binary_impl":"8pFjz","../utils/binary_utils":"8GweL","@parcel/transformer-js/src/esmodule-helpers.js":"9pCYc"}],"3CatI":[function(e,t,r){/** * @license * Copyright 2021 Google LLC. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. * ============================================================================= */var n=e("@parcel/transformer-js/src/esmodule-helpers.js");n.defineInteropFlag(r),n.export(r,"gatherNdImpl",()=>a);var s=e("@tensorflow/tfjs-core");function a(e,t,r,n,a,o,l,i,u){let p=(0,s.buffer)([n,o],r);for(let r=0;r=u/o)throw Error(`Invalid indices: ${n} does not index into ${i}`);for(let e=0;ea);var s=e("@tensorflow/tfjs-core");function a(e,t,r){let n=(0,s.buffer)(r,e.dtype);for(let r=0;rl),n.export(r,"greater",()=>i),n.export(r,"greaterConfig",()=>u);var s=e("@tensorflow/tfjs-core"),a=e("../utils/binary_impl"),o=e("../utils/binary_utils");let l=(0,a.createSimpleBinaryKernelImpl)((e,t)=>e>t?1:0),i=(0,o.binaryKernelFunc)(s.Greater,l,null,"bool"),u={kernelName:s.Greater,backendName:"cpu",kernelFunc:i}},{"@tensorflow/tfjs-core":"2nuhV","../utils/binary_impl":"8pFjz","../utils/binary_utils":"8GweL","@parcel/transformer-js/src/esmodule-helpers.js":"9pCYc"}],blrhL:[function(e,t,r){/** * @license * Copyright 2020 Google LLC. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. * ============================================================================= */var n=e("@parcel/transformer-js/src/esmodule-helpers.js");n.defineInteropFlag(r),n.export(r,"greaterEqualImpl",()=>l),n.export(r,"greaterEqual",()=>i),n.export(r,"greaterEqualConfig",()=>u);var s=e("@tensorflow/tfjs-core"),a=e("../utils/binary_impl"),o=e("../utils/binary_utils");let l=(0,a.createSimpleBinaryKernelImpl)((e,t)=>e>=t?1:0),i=(0,o.binaryKernelFunc)(s.GreaterEqual,l,null,"bool"),u={kernelName:s.GreaterEqual,backendName:"cpu",kernelFunc:i}},{"@tensorflow/tfjs-core":"2nuhV","../utils/binary_impl":"8pFjz","../utils/binary_utils":"8GweL","@parcel/transformer-js/src/esmodule-helpers.js":"9pCYc"}],"6Z0Og":[function(e,t,r){/** * @license * Copyright 2020 Google LLC. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. * ============================================================================= */var n=e("@parcel/transformer-js/src/esmodule-helpers.js");n.defineInteropFlag(r),n.export(r,"lessImpl",()=>l),n.export(r,"less",()=>i),n.export(r,"lessConfig",()=>u);var s=e("@tensorflow/tfjs-core"),a=e("../utils/binary_impl"),o=e("../utils/binary_utils");let l=(0,a.createSimpleBinaryKernelImpl)((e,t)=>el),n.export(r,"lessEqual",()=>i),n.export(r,"lessEqualConfig",()=>u);var s=e("@tensorflow/tfjs-core"),a=e("../utils/binary_impl"),o=e("../utils/binary_utils");let l=(0,a.createSimpleBinaryKernelImpl)((e,t)=>e<=t?1:0),i=(0,o.binaryKernelFunc)(s.LessEqual,l,null,"bool"),u={kernelName:s.LessEqual,backendName:"cpu",kernelFunc:i}},{"@tensorflow/tfjs-core":"2nuhV","../utils/binary_impl":"8pFjz","../utils/binary_utils":"8GweL","@parcel/transformer-js/src/esmodule-helpers.js":"9pCYc"}],"6p1Nu":[function(e,t,r){/** * @license * Copyright 2020 Google LLC. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. * ============================================================================= */var n=e("@parcel/transformer-js/src/esmodule-helpers.js");n.defineInteropFlag(r),n.export(r,"linSpaceImpl",()=>a);var s=e("@tensorflow/tfjs-core");function a(e,t,r){let n=(t-e)/(r-1),a=(0,s.util).makeZerosTypedArray(r,"float32");a[0]=e;for(let e=1;el),n.export(r,"log",()=>i),n.export(r,"logConfig",()=>u);var s=e("@tensorflow/tfjs-core"),a=e("../utils/unary_impl"),o=e("../utils/unary_utils");let l=(0,a.createSimpleUnaryImpl)(e=>Math.log(e)),i=(0,o.unaryKernelFuncFromImpl)(s.Log,l),u={kernelName:s.Log,backendName:"cpu",kernelFunc:i}},{"@tensorflow/tfjs-core":"2nuhV","../utils/unary_impl":"4sYQv","../utils/unary_utils":"i8gKT","@parcel/transformer-js/src/esmodule-helpers.js":"9pCYc"}],bUPEH:[function(e,t,r){/** * @license * Copyright 2020 Google LLC. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. * ============================================================================= */var n=e("@parcel/transformer-js/src/esmodule-helpers.js");n.defineInteropFlag(r),n.export(r,"maxImpl",()=>a);var s=e("@tensorflow/tfjs-core");function a(e,t,r,n){let a=(0,s.util).getTypedArrayFromDType(n,(0,s.util).sizeFromShape(r));for(let r=0;rs)&&(s=t)}a[r]=s}return a}},{"@tensorflow/tfjs-core":"2nuhV","@parcel/transformer-js/src/esmodule-helpers.js":"9pCYc"}],"9MgzM":[function(e,t,r){/** * @license * Copyright 2020 Google LLC. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. * ============================================================================= */var n=e("@parcel/transformer-js/src/esmodule-helpers.js");n.defineInteropFlag(r),n.export(r,"maximumImpl",()=>l),n.export(r,"maximum",()=>i),n.export(r,"maximumConfig",()=>u);var s=e("@tensorflow/tfjs-core"),a=e("../utils/binary_impl"),o=e("../utils/binary_utils");let l=(0,a.createSimpleBinaryKernelImpl)((e,t)=>Math.max(e,t)),i=(0,o.binaryKernelFunc)(s.Maximum,l),u={kernelName:s.Maximum,backendName:"cpu",kernelFunc:i}},{"@tensorflow/tfjs-core":"2nuhV","../utils/binary_impl":"8pFjz","../utils/binary_utils":"8GweL","@parcel/transformer-js/src/esmodule-helpers.js":"9pCYc"}],bIhZ4:[function(e,t,r){/** * @license * Copyright 2020 Google LLC. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. * ============================================================================= */var n=e("@parcel/transformer-js/src/esmodule-helpers.js");n.defineInteropFlag(r),n.export(r,"minimumImpl",()=>l),n.export(r,"minimum",()=>i),n.export(r,"minimumConfig",()=>u);var s=e("@tensorflow/tfjs-core"),a=e("../utils/binary_impl"),o=e("../utils/binary_utils");let l=(0,a.createSimpleBinaryKernelImpl)((e,t)=>Math.min(e,t)),i=(0,o.binaryKernelFunc)(s.Minimum,l),u={kernelName:s.Minimum,backendName:"cpu",kernelFunc:i}},{"@tensorflow/tfjs-core":"2nuhV","../utils/binary_impl":"8pFjz","../utils/binary_utils":"8GweL","@parcel/transformer-js/src/esmodule-helpers.js":"9pCYc"}],k52uJ:[function(e,t,r){/** * @license * Copyright 2020 Google LLC. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. * ============================================================================= */var n=e("@parcel/transformer-js/src/esmodule-helpers.js");n.defineInteropFlag(r),n.export(r,"multiplyImpl",()=>l),n.export(r,"multiplyComplexImpl",()=>i),n.export(r,"multiply",()=>u),n.export(r,"multiplyConfig",()=>p);var s=e("@tensorflow/tfjs-core"),a=e("../utils/binary_impl"),o=e("../utils/binary_utils");let l=(0,a.createSimpleBinaryKernelImpl)((e,t)=>e*t),i=(0,o.createComplexBinaryKernelImpl)((e,t,r,n)=>({real:e*r-t*n,imag:e*n+t*r})),u=(0,o.binaryKernelFunc)(s.Multiply,l,i),p={kernelName:s.Multiply,backendName:"cpu",kernelFunc:u}},{"@tensorflow/tfjs-core":"2nuhV","../utils/binary_impl":"8pFjz","../utils/binary_utils":"8GweL","@parcel/transformer-js/src/esmodule-helpers.js":"9pCYc"}],"1Innr":[function(e,t,r){/** * @license * Copyright 2020 Google LLC. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. * ============================================================================= */var n=e("@parcel/transformer-js/src/esmodule-helpers.js");n.defineInteropFlag(r),n.export(r,"negImpl",()=>l),n.export(r,"neg",()=>i),n.export(r,"negConfig",()=>u);var s=e("@tensorflow/tfjs-core"),a=e("../cpu_util"),o=e("./Multiply");function l(e,t,r){let n=(0,s.util).createScalarValue(-1,r);return(0,o.multiplyImpl)([],t,n,e,r)}function i(e){let{inputs:t,backend:r}=e,{x:n}=t;(0,a.assertNotComplex)(n,"neg");let[s,o]=l(r.data.get(n.dataId).values,n.shape,n.dtype);return r.makeTensorInfo(o,n.dtype,s)}let u={kernelName:s.Neg,backendName:"cpu",kernelFunc:i}},{"@tensorflow/tfjs-core":"2nuhV","../cpu_util":"f1aYU","./Multiply":"k52uJ","@parcel/transformer-js/src/esmodule-helpers.js":"9pCYc"}],"8Jfov":[function(e,t,r){/** * @license * Copyright 2020 Google LLC. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. * ============================================================================= */var n=e("@parcel/transformer-js/src/esmodule-helpers.js");n.defineInteropFlag(r),n.export(r,"notEqualImpl",()=>l),n.export(r,"notEqual",()=>i),n.export(r,"notEqualConfig",()=>u);var s=e("@tensorflow/tfjs-core"),a=e("../utils/binary_impl"),o=e("../utils/binary_utils");let l=(0,a.createSimpleBinaryKernelImpl)((e,t)=>e!==t?1:0),i=(0,o.binaryKernelFunc)(s.NotEqual,l,null,"bool"),u={kernelName:s.NotEqual,backendName:"cpu",kernelFunc:i}},{"@tensorflow/tfjs-core":"2nuhV","../utils/binary_impl":"8pFjz","../utils/binary_utils":"8GweL","@parcel/transformer-js/src/esmodule-helpers.js":"9pCYc"}],kTBVD:[function(e,t,r){/** * @license * Copyright 2020 Google LLC. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. * ============================================================================= */var n=e("@parcel/transformer-js/src/esmodule-helpers.js");n.defineInteropFlag(r),n.export(r,"prodImpl",()=>l),n.export(r,"prod",()=>i),n.export(r,"prodConfig",()=>u);var s=e("@tensorflow/tfjs-core"),a=e("../cpu_util"),o=e("./Transpose");function l(e,t,r,n){let[a,o]=(0,s.backend_util).computeOutAndReduceShapes(e,n),l=(0,s.upcastType)(t,"int32"),i=(0,s.util).makeZerosTypedArray((0,s.util).sizeFromShape(a),l),u=(0,s.util).sizeFromShape(o);for(let e=0;er.disposeIntermediateTensorInfo(e)),r.makeTensorInfo(_,b,v)}let u={kernelName:s.Prod,backendName:"cpu",kernelFunc:i}},{"@tensorflow/tfjs-core":"2nuhV","../cpu_util":"f1aYU","./Transpose":"4kskA","@parcel/transformer-js/src/esmodule-helpers.js":"9pCYc"}],"4kskA":[function(e,t,r){/** * @license * Copyright 2020 Google LLC. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. * ============================================================================= */var n=e("@parcel/transformer-js/src/esmodule-helpers.js");n.defineInteropFlag(r),n.export(r,"transpose",()=>l),n.export(r,"transposeConfig",()=>i);var s=e("@tensorflow/tfjs-core"),a=e("../cpu_util"),o=e("./Transpose_impl");function l(e){let{inputs:t,attrs:r,backend:n}=e,{x:s}=t,{perm:l}=r;(0,a.assertNotComplex)(s,"transpose");let i=Array(s.shape.length);for(let e=0;ea);var s=e("@tensorflow/tfjs-core");function a(e,t,r,n,a){let o=t.length,l=(0,s.util).sizeFromShape(t),i=(0,s.util).computeStrides(t),u=(0,s.util).computeStrides(a),p=(0,s.util).getTypedArrayFromDType(r,(0,s.util).sizeFromShape(a));for(let t=0;to);var s=e("@tensorflow/tfjs-core");function a(e,t){let r=e.slice(0,t);for(;r.length{if(e<0||e>=r){let a=(0,s.util).indexToLoc(n,t.length,(0,s.util).computeStrides(t)).join(",");throw Error(`indices[${a}] = ${e} is not in [0, ${r})`)}})}(l,i,t[0][0]-1),0===n.length)throw Error("params.rank must be nonzero");let{outSplits:p,valueSlices:c,numValues:d}=function(e,t,r,n){let s=[],a=0,o=Array(t.length-1+r.length).fill(null).map(()=>[0]);!function(e,t){for(let r=0;rs)throw Error("Ragged splits must not point past values");for(let e=1;en[e])throw Error("Ragged splits must be sorted in ascending order")}}(r,n);let l=1;for(let e=0;e=0){let e=o[s],t=e[e.length-1]-n[l];for(let e=l;ea[t]=e)}return t}(p),h=function(e,t,r,n,o){let l=t.slice();l[0]=o;let i=(0,s.util).getArrayFromDType(r,(0,s.util).sizeFromShape(l)),u=e.length,p=0===u?0:u/t[0];return!function(e,t,r,n,s,o){let l=a(t,2)[1],i=a(o,2)[1],u=0;for(let t of r)for(let r=t[0];ra);var s=e("@tensorflow/tfjs-core");function a(e,t,r,n,a,o,l){if(t.length>1)throw Error("starts must be a scalar or vector");if(a.length>1)throw Error("limits must be a scalar or vector");if(l.length>1)throw Error("deltas must be a scalar or vector");let i=0===t.length,u=0===a.length,p=0===l.length,c=[];i||c.push(t[0]),u||c.push(a[0]),p||c.push(l[0]);for(let e=1;e0&&as)r=0;else if((r=Math.ceil(Math.abs((a-s)/l)))>0x7fffffff)throw Error("Requires ((limit - start) / delta)<= 2147483647");f[t+1]=f[t]+r}let h=f[d],m=(0,s.util).getArrayFromDType(r,h),g=0;for(let t=0;tu);var s=e("@tensorflow/tfjs-core"),a=s.backend_util.RowPartitionType;class o{constructor(e,t,r,n,a,o,l,i,u,p){this.shape=e,this.shapeShape=t,this.values=r,this.valuesShape=n,this.valuesDType=a,this.defaultValue=o,this.defaultValueShape=l,this.rowPartitionValues=i,this.rowPartitionValuesShapes=u,this.rowPartitionTypes=(0,s.backend_util).getRowPartitionTypesHelper(p),this.raggedRank=(0,s.backend_util).getRaggedRank(this.rowPartitionTypes)}getRowPartitionTypeByDimension(e){return this.rowPartitionTypes[0]===a.FIRST_DIM_SIZE?this.rowPartitionTypes[e+1]:this.rowPartitionTypes[e]}getRowPartitionTensor(e){return this.rowPartitionTypes[0]===a.FIRST_DIM_SIZE?this.rowPartitionValues[e+1]:this.rowPartitionValues[e]}getMaxWidth(e){let t=this.getRowPartitionTensor(e-1);switch(this.getRowPartitionTypeByDimension(e-1)){case a.VALUE_ROWIDS:return o.getMaxWidthValueRowID(t);case a.ROW_SPLITS:return o.getMaxWidthRowSplit(t);default:throw Error(`Cannot handle partition type ${a[this.getRowPartitionTypeByDimension(e-1)]}`)}}static getMaxWidthRowSplit(e){let t=e.length;if(0===t||1===t)return 0;let r=0;for(let n=0;nr&&(r=t)}return r}static getMaxWidthValueRowID(e){let t=e.length;if(0===t)return 0;let r=0,n=e[0],s=0;for(let a=1;a"Final length of result must be equal to firstDimension."),a}calculateOutputIndexRowSplit(e,t,r,n){let s=e.length,a=[];for(let o=0;o0&&a.length!==e[s-1])throw Error("Invalid row split size.");return a}calculateOutputIndexValueRowID(e,t,r,n){let s=e.length,a=[];if(0===s)return[];let o=0,l=e[0];if(l>=t.length)throw Error(`Got currentValueRowId=${l}, which is not less than ${t.length}`);let i=t[l];a.push(i);for(let u=1;u=0&&(++o=t.length)throw Error(`Got nextValueRowId=${s} which is not less than ${t.length}`);i=t[s]}a.push(i)}if(a.length!==e.length)throw Error("Invalid row ids.");return a}calculateOutputIndex(e,t,r,n){let s=this.getRowPartitionTensor(e),o=this.getRowPartitionTypeByDimension(e);switch(o){case a.VALUE_ROWIDS:return this.calculateOutputIndexValueRowID(s,t,r,n);case a.ROW_SPLITS:if(s.length-1>t.length)throw Error(`Row partition size is greater than output size: ${s.length-1} > ${t.length}`);return this.calculateOutputIndexRowSplit(s,t,r,n);default:throw Error(`Unsupported partition type: ${a[o]}`)}}getFirstDimensionSize(){let e=this.rowPartitionValues[0];if(0===this.rowPartitionTypes.length)throw Error("No row_partition_types given.");let t=this.rowPartitionTypes[0];switch(t){case a.FIRST_DIM_SIZE:return e[0];case a.VALUE_ROWIDS:throw Error("Cannot handle VALUE_ROWIDS in first dimension.");case a.ROW_SPLITS:return this.rowPartitionValuesShapes[0][0]-1;default:throw Error(`Cannot handle type ${a[t]}`)}}compute(){if(this.rowPartitionValues[0].length<=0)throw Error("Invalid first partition input. Tensor requires at least one element.");let e=this.getFirstDimensionSize(),t=this.calculateOutputSize(e),r=Array(this.raggedRank+1);r[r.length-1]=1;for(let e=r.length-2;e>=0;--e)r[e]=r[e+1]*t[e+1];let n=i(t,!1),a=(0,s.util).getArrayFromDType(this.valuesDType,(0,s.util).sizeFromShape(n));if(r[0]*t[0]>0){let s=this.calculateFirstParentOutputIndex(e,r[0],t[0]);for(let e=1;e<=this.raggedRank;++e)s=this.calculateOutputIndex(e-1,s,r[e],t[e]);this.setOutput(this.raggedRank,s,a,n)}return[n,a]}setOutput(e,t,r,n){if(0===r.length)return;let a=this.values,o=n.slice();o=o.slice(e+1);let i=(0,s.util).sizeFromShape(o),u=t.length,p=this.defaultValue;if(p.length!==i&&1!==p.length){let e=this.defaultValueShape;(0,s.tidy)(()=>{let t=(0,s.reshape)(p,e);p=(0,s.broadcastTo)(t,o).dataSync()})}let c=0,d=0,f=0;for(let e=0;e<=u;++e){let n=e=u&&(n=Math.floor(r.length/i)),n>f){if(1===this.defaultValue.length)r.subarray(f*i,n*i).fill(this.defaultValue[0]),f=n;else for(;n>f;)l(r.slice(f*i),p,i),++f}n<0?(c=e+1,d=f):(c=e,f=(d=f)+1)}}}function l(e,t,r){for(let n=0;n= 0`);if(n<-1)throw Error(`Dimension ${n} must be >= -1`);n=-1}r.push(n)}return r}function u(e,t,r,n,s,a,l,i,u,p){return new o(e,t,r,n,s,a,l,i,u,p).compute()}},{"@tensorflow/tfjs-core":"2nuhV","@parcel/transformer-js/src/esmodule-helpers.js":"9pCYc"}],ktDJX:[function(e,t,r){/** * @license * Copyright 2020 Google LLC. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. * ============================================================================= */var n=e("@parcel/transformer-js/src/esmodule-helpers.js");n.defineInteropFlag(r),n.export(r,"rangeImpl",()=>a);var s=e("@tensorflow/tfjs-core");function a(e,t,r,n){let a=e===t,o=e1;if(a||o||l)return(0,s.util).makeZerosTypedArray(0,n);let i=Math.abs(Math.ceil((t-e)/r)),u=(0,s.util).makeZerosTypedArray(i,n);tl),n.export(r,"rsqrt",()=>i),n.export(r,"rsqrtConfig",()=>u);var s=e("@tensorflow/tfjs-core"),a=e("../utils/unary_impl"),o=e("../utils/unary_utils");let l=(0,a.createSimpleUnaryImpl)(e=>1/Math.sqrt(e)),i=(0,o.unaryKernelFuncFromImpl)(s.Rsqrt,l),u={kernelName:s.Rsqrt,backendName:"cpu",kernelFunc:i}},{"@tensorflow/tfjs-core":"2nuhV","../utils/unary_impl":"4sYQv","../utils/unary_utils":"i8gKT","@parcel/transformer-js/src/esmodule-helpers.js":"9pCYc"}],f9QJS:[function(e,t,r){/** * @license * Copyright 2020 Google LLC. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. * ============================================================================= */var n=e("@parcel/transformer-js/src/esmodule-helpers.js");n.defineInteropFlag(r),n.export(r,"scatterImpl",()=>a);var s=e("@tensorflow/tfjs-core");function a(e,t,r,n,a,o,l,i,u,p){let c=e.values,d=t.values;if(0===n)return(0,s.buffer)(r,t.dtype);let f=u instanceof s.TensorBuffer?u:(0,s.buffer)([n/a,a],t.dtype);"string"==typeof u?f.values.fill(u):"number"==typeof u?f.values.fill(u):"boolean"==typeof u&&f.values.fill(+u);for(let e=0;e=n/a)throw Error(`Invalid indices: ${s} does not index into ${r}`);for(let r=0;rl),n.export(r,"sigmoid",()=>i),n.export(r,"sigmoidConfig",()=>u);var s=e("@tensorflow/tfjs-core"),a=e("../utils/unary_impl"),o=e("../utils/unary_utils");let l=(0,a.createSimpleUnaryImpl)(e=>1/(1+Math.exp(-e))),i=(0,o.unaryKernelFunc)(s.Sigmoid,e=>1/(1+Math.exp(-e))),u={kernelName:s.Sigmoid,backendName:"cpu",kernelFunc:i}},{"@tensorflow/tfjs-core":"2nuhV","../utils/unary_impl":"4sYQv","../utils/unary_utils":"i8gKT","@parcel/transformer-js/src/esmodule-helpers.js":"9pCYc"}],loZC8:[function(e,t,r){/** * @license * Copyright 2020 Google LLC. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. * ============================================================================= */var n=e("@parcel/transformer-js/src/esmodule-helpers.js");n.defineInteropFlag(r),n.export(r,"sliceImpl",()=>o),n.export(r,"slice",()=>l),n.export(r,"sliceConfig",()=>i);var s=e("@tensorflow/tfjs-core"),a=e("../cpu_util");function o(e,t,r,n,a){let o=(0,s.slice_util).isSliceContinous(n,t,r),l=(0,s.util).sizeFromShape(r),i=(0,s.util).computeStrides(n);if(o){let r=(0,s.slice_util).computeFlatOffset(t,i);return"string"===a?e.slice(r,r+l):e.subarray(r,r+l)}let u="string"===a?(0,s.backend_util).fromUint8ToStringArray(e):e,p=(0,s.buffer)(n,a,u),c=(0,s.buffer)(r,a);for(let e=0;ee+t[r]);c.set(p.get(...n),...r)}return"string"===a?(0,s.backend_util).fromStringArrayToUint8(c.values):c.values}function l(e){let{inputs:t,backend:r,attrs:n}=e,{x:l}=t,{begin:i,size:u}=n;(0,a.assertNotComplex)(l,"slice");let[p,c]=(0,s.slice_util).parseSliceParams(l,i,u);(0,s.slice_util).assertParamsValid(l,p,c);let d=o(r.data.get(l.dataId).values,p,c,l.shape,l.dtype);return r.makeTensorInfo(c,l.dtype,d)}let i={kernelName:s.Slice,backendName:"cpu",kernelFunc:l}},{"@tensorflow/tfjs-core":"2nuhV","../cpu_util":"f1aYU","@parcel/transformer-js/src/esmodule-helpers.js":"9pCYc"}],lHwnD:[function(e,t,r){/** * @license * Copyright 2021 Google LLC. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. * ============================================================================= */var n=e("@parcel/transformer-js/src/esmodule-helpers.js");n.defineInteropFlag(r),n.export(r,"sparseFillEmptyRowsImpl",()=>a);var s=e("@tensorflow/tfjs-core");function a(e,t,r,n,a,o,l){let i=t[0],u=o[0],p=Array(u),c=Array(i),d=t[1];if(0===u){if(0!==i)throw Error((0,s.backend_util).getSparseFillEmptyRowsIndicesDenseShapeMismatch(i));return[(0,s.util).getArrayFromDType(r,0),[0,d],(0,s.util).getArrayFromDType(a,0),p,c]}let f=!0,h=0,m=Array(u).fill(0);for(let t=0;t=u)throw Error((0,s.backend_util).getSparseFillEmptyRowsOutOfRangeIndexErrorMessage(t,r,u));++m[r],f=f&&r>=h,h=r}let g=!0;for(let e=0;e0&&(m[e]+=m[e-1])}if(g&&f){for(let e=0;ea);var s=e("@tensorflow/tfjs-core");function a(e,t,r,n,a){let o=(0,s.util).sizeFromShape(n),l=t[0],i=a.length,u=[],p=1,c=-1;for(let e=0;e0){f[d-1]=1;for(let e=d-2;e>=0;--e)f[e]=f[e+1]*n[e+1]}let h=[];if(i>0){h[i-1]=1;for(let e=i-2;e>=0;--e)h[e]=h[e+1]*u[e+1]}let m=(0,s.util).getArrayFromDType(r,l*i);for(let t=0;ta);var s=e("@tensorflow/tfjs-core");function a(e,t,r,n,o,l=!1,i=0){let u=n.length,p=[t[0],e.length/t[0]],c=p[1],d=u>0?o[u-1]+1:0;if(d<0)throw Error((0,s.backend_util).getSparseSegmentReductionNegativeSegmentIdsErrorMessage());let f=t.slice();f[0]=d;let h=f.reduce((e,t)=>e*t,1),m=(0,s.util).getArrayFromDType(r,h);if(0===u)return d>0&&m.fill(i),[m,f];if(d<=0)throw Error((0,s.backend_util).getSparseSegmentReductionNegativeSegmentIdsErrorMessage());let g=0,x=1,v=0,y=o[0];for(;;){let t=0;if(x=t)throw Error((0,s.backend_util).getSparseSegmentReductionNonIncreasingSegmentIdsErrorMessage())}if(y<0||y>=d)throw Error((0,s.backend_util).getSparseSegmentReductionSegmentIdOutOfRangeErrorMessage(y,d));y>v&&m.fill(i,v*c,y*c);for(let t=g;t=p[0])throw Error((0,s.backend_util).getSparseSegmentReductionIndicesOutOfRangeErrorMessage(t,n[t],p[0]));for(let t=0;tu)break}return vl),n.export(r,"sqrt",()=>i),n.export(r,"sqrtConfig",()=>u);var s=e("@tensorflow/tfjs-core"),a=e("../utils/unary_impl"),o=e("../utils/unary_utils");let l=(0,a.createSimpleUnaryImpl)(e=>Math.sqrt(e)),i=(0,o.unaryKernelFunc)(s.Sqrt,e=>Math.sqrt(e)),u={kernelName:s.Sqrt,backendName:"cpu",kernelFunc:i}},{"@tensorflow/tfjs-core":"2nuhV","../utils/unary_impl":"4sYQv","../utils/unary_utils":"i8gKT","@parcel/transformer-js/src/esmodule-helpers.js":"9pCYc"}],h63Nj:[function(e,t,r){/** * @license * Copyright 2020 Google LLC. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. * ============================================================================= */var n=e("@parcel/transformer-js/src/esmodule-helpers.js");n.defineInteropFlag(r),n.export(r,"squaredDifferenceImpl",()=>l),n.export(r,"squaredDifference",()=>i),n.export(r,"squaredDifferenceConfig",()=>u);var s=e("@tensorflow/tfjs-core"),a=e("../utils/binary_impl"),o=e("../utils/binary_utils");let l=(0,a.createSimpleBinaryKernelImpl)((e,t)=>{let r=e-t;return r*r}),i=(0,o.binaryKernelFunc)(s.SquaredDifference,l),u={kernelName:s.SquaredDifference,backendName:"cpu",kernelFunc:i}},{"@tensorflow/tfjs-core":"2nuhV","../utils/binary_impl":"8pFjz","../utils/binary_utils":"8GweL","@parcel/transformer-js/src/esmodule-helpers.js":"9pCYc"}],"6gC9H":[function(e,t,r){/** * @license * Copyright 2023 Google LLC. * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. * ============================================================================= */var n=e("@parcel/transformer-js/src/esmodule-helpers.js");n.defineInteropFlag(r),n.export(r,"staticRegexReplaceImpl",()=>l),n.export(r,"staticRegexReplaceConfig",()=>u);var s=e("@tensorflow/tfjs-core"),a=e("../utils/unary_impl"),o=e("../utils/unary_utils");let l=(0,a.createSimpleUnaryImpl)((e,t)=>{let{pattern:r,replaceGlobal:n,rewrite:s}=t;return e.replace(new RegExp(r,n?"g":""),s)}),i=(0,o.unaryKernelFuncFromImpl)(s.StaticRegexReplace,l),u={kernelName:s.StaticRegexReplace,backendName:"cpu",kernelFunc:i}},{"@tensorflow/tfjs-core":"2nuhV","../utils/unary_impl":"4sYQv","../utils/unary_utils":"i8gKT","@parcel/transformer-js/src/esmodule-helpers.js":"9pCYc"}],"3U7SN":[function(e,t,r){/** * @license * Copyright 2020 Google LLC. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. * ============================================================================= */var n=e("@parcel/transformer-js/src/esmodule-helpers.js");n.defineInteropFlag(r),n.export(r,"stridedSliceImpl",()=>a);var s=e("@tensorflow/tfjs-core");function a(e,t,r,n){let a=(0,s.buffer)(e,t.dtype);for(let e=0;eo);var s=e("@tensorflow/tfjs-core");class a{constructor(e,t,r,n,a,o){this.separator=(0,s.util).encodeString(e),this.nGramWidths=t,this.leftPad=(0,s.util).encodeString(r),this.rightPad=(0,s.util).encodeString(n),this.padWidth=a,this.preserveShort=o}getPadWidth(e){return Math.min(this.padWidth<0?e-1:this.padWidth,e-1)}getNumNGrams(e,t){return Math.max(0,e+2*this.getPadWidth(t)-t+1)}createNGrams(e,t,r,n,s,a){for(let o=0;o0?0:o-i);l=0+u*this.leftPad.length;for(let t=0;te.forEach(e=>f[h++]=e);for(let e=0;e0){m(e[d+c-1]);for(let e=0;e0){let e=t[0];if(0!==e)throw Error(`First split value must be 0, got ${e}`);for(let s=1;s=e;if(!(n=n&&t[s]<=r))throw Error(`Invalid split value ${t[s]}, must be in [${e}, ${r}]`);e=t[s]}if(e!==r)throw Error(`Last split value must be data size. Expected ${r}, got ${e}`)}let a=n-1,o=(0,s.util).getArrayFromDType("int32",n);if(0===r||0===n){let e=Array(r);for(let e=0;e<=a;++e)o[e]=0;return[e,o]}o[0]=0;for(let e=1;e<=a;++e){let r=t[e]-t[e-1],n=0;this.nGramWidths.forEach(e=>{n+=this.getNumNGrams(r,e)}),this.preserveShort&&r>0&&0===n&&(n=1),o[e]=o[e-1]+n}let l=Array(o[a]);for(let r=0;r{let o=t[r+1]-t[r],i=this.getNumNGrams(o,a);this.createNGrams(e,n,l,s,i,a),s+=i}),this.preserveShort&&s===o[r]){let a=t[r+1]-t[r];if(0===a)continue;let o=a+2*this.padWidth;this.createNGrams(e,n,l,s,1,o)}}return[l,o]}}function o(e,t,r,n,s,o,l,i){return new a(r,n,s,o,l,i).compute(e,t)}},{"@tensorflow/tfjs-core":"2nuhV","@parcel/transformer-js/src/esmodule-helpers.js":"9pCYc"}],fAlpl:[function(e,t,r){/** * @license * Copyright 2021 Google LLC. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. * ============================================================================= */var n=e("@parcel/transformer-js/src/esmodule-helpers.js");n.defineInteropFlag(r),n.export(r,"stringSplitImpl",()=>a);var s=e("@tensorflow/tfjs-core");function a(e,t,r){let n=e.length,a=[],o=0,l=0,i=Array(n);for(let s=0;sa);var s=e("@tensorflow/tfjs-core");function a(e,t){let r=(0,s.util).getArrayFromDType("int32",e.length);for(let n=0;nl),n.export(r,"subComplexImpl",()=>i),n.export(r,"sub",()=>u),n.export(r,"subConfig",()=>p);var s=e("@tensorflow/tfjs-core"),a=e("../utils/binary_impl"),o=e("../utils/binary_utils");let l=(0,a.createSimpleBinaryKernelImpl)((e,t)=>e-t),i=(0,o.createComplexBinaryKernelImpl)((e,t,r,n)=>({real:e-r,imag:t-n})),u=(0,o.binaryKernelFunc)(s.Sub,l,i),p={kernelName:s.Sub,backendName:"cpu",kernelFunc:u}},{"@tensorflow/tfjs-core":"2nuhV","../utils/binary_impl":"8pFjz","../utils/binary_utils":"8GweL","@parcel/transformer-js/src/esmodule-helpers.js":"9pCYc"}],fdvO1:[function(e,t,r){/** * @license * Copyright 2019 Google LLC. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. * ============================================================================= */var n=e("@parcel/transformer-js/src/esmodule-helpers.js");n.defineInteropFlag(r),n.export(r,"tileImpl",()=>a);var s=e("@tensorflow/tfjs-core");function a(e,t){let r=Array(e.rank);for(let n=0;no);var s=e("@tensorflow/tfjs-core");let a=(e,t)=>{let r=t.value-e.value;return 0===r?e.index-t.index:r};function o(e,t,r,n,o){let l=t[t.length-1],[i,u]=[e.length/l,l],p=(0,s.util).getTypedArrayFromDType(r,i*n),c=(0,s.util).getTypedArrayFromDType("int32",i*n);for(let t=0;ti[t]={value:e,index:t}),nn;){if(o-n>600){let s=o-n+1,a=r-n+1,l=Math.log(s),i=.5*Math.exp(2*l/3),u=.5*Math.sqrt(l*i*(s-i)/s)*Math.sign(a-s/2),p=Math.max(n,Math.floor(r-a*i/s+u)),c=Math.min(o,Math.floor(r+(s-a)*i/s+u));e(t,r,p,c)}let l=t[r],i=n,u=o;for((0,s.util).swap(t,n,r),a(t[o],l)>0&&(0,s.util).swap(t,n,o);ia(t[i],l);)i+=1;for(;a(t[u],l)>0;)u-=1}0===a(t[n],l)?(0,s.util).swap(t,n,u):(u+=1,(0,s.util).swap(t,u,o)),u<=r&&(n=u+1),r<=u&&(o=u-1)}}(i,n),i=i.slice(0,n)),o&&i.sort(a);let d=t*n,f=p.subarray(d,d+n),h=c.subarray(d,d+n);for(let e=0;ea);var s=e("@tensorflow/tfjs-core");function a(e,t,r,n){let a=(0,s.util).parseAxisParam(t,r)[0],o=[1,r[0],1];for(let e=0;e{for(let r=0;rl);var s=e("./gpgpu_math"),a=e("./packing_util"),o=e("./shader_compiler");class l{constructor(e){if(this.variableNames=["A"],this.packedInputs=!1,this.packedOutput=!0,this.outputShape=e,this.rank=e.length,this.enableShapeUniforms=(0,s.useShapeUniforms)(this.outputShape.length),0===this.rank)this.userCode=` void main() { setOutput(vec4(getA(), 0., 0., 0.)); } `;else{let e=(0,a.getChannels)("rc",this.rank),t=(0,o.getCoordsDataType)(this.rank),r=this.getOutOfBoundsCondition(e),n=this.getSetup(e),s=this.getOutput(e);this.userCode=` void main() { ${t} rc = getOutputCoords(); if(${r}) { setOutput(vec4(0)); } else { ${n} setOutput(vec4(${s})); } } `}}getSourceCoordsArr(e){let t=[];for(let r=0;r<=1;r++)for(let n=0;n<=1;n++){let s=`${0===r?"r":"rp1"}, ${0===n?"c":"cp1"}`;for(let t=2;t${this.enableShapeUniforms?"outShape":this.outputShape[0]}`;let t="";for(let r=this.rank-2;r= ${this.enableShapeUniforms?`outShape[${r}]`:this.outputShape[r]}`,r= ${r}; bool rEdge = rp1 >= ${n}; `}getOutput(e){let t=this.getSourceCoordsArr(e);if(1===this.rank){let e=this.enableShapeUniforms?"outShape":this.outputShape[0];return`getA(rc), (rc + 1 >= ${e} ? 0. : getA(rc + 1)), 0, 0`}return`getA(${t[0]}), cEdge ? 0. : getA(${t[1]}), rEdge ? 0. : getA(${t[2]}), rEdge || cEdge ? 0. : getA(${t[3]})`}}},{"./gpgpu_math":"f1P40","./packing_util":"6V5sg","./shader_compiler":"3kYYB","@parcel/transformer-js/src/esmodule-helpers.js":"9pCYc"}],"6V5sg":[function(e,t,r){/** * @license * Copyright 2018 Google LLC. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. * ============================================================================= */var n=e("@parcel/transformer-js/src/esmodule-helpers.js");function s(e,t){return["x","y","z","w","u","v"].slice(0,t).map(t=>`${e}.${t}`)}function a(e,t){return 1===t?[e]:s(e,t)}function o(e,t){if(1===e)return"rc";let r="";for(let n=0;ns),n.export(r,"getChannels",()=>a),n.export(r,"getSourceCoords",()=>o)},{"@parcel/transformer-js/src/esmodule-helpers.js":"9pCYc"}],eOdKZ:[function(e,t,r){/** * @license * Copyright 2018 Google LLC. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. * ============================================================================= */var n=e("@parcel/transformer-js/src/esmodule-helpers.js");n.defineInteropFlag(r),n.export(r,"ReshapePackedProgram",()=>o);var s=e("./gpgpu_math"),a=e("./shader_compiler_util");class o{constructor(e,t){this.variableNames=["A"],this.packedInputs=!0,this.packedOutput=!0,this.customUniforms=[{name:"inputShape",type:"ivec3"}],this.outputShape=e,this.enableShapeUniforms=(0,s.useShapeUniforms)(this.outputShape.length);let r="";for(let e=0;e<4;e++){let t="thisRC = rc;";e%2==1&&(t+="thisRC.z += 1;"),e>1&&(t+="thisRC.y += 1;"),r+=` ${t} ${e>0?"if(thisRC.y< rows && thisRC.z < cols){":""} int flatIndex = getFlatIndex(thisRC); ivec3 inputRC = inputCoordsFromReshapedOutCoords(flatIndex); vec2 inputRCInnerDims = vec2(float(inputRC.y),float(inputRC.z)); result[${e}] = getChannel(getA(inputRC.x, inputRC.y, inputRC.z), inputRCInnerDims); ${e>0?"}":""} `}this.userCode=` ${function(e,t){let r=t?a.getLogicalCoordinatesFromFlatIndexByUniform(["r","c","d"],"inputShape"):a.getLogicalCoordinatesFromFlatIndex(["r","c","d"],e);return` ivec3 inputCoordsFromReshapedOutCoords(int index) { ${r} return ivec3(r, c, d); } `}(t,this.enableShapeUniforms)} ${this.enableShapeUniforms?a.getFlatIndexFrom3DOutput():a.getFlatIndexFrom3D(e)} void main() { ivec3 rc = getOutputCoords(); vec4 result = vec4(0.); ivec3 thisRC; int rows = ${this.enableShapeUniforms?"outShape[1]":e[1]}; int cols = ${this.enableShapeUniforms?"outShape[2]":e[2]}; ${r} setOutput(result); } `}}},{"./gpgpu_math":"f1P40","./shader_compiler_util":"6NnjI","@parcel/transformer-js/src/esmodule-helpers.js":"9pCYc"}],"5CLPF":[function(e,t,r){/** * @license * Copyright 2017 Google LLC. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. * ============================================================================= */var n=e("@parcel/transformer-js/src/esmodule-helpers.js");n.defineInteropFlag(r),n.export(r,"TextureManager",()=>l),n.export(r,"computeBytes",()=>i);var s=e("@tensorflow/tfjs-core"),a=e("./gpgpu_util"),o=e("./tex_util");class l{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,r){let n;let s=u(t,r),a=p(e,s,r);a in this.freeTextures||(this.freeTextures[a]=[]),a in this.usedTextures||(this.usedTextures[a]=[]);let l=i(e,s,this.gpgpu.gl,this.gpgpu.textureConfig,r);if(this.freeTextures[a].length>0){this.numFreeTextures--,this.numUsedTextures++,this._numBytesFree-=l,this.log();let e=this.freeTextures[a].pop();return this.usedTextures[a].push(e),e}return s===o.PhysicalTextureType.PACKED_2X2_FLOAT32?n=this.gpgpu.createPackedMatrixTexture(e[0],e[1]):s===o.PhysicalTextureType.PACKED_2X2_FLOAT16?n=this.gpgpu.createFloat16PackedMatrixTexture(e[0],e[1]):s===o.PhysicalTextureType.UNPACKED_FLOAT32?n=this.gpgpu.createFloat32MatrixTexture(e[0],e[1]):s===o.PhysicalTextureType.UNPACKED_FLOAT16?n=this.gpgpu.createFloat16MatrixTexture(e[0],e[1]):s===o.PhysicalTextureType.PACKED_4X1_UNSIGNED_BYTE&&(n=this.gpgpu.createUnsignedBytesMatrixTexture(e[0],e[1])),this.usedTextures[a].push(n),this.numUsedTextures++,this._numBytesAllocated+=l,this.log(),n}releaseTexture(e,t,r,n){if(null==this.freeTextures)return;let a=u(r,n),o=p(t,a,n);o in this.freeTextures||(this.freeTextures[o]=[]);let l=i(t,a,this.gpgpu.gl,this.gpgpu.textureConfig,n),c=(0,s.env)().getNumber("WEBGL_DELETE_TEXTURE_THRESHOLD");-1!==c&&this._numBytesAllocated>c?(this.gpgpu.deleteMatrixTexture(e.texture),this._numBytesAllocated-=l):(this.freeTextures[o].push(e),this.numFreeTextures++,this._numBytesFree+=l),this.numUsedTextures--;let d=this.usedTextures[o],f=d&&d.indexOf(e);if(null==f||f<0)throw Error("Cannot release a texture that was never provided by this texture manager");d[f]=d[d.length-1],d.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(null!=this.freeTextures){for(let e in this.freeTextures)this.freeTextures[e].forEach(e=>{this.gpgpu.deleteMatrixTexture(e.texture)});for(let e in this.usedTextures)this.usedTextures[e].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 i(e,t,r,n,s){let l;let i=function(e,t){switch(e){case o.PhysicalTextureType.PACKED_2X2_FLOAT32:return(0,a.getInternalFormatForPackedMatrixTexture)(t);case o.PhysicalTextureType.PACKED_2X2_FLOAT16:return(0,a.getInternalFormatForFloat16PackedMatrixTexture)(t);case o.PhysicalTextureType.UNPACKED_FLOAT32:return(0,a.getInternalFormatForFloat32MatrixTexture)(t);case o.PhysicalTextureType.UNPACKED_FLOAT16:return(0,a.getInternalFormatForFloat16MatrixTexture)(t);case o.PhysicalTextureType.PACKED_4X1_UNSIGNED_BYTE:return(0,a.getInternalFormatForUnsignedBytesMatrixTexture)(t);default:throw Error(`Unknown physical texture type ${e}`)}}(t,n);if(s){let[t,r]=(0,o.getPackedMatrixTextureShapeWidthHeight)(e[0],e[1]);l=t*r}else{let[t,r]=(0,o.getUnpackedMatrixTextureShapeWidthHeight)(e[0],e[1]);l=t*r}return l*function(e,t){if(t===e.R32F)return 4;if(t===e.R16F)return 2;if(t===e.RGBA32F||t===e.RGBA)return 16;if(t===e.RGBA16F)return 8;if(t===e.RGBA8)return 4;throw Error(`Unknown internal format ${t}`)}(r,i)}function u(e,t){if(e===o.TextureUsage.UPLOAD)return o.PhysicalTextureType.PACKED_2X2_FLOAT32;if(e===o.TextureUsage.RENDER||null==e)return(0,s.env)().getBool("WEBGL_RENDER_FLOAT32_ENABLED")?t?o.PhysicalTextureType.PACKED_2X2_FLOAT32:o.PhysicalTextureType.UNPACKED_FLOAT32:t?o.PhysicalTextureType.PACKED_2X2_FLOAT16:o.PhysicalTextureType.UNPACKED_FLOAT16;if(e===o.TextureUsage.DOWNLOAD||e===o.TextureUsage.PIXELS)return o.PhysicalTextureType.PACKED_4X1_UNSIGNED_BYTE;throw Error(`Unknown logical texture type ${e}`)}function p(e,t,r){return`${e[0]}_${e[1]}_${t}_${r}`}},{"@tensorflow/tfjs-core":"2nuhV","./gpgpu_util":"aVhSt","./tex_util":"9R0ee","@parcel/transformer-js/src/esmodule-helpers.js":"9pCYc"}],iNthQ:[function(e,t,r){/** * @license * Copyright 2017 Google LLC. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. * ============================================================================= */var n=e("@parcel/transformer-js/src/esmodule-helpers.js");n.defineInteropFlag(r),n.export(r,"UnaryOpProgram",()=>a),n.export(r,"CHECK_NAN_SNIPPET",()=>o),n.export(r,"LINEAR",()=>l),n.export(r,"ABS",()=>i),n.export(r,"STEP",()=>u),n.export(r,"ELU",()=>p),n.export(r,"RELU",()=>c),n.export(r,"RELU6",()=>d),n.export(r,"CLONE",()=>f),n.export(r,"SIGMOID",()=>h);var s=e("./gpgpu_math");class a{constructor(e,t){this.variableNames=["A"],this.outputShape=e,this.enableShapeUniforms=(0,s.useShapeUniforms)(this.outputShape.length),this.userCode=` float unaryOperation(float x) { ${t} } void main() { float x = getAAtOutCoords(); float y = unaryOperation(x); setOutput(y); } `}}let o="if (isnan(x)) return x;",l="return x;",i="return abs(x);";function u(e=0){return o+` return x > 0.0 ? 1.0 : float(${e}); `}let p="return (x >= 0.0) ? x : (exp(x) - 1.0);",c=o+` return (x< 0.0) ? 0.0 : x; `,d=o+` return (x < 0.0) ? 0.0 : min(6.0, x); `,f="return x;",h="return 1.0 / (1.0 + exp(-1.0 * x));"},{"./gpgpu_math":"f1P40","@parcel/transformer-js/src/esmodule-helpers.js":"9pCYc"}],k4CIw:[function(e,t,r){/** * @license * Copyright 2018 Google LLC. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. * ============================================================================= */var n=e("@parcel/transformer-js/src/esmodule-helpers.js");n.defineInteropFlag(r),n.export(r,"LINEAR",()=>a),n.export(r,"ELU",()=>o),n.export(r,"RELU",()=>l),n.export(r,"RELU6",()=>i),n.export(r,"SIGMOID",()=>u),n.export(r,"UnaryOpPackedProgram",()=>p);var s=e("./gpgpu_math");let a="return x;",o=` vec4 result; result.r = (x.r >= 0.0) ? x.r : (exp(x.r) - 1.0); result.g = (x.g >= 0.0) ? x.g : (exp(x.g) - 1.0); result.b = (x.b >= 0.0) ? x.b : (exp(x.b) - 1.0); result.a = (x.a >= 0.0) ? x.a : (exp(x.a) - 1.0); return result; `,l=` vec4 result = x * vec4(greaterThanEqual(x, vec4(0.0))); bvec4 isNaN = isnan(x); result.r = isNaN.r ? x.r : result.r; result.g = isNaN.g ? x.g : result.g; result.b = isNaN.b ? x.b : result.b; result.a = isNaN.a ? x.a : result.a; return result; `,i=` vec4 result = min(x, vec4(6.)) * vec4(greaterThanEqual(x, vec4(0.0))); bvec4 isNaN = isnan(x); result.r = isNaN.r ? x.r : result.r; result.g = isNaN.g ? x.g : result.g; result.b = isNaN.b ? x.b : result.b; result.a = isNaN.a ? x.a : result.a; return result; `,u="return 1.0 / (1.0 + exp(-1.0 * x));";class p{constructor(e,t){this.variableNames=["A"],this.packedInputs=!0,this.packedOutput=!0,this.outputShape=e,this.enableShapeUniforms=(0,s.useShapeUniforms)(this.outputShape.length),this.userCode=` vec4 unaryOperation(vec4 x) { ${t} } void main() { vec4 x = getAAtOutCoords(); vec4 y = unaryOperation(x); setOutput(y); } `}}},{"./gpgpu_math":"f1P40","@parcel/transformer-js/src/esmodule-helpers.js":"9pCYc"}],"3bIZY":[function(e,t,r){/** * @license * Copyright 2018 Google LLC. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. * ============================================================================= */var n=e("@parcel/transformer-js/src/esmodule-helpers.js");n.defineInteropFlag(r),n.export(r,"UnpackProgram",()=>l);var s=e("./gpgpu_math"),a=e("./packing_util"),o=e("./shader_compiler");class l{constructor(e){this.variableNames=["A"],this.packedInputs=!0,this.packedOutput=!1,this.outputShape=e,this.enableShapeUniforms=(0,s.useShapeUniforms)(this.outputShape.length);let t=e.length,r=(0,a.getChannels)("rc",t),n=(0,o.getCoordsDataType)(t),l=(0,a.getSourceCoords)(t,r),i=r.slice(-2),u=t<=1?"rc":`vec2(${i.join(",")})`;this.userCode=` void main() { ${n} rc = getOutputCoords(); vec4 packedInput = getA(${l}); setOutput(getChannel(packedInput, ${u})); } `}}},{"./gpgpu_math":"f1P40","./packing_util":"6V5sg","./shader_compiler":"3kYYB","@parcel/transformer-js/src/esmodule-helpers.js":"9pCYc"}],j1Udx:[function(e,t,r){/** @license See the LICENSE file. */var n=e("@parcel/transformer-js/src/esmodule-helpers.js");n.defineInteropFlag(r),n.export(r,"version",()=>s);let s="4.21.0"},{"@parcel/transformer-js/src/esmodule-helpers.js":"9pCYc"}],"38nh6":[function(e,t,r){/** * @license * Copyright 2019 Google LLC. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. * ============================================================================= */var n=e("@parcel/transformer-js/src/esmodule-helpers.js");n.defineInteropFlag(r),n.export(r,"MathBackendWebGL",()=>l.MathBackendWebGL),n.export(r,"setWebGLContext",()=>i.setWebGLContext),n.export(r,"GPGPUContext",()=>u.GPGPUContext),n.export(r,"gpgpu_util",()=>a),n.export(r,"webgl_util",()=>o),n.export(r,"forceHalfFloat",()=>p);var s=e("@tensorflow/tfjs-core"),a=e("./gpgpu_util"),o=e("./webgl_util"),l=e("./backend_webgl"),i=e("./canvas_util"),u=e("./gpgpu_context");function p(){(0,s.env)().set("WEBGL_FORCE_F16_TEXTURES",!0)}},{"@tensorflow/tfjs-core":"2nuhV","./gpgpu_util":"aVhSt","./webgl_util":"90dxa","./backend_webgl":"1clUm","./canvas_util":"6IMgE","./gpgpu_context":"a8QiN","@parcel/transformer-js/src/esmodule-helpers.js":"9pCYc"}],"4bNpu":[function(e,t,r){/** * @license * Copyright 2020 Google LLC. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. * ============================================================================= */var n=e("@tensorflow/tfjs-core"),s=e("./kernels/_FusedMatMul"),a=e("./kernels/Abs"),o=e("./kernels/Acos"),l=e("./kernels/Acosh"),i=e("./kernels/Add"),u=e("./kernels/AddN"),p=e("./kernels/All"),c=e("./kernels/Any"),d=e("./kernels/ArgMax"),f=e("./kernels/ArgMin"),h=e("./kernels/Asin"),m=e("./kernels/Asinh"),g=e("./kernels/Atan"),x=e("./kernels/Atan2"),v=e("./kernels/Atanh"),y=e("./kernels/AvgPool"),b=e("./kernels/AvgPool3D"),_=e("./kernels/AvgPool3DGrad"),k=e("./kernels/AvgPoolGrad"),j=e("./kernels/BatchMatMul"),I=e("./kernels/BatchNorm"),C=e("./kernels/BatchToSpaceND"),w=e("./kernels/Bincount"),T=e("./kernels/BitwiseAnd"),S=e("./kernels/BroadcastArgs"),N=e("./kernels/Cast"),E=e("./kernels/Ceil"),F=e("./kernels/ClipByValue"),R=e("./kernels/Complex"),A=e("./kernels/ComplexAbs"),P=e("./kernels/Concat"),D=e("./kernels/Conv2D"),$=e("./kernels/Conv2DBackpropFilter"),M=e("./kernels/Conv2DBackpropInput"),O=e("./kernels/Conv3D"),V=e("./kernels/Conv3DBackpropFilterV2"),B=e("./kernels/Conv3DBackpropInputV2"),L=e("./kernels/Cos"),G=e("./kernels/Cosh"),z=e("./kernels/CropAndResize"),U=e("./kernels/Cumprod"),Y=e("./kernels/Cumsum"),W=e("./kernels/DenseBincount"),q=e("./kernels/DepthToSpace"),K=e("./kernels/DepthwiseConv2dNative"),H=e("./kernels/DepthwiseConv2dNativeBackpropFilter"),X=e("./kernels/DepthwiseConv2dNativeBackpropInput"),Q=e("./kernels/Diag"),J=e("./kernels/Dilation2D"),Z=e("./kernels/Einsum"),ee=e("./kernels/Elu"),et=e("./kernels/EluGrad"),er=e("./kernels/Equal"),en=e("./kernels/Erf"),es=e("./kernels/Exp"),ea=e("./kernels/ExpandDims"),eo=e("./kernels/Expm1"),el=e("./kernels/FFT"),ei=e("./kernels/Fill"),eu=e("./kernels/FlipLeftRight"),ep=e("./kernels/Floor"),ec=e("./kernels/FloorDiv"),ed=e("./kernels/FromPixels"),ef=e("./kernels/FusedConv2D"),eh=e("./kernels/FusedDepthwiseConv2D"),em=e("./kernels/GatherNd"),eg=e("./kernels/GatherV2"),ex=e("./kernels/Greater"),ev=e("./kernels/GreaterEqual"),ey=e("./kernels/Identity"),eb=e("./kernels/IFFT"),e_=e("./kernels/Imag"),ek=e("./kernels/IsFinite"),ej=e("./kernels/IsInf"),eI=e("./kernels/IsNaN"),eC=e("./kernels/LeakyRelu"),ew=e("./kernels/Less"),eT=e("./kernels/LessEqual"),eS=e("./kernels/LinSpace"),eN=e("./kernels/Log"),eE=e("./kernels/Log1p"),eF=e("./kernels/LogicalAnd"),eR=e("./kernels/LogicalNot"),eA=e("./kernels/LogicalOr"),eP=e("./kernels/LRN"),eD=e("./kernels/LRNGrad"),e$=e("./kernels/Max"),eM=e("./kernels/Maximum"),eO=e("./kernels/MaxPool"),eV=e("./kernels/MaxPool3D"),eB=e("./kernels/MaxPool3DGrad"),eL=e("./kernels/MaxPoolGrad"),eG=e("./kernels/MaxPoolWithArgmax"),ez=e("./kernels/Mean"),eU=e("./kernels/Min"),eY=e("./kernels/Minimum"),eW=e("./kernels/MirrorPad"),eq=e("./kernels/Mod"),eK=e("./kernels/Multinomial"),eH=e("./kernels/Multiply"),eX=e("./kernels/Neg"),eQ=e("./kernels/NonMaxSuppressionV3"),eJ=e("./kernels/NonMaxSuppressionV4"),eZ=e("./kernels/NonMaxSuppressionV5"),e0=e("./kernels/NotEqual"),e1=e("./kernels/OneHot"),e2=e("./kernels/OnesLike"),e3=e("./kernels/Pack"),e4=e("./kernels/PadV2"),e9=e("./kernels/Pow"),e6=e("./kernels/Prelu"),e5=e("./kernels/Prod"),e8=e("./kernels/RaggedGather"),e7=e("./kernels/RaggedRange"),te=e("./kernels/RaggedTensorToTensor"),tt=e("./kernels/Range"),tr=e("./kernels/Real"),tn=e("./kernels/RealDiv"),ts=e("./kernels/Reciprocal"),ta=e("./kernels/Relu"),to=e("./kernels/Relu6"),tl=e("./kernels/Reshape"),ti=e("./kernels/ResizeBilinear"),tu=e("./kernels/ResizeBilinearGrad"),tp=e("./kernels/ResizeNearestNeighbor"),tc=e("./kernels/ResizeNearestNeighborGrad"),td=e("./kernels/Reverse"),tf=e("./kernels/RotateWithOffset"),th=e("./kernels/Round"),tm=e("./kernels/Rsqrt"),tg=e("./kernels/ScatterNd"),tx=e("./kernels/SearchSorted"),tv=e("./kernels/Select"),ty=e("./kernels/Selu"),tb=e("./kernels/Sigmoid"),t_=e("./kernels/Sign"),tk=e("./kernels/Sin"),tj=e("./kernels/Sinh"),tI=e("./kernels/Slice"),tC=e("./kernels/Softmax"),tw=e("./kernels/Softplus"),tT=e("./kernels/SpaceToBatchND"),tS=e("./kernels/SparseFillEmptyRows"),tN=e("./kernels/SparseReshape"),tE=e("./kernels/SparseSegmentMean"),tF=e("./kernels/SparseSegmentSum"),tR=e("./kernels/SparseToDense"),tA=e("./kernels/SplitV"),tP=e("./kernels/Sqrt"),tD=e("./kernels/Square"),t$=e("./kernels/SquaredDifference"),tM=e("./kernels/StaticRegexReplace"),tO=e("./kernels/Step"),tV=e("./kernels/StridedSlice"),tB=e("./kernels/StringNGrams"),tL=e("./kernels/StringSplit"),tG=e("./kernels/StringToHashBucketFast"),tz=e("./kernels/Sub"),tU=e("./kernels/Sum"),tY=e("./kernels/Tan"),tW=e("./kernels/Tanh"),tq=e("./kernels/TensorScatterUpdate"),tK=e("./kernels/Tile"),tH=e("./kernels/TopK"),tX=e("./kernels/Transform"),tQ=e("./kernels/Transpose"),tJ=e("./kernels/Unique"),tZ=e("./kernels/Unpack"),t0=e("./kernels/UnsortedSegmentSum"),t1=e("./kernels/ZerosLike");for(let e of[s._fusedMatMulConfig,a.absConfig,o.acosConfig,l.acoshConfig,i.addConfig,u.addNConfig,p.allConfig,c.anyConfig,d.argMaxConfig,f.argMinConfig,h.asinConfig,m.asinhConfig,g.atanConfig,x.atan2Config,v.atanhConfig,y.avgPoolConfig,b.avgPool3DConfig,_.avgPool3DGradConfig,k.avgPoolGradConfig,j.batchMatMulConfig,I.batchNormConfig,C.batchToSpaceNDConfig,w.bincountConfig,T.bitwiseAndConfig,S.broadcastArgsConfig,N.castConfig,E.ceilConfig,F.clipByValueConfig,R.complexConfig,A.complexAbsConfig,P.concatConfig,D.conv2DConfig,$.conv2DBackpropFilterConfig,M.conv2DBackpropInputConfig,O.conv3DConfig,V.conv3DBackpropFilterV2Config,B.conv3DBackpropInputConfig,L.cosConfig,G.coshConfig,z.cropAndResizeConfig,U.cumprodConfig,Y.cumsumConfig,W.denseBincountConfig,q.depthToSpaceConfig,K.depthwiseConv2dNativeConfig,H.depthwiseConv2dNativeBackpropFilterConfig,X.depthwiseConv2dNativeBackpropInputConfig,Q.diagConfig,J.dilation2DConfig,Z.einsumConfig,ee.eluConfig,et.eluGradConfig,er.equalConfig,en.erfConfig,es.expConfig,ea.expandDimsConfig,eo.expm1Config,el.fftConfig,ei.fillConfig,eu.flipLeftRightConfig,ep.floorConfig,ec.floorDivConfig,ed.fromPixelsConfig,ef.fusedConv2DConfig,eh.fusedDepthwiseConv2DConfig,em.gatherNdConfig,eg.gatherV2Config,ex.greaterConfig,ev.greaterEqualConfig,ey.identityConfig,eb.ifftConfig,e_.imagConfig,ek.isFiniteConfig,ej.isInfConfig,eI.isNaNConfig,eC.leakyReluConfig,ew.lessConfig,eT.lessEqualConfig,eS.linSpaceConfig,eN.logConfig,eE.log1pConfig,eF.logicalAndConfig,eR.logicalNotConfig,eA.logicalOrConfig,eP.LRNConfig,eD.LRNGradConfig,e$.maxConfig,eM.maximumConfig,eO.maxPoolConfig,eV.maxPool3DConfig,eB.maxPool3DGradConfig,eL.maxPoolGradConfig,eG.maxPoolWithArgmaxConfig,ez.meanConfig,eU.minConfig,eY.minimumConfig,eW.mirrorPadConfig,eq.modConfig,eK.multinomialConfig,eH.multiplyConfig,eX.negConfig,eQ.nonMaxSuppressionV3Config,eJ.nonMaxSuppressionV4Config,eZ.nonMaxSuppressionV5Config,e0.notEqualConfig,e1.oneHotConfig,e2.onesLikeConfig,e3.packConfig,e4.padV2Config,e9.powConfig,e6.preluConfig,e5.prodConfig,e8.raggedGatherConfig,e7.raggedRangeConfig,te.raggedTensorToTensorConfig,tt.rangeConfig,tr.realConfig,tn.realDivConfig,ts.reciprocalConfig,ta.reluConfig,to.relu6Config,tl.reshapeConfig,ti.resizeBilinearConfig,tu.resizeBilinearGradConfig,tp.resizeNearestNeighborConfig,tc.resizeNearestNeighborGradConfig,td.reverseConfig,tf.rotateWithOffsetConfig,th.roundConfig,tm.rsqrtConfig,tg.scatterNdConfig,tx.searchSortedConfig,tv.selectConfig,ty.seluConfig,tb.sigmoidConfig,t_.signConfig,tk.sinConfig,tj.sinhConfig,tI.sliceConfig,tC.softmaxConfig,tw.softplusConfig,tT.spaceToBatchNDConfig,tS.sparseFillEmptyRowsConfig,tN.sparseReshapeConfig,tE.sparseSegmentMeanConfig,tF.sparseSegmentSumConfig,tR.sparseToDenseConfig,tA.splitVConfig,tP.sqrtConfig,tD.squareConfig,t$.squaredDifferenceConfig,tM.staticRegexReplaceConfig,tO.stepConfig,tV.stridedSliceConfig,tB.stringNGramsConfig,tL.stringSplitConfig,tG.stringToHashBucketFastConfig,tz.subConfig,tU.sumConfig,tY.tanConfig,tW.tanhConfig,tq.tensorScatterUpdateConfig,tK.tileConfig,tH.topKConfig,tX.transformConfig,tQ.transposeConfig,tJ.uniqueConfig,tZ.unpackConfig,t0.unsortedSegmentSumConfig,t1.zerosLikeConfig])(0,n.registerKernel)(e)},{"@tensorflow/tfjs-core":"2nuhV","./kernels/_FusedMatMul":"5QpqN","./kernels/Abs":"16RiY","./kernels/Acos":"5iMxV","./kernels/Acosh":"hyXtP","./kernels/Add":"haSsN","./kernels/AddN":"03klX","./kernels/All":"2VNFE","./kernels/Any":"8sdvF","./kernels/ArgMax":"hdwg5","./kernels/ArgMin":"fh1Sp","./kernels/Asin":"8DDqZ","./kernels/Asinh":"hflRY","./kernels/Atan":"9DplV","./kernels/Atan2":"5Uvfw","./kernels/Atanh":"1WtgM","./kernels/AvgPool":"Y3t4M","./kernels/AvgPool3D":"ckdCF","./kernels/AvgPool3DGrad":"d31lO","./kernels/AvgPoolGrad":"dtrwN","./kernels/BatchMatMul":"9LPN8","./kernels/BatchNorm":"5xrVt","./kernels/BatchToSpaceND":"61dz8","./kernels/Bincount":"f7Rdr","./kernels/BitwiseAnd":"nsRbh","./kernels/BroadcastArgs":"hsxhy","./kernels/Cast":"7u1bU","./kernels/Ceil":"jQtlI","./kernels/ClipByValue":"1v34G","./kernels/Complex":"3zOos","./kernels/ComplexAbs":"2dAj4","./kernels/Concat":"lOCXc","./kernels/Conv2D":"eJWq5","./kernels/Conv2DBackpropFilter":"bKBpL","./kernels/Conv2DBackpropInput":"5rapU","./kernels/Conv3D":"j8BRE","./kernels/Conv3DBackpropFilterV2":"dNJCE","./kernels/Conv3DBackpropInputV2":"k11Sv","./kernels/Cos":"eTcSM","./kernels/Cosh":"dmuwg","./kernels/CropAndResize":"dF1gD","./kernels/Cumprod":"dTkdA","./kernels/Cumsum":"be0FU","./kernels/DenseBincount":"1Cvpk","./kernels/DepthToSpace":"2cZK3","./kernels/DepthwiseConv2dNative":"csjtT","./kernels/DepthwiseConv2dNativeBackpropFilter":"jpDYr","./kernels/DepthwiseConv2dNativeBackpropInput":"6afCV","./kernels/Diag":"9Tigc","./kernels/Dilation2D":"aYl3M","./kernels/Einsum":"9a4cr","./kernels/Elu":"jqCx8","./kernels/EluGrad":"aeCUF","./kernels/Equal":"6iWbL","./kernels/Erf":"1dtRL","./kernels/Exp":"kSaqw","./kernels/ExpandDims":"6l4Rf","./kernels/Expm1":"2xgQM","./kernels/FFT":"7QH0m","./kernels/Fill":"6vZGW","./kernels/FlipLeftRight":"1WuC5","./kernels/Floor":"hZsyB","./kernels/FloorDiv":"lFtmo","./kernels/FromPixels":"9ItVc","./kernels/FusedConv2D":"3HPmW","./kernels/FusedDepthwiseConv2D":"fVWLN","./kernels/GatherNd":"aSlIh","./kernels/GatherV2":"4dBGm","./kernels/Greater":"3wLuO","./kernels/GreaterEqual":"4Wunt","./kernels/Identity":"4GZPt","./kernels/IFFT":"1wLde","./kernels/Imag":"edc2Y","./kernels/IsFinite":"4Tbar","./kernels/IsInf":"acHvJ","./kernels/IsNaN":"86FtF","./kernels/LeakyRelu":"dWhuH","./kernels/Less":"7tjns","./kernels/LessEqual":"bHZeL","./kernels/LinSpace":"3eEez","./kernels/Log":"kmufp","./kernels/Log1p":"1x1xV","./kernels/LogicalAnd":"dFsxi","./kernels/LogicalNot":"82qaf","./kernels/LogicalOr":"2WeL3","./kernels/LRN":"8fQO3","./kernels/LRNGrad":"hKNPS","./kernels/Max":"1NJ4x","./kernels/Maximum":"iIAVk","./kernels/MaxPool":"dhN4J","./kernels/MaxPool3D":"8hzKq","./kernels/MaxPool3DGrad":"8Gc7C","./kernels/MaxPoolGrad":"kw4s4","./kernels/MaxPoolWithArgmax":"lVva0","./kernels/Mean":"39h70","./kernels/Min":"g7S8i","./kernels/Minimum":"eLBQM","./kernels/MirrorPad":"iQZhS","./kernels/Mod":"4N1d3","./kernels/Multinomial":"fAQmI","./kernels/Multiply":"hh4HM","./kernels/Neg":"3eYOV","./kernels/NonMaxSuppressionV3":"43R25","./kernels/NonMaxSuppressionV4":"8bdxe","./kernels/NonMaxSuppressionV5":"kHowT","./kernels/NotEqual":"9yxhk","./kernels/OneHot":"2QYeR","./kernels/OnesLike":"8Rqgk","./kernels/Pack":"ihnbO","./kernels/PadV2":"62aNS","./kernels/Pow":"3FhH3","./kernels/Prelu":"er5n7","./kernels/Prod":"13NdY","./kernels/RaggedGather":"4h7q8","./kernels/RaggedRange":"6SKe9","./kernels/RaggedTensorToTensor":"fANTV","./kernels/Range":"5XFt9","./kernels/Real":"4c1DV","./kernels/RealDiv":"ikoQ7","./kernels/Reciprocal":"7ozTa","./kernels/Relu":"2q4nb","./kernels/Relu6":"eDa64","./kernels/Reshape":"cgfGf","./kernels/ResizeBilinear":"4cHF7","./kernels/ResizeBilinearGrad":"fblDK","./kernels/ResizeNearestNeighbor":"Qj1lv","./kernels/ResizeNearestNeighborGrad":"46F3t","./kernels/Reverse":"huEsM","./kernels/RotateWithOffset":"h7iaU","./kernels/Round":"4L7ZM","./kernels/Rsqrt":"8EvOL","./kernels/ScatterNd":"fEQ1p","./kernels/SearchSorted":"lqrgd","./kernels/Select":"eA3E0","./kernels/Selu":"ioaz8","./kernels/Sigmoid":"dmjlN","./kernels/Sign":"7Flrc","./kernels/Sin":"a9NpT","./kernels/Sinh":"8qgS2","./kernels/Slice":"duMU0","./kernels/Softmax":"jU6YA","./kernels/Softplus":"9krRr","./kernels/SpaceToBatchND":"4D5QR","./kernels/SparseFillEmptyRows":"XBYqG","./kernels/SparseReshape":"5An6r","./kernels/SparseSegmentMean":"fQlid","./kernels/SparseSegmentSum":"aMvEj","./kernels/SparseToDense":"lqK1r","./kernels/SplitV":"965SM","./kernels/Sqrt":"i5QWi","./kernels/Square":"hPuFu","./kernels/SquaredDifference":"dImmu","./kernels/StaticRegexReplace":"aAhYI","./kernels/Step":"5KiFV","./kernels/StridedSlice":"7dqVR","./kernels/StringNGrams":"lWUSd","./kernels/StringSplit":"gRNB9","./kernels/StringToHashBucketFast":"4OZ9L","./kernels/Sub":"g9ySV","./kernels/Sum":"3Zq98","./kernels/Tan":"32aJ0","./kernels/Tanh":"gR8zr","./kernels/TensorScatterUpdate":"IUrLE","./kernels/Tile":"f9YW6","./kernels/TopK":"7TsVk","./kernels/Transform":"6eyWT","./kernels/Transpose":"jIlsI","./kernels/Unique":"3FbGA","./kernels/Unpack":"epp5O","./kernels/UnsortedSegmentSum":"hLfLI","./kernels/ZerosLike":"1gn2S"}],"5QpqN":[function(e,t,r){/** * @license * Copyright 2020 Google LLC. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the License); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an AS IS BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. * ============================================================================= */var n=e("@parcel/transformer-js/src/esmodule-helpers.js");n.defineInteropFlag(r),n.export(r,"_fusedMatMul",()=>o),n.export(r,"_fusedMatMulConfig",()=>l);var s=e("@tensorflow/tfjs-core"),a=e("./BatchMatMul_impl");function o(e){let{inputs:t,backend:r,attrs:n}=e,{a:s,b:o,bias:l,preluActivationWeights:i}=t,{transposeA:u,transposeB:p,activation:c,leakyreluAlpha:d}=n;return(0,a.batchMatMulImpl)({a:s,b:o,transposeA:u,transposeB:p,backend:r,bias:l,preluActivationWeights:i,leakyreluAlpha:d,activation:c})}let l={kernelName:s._FusedMatMul,backendName:"webgl",kernelFunc:o}},{"@tensorflow/tfjs-core":"2nuhV","./BatchMatMul_impl":"ioYKN","@parcel/transformer-js/src/esmodule-helpers.js":"9pCYc"}],ioYKN:[function(e,t,r){/** * @license * Copyright 2020 Google LLC. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. * ============================================================================= */var n=e("@parcel/transformer-js/src/esmodule-helpers.js");n.defineInteropFlag(r),n.export(r,"MATMUL_SHARED_DIM_THRESHOLD",()=>c),n.export(r,"batchMatMulImpl",()=>d);var s=e("@tensorflow/tfjs-core"),a=e("../kernel_utils/kernel_funcs_utils"),o=e("../mulmat_packed_gpu"),l=e("./Multiply"),i=e("./Reshape"),u=e("./Sum"),p=e("./Transpose");let c=1e3;function d({a:e,b:t,transposeA:r,transposeB:n,backend:d,bias:f=null,preluActivationWeights:h=null,leakyreluAlpha:m=0,activation:g=null}){let x;let v=e.shape.length,y=t.shape.length,b=r?e.shape[v-2]:e.shape[v-1],_=n?t.shape[y-1]:t.shape[y-2],k=r?e.shape[v-1]:e.shape[v-2],j=n?t.shape[y-2]:t.shape[y-1],I=e.shape.slice(0,-2),C=t.shape.slice(0,-2),w=(0,s.util).sizeFromShape(I),T=(0,s.util).sizeFromShape(C),S=(0,s.broadcast_util).assertAndGetBroadcastShape(e.shape.slice(0,-2),t.shape.slice(0,-2)).concat([k,j]);(0,s.util).assert(b===_,()=>`Error in matMul: inner shapes (${b}) and (${_}) of Tensors with shapes ${e.shape} and ${t.shape} and transposeA=${r} and transposeB=${n} must match.`);let N=r?[w,b,k]:[w,k,b],E=n?[T,j,_]:[T,_,j],F=(0,i.reshape)({inputs:{x:e},backend:d,attrs:{shape:N}}),R=(0,i.reshape)({inputs:{x:t},backend:d,attrs:{shape:E}}),A=[F,R],P=Math.max(w,T),D=r?F.shape[1]:F.shape[2],$=null!=f,M=null!=h,O="leakyrelu"===g,V=null!=g?(0,a.mapActivationToShaderProgram)(g,!0):null,B=$||M||O||null!=V;if((1===k||1===j)&&D>c&&!1===B){let e=F,t=R;r&&(e=(0,p.transpose)({inputs:{x:F},backend:d,attrs:{perm:[0,2,1]}}),A.push(e)),n&&(t=(0,p.transpose)({inputs:{x:R},backend:d,attrs:{perm:[0,2,1]}}),A.push(t));let s=1!==j,a=1===j,o=e;s&&(o=(0,i.reshape)({inputs:{x:e},backend:d,attrs:{shape:[P,D,1]}}),A.push(o));let c=t;a&&(c=(0,i.reshape)({inputs:{x:t},backend:d,attrs:{shape:[P,1,D]}}),A.push(c));let f=(0,l.multiply)({inputs:{a:o,b:c},backend:d});x=(0,u.sum)({inputs:{x:f},backend:d,attrs:{axis:1===j?2:1,keepDims:!0}}),A.push(f)}else{let a=(0,s.upcastType)(e.dtype,t.dtype),l=new o.MatMulPackedProgram(N,E,[P,k,j],r,n,$,V,M,O),i=[F,R];if(null!=f&&i.push(f),M&&i.push(h),O){let e=d.makeTensorInfo([],"float32",(0,s.util).createScalarValue(m,"float32"));i.push(e),A.push(e)}x=d.runWebGLProgram(l,i,a)}let L=(0,i.reshape)({inputs:{x:x},backend:d,attrs:{shape:S}});for(let e of(A.push(x),A))d.disposeIntermediateTensorInfo(e);return L}},{"@tensorflow/tfjs-core":"2nuhV","../kernel_utils/kernel_funcs_utils":"jMepo","../mulmat_packed_gpu":"aI4G0","./Multiply":"hh4HM","./Reshape":"cgfGf","./Sum":"3Zq98","./Transpose":"jIlsI","@parcel/transformer-js/src/esmodule-helpers.js":"9pCYc"}],jMepo:[function(e,t,r){/** * @license * Copyright 2020 Google LLC. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. * ============================================================================= */var n=e("@parcel/transformer-js/src/esmodule-helpers.js");n.defineInteropFlag(r),n.export(r,"CHECK_NAN_SNIPPET_UNARY",()=>d),n.export(r,"unaryKernelFunc",()=>f),n.export(r,"binaryKernelFunc",()=>h),n.export(r,"mapActivationToShaderProgram",()=>m);var s=e("@tensorflow/tfjs-core"),a=e("../binaryop_gpu"),o=e("../binaryop_packed_gpu"),l=e("../kernels/Complex"),i=e("../kernels/LeakyRelu"),u=e("../kernels/Prelu"),p=e("../unaryop_gpu"),c=e("../unaryop_packed_gpu");let d="if (isnan(x)) return x;";function f({opSnippet:e,packedOpSnippet:t,cpuKernelImpl:r,dtype:n}){return({inputs:a,backend:o})=>{let l;let{x:i}=a,u=n||i.dtype;if(o.shouldExecuteOnCPU([i])&&null!=r){let e=r(o.texData.get(i.dataId).values,u);return o.makeTensorInfo(i.shape,u,e)}return l=(0,s.env)().getBool("WEBGL_PACK_UNARY_OPERATIONS")&&null!=t?new c.UnaryOpPackedProgram(i.shape,t):new p.UnaryOpProgram(i.shape,e),o.runWebGLProgram(l,[i],u)}}function h({opSnippet:e,packedOpSnippet:t,checkOutOfBounds:r=!1,supportsComplex:n=!1,cpuKernelImpl:i,dtype:u}){return({inputs:p,backend:c})=>{let d;let{a:f,b:h}=p;if(n&&"complex64"===f.dtype){let t=c.texData.get(f.dataId),r=c.texData.get(h.dataId),[n,o]=[[t.complexTensorInfos.real,r.complexTensorInfos.real],[t.complexTensorInfos.imag,r.complexTensorInfos.imag]].map(t=>{let[r,n]=t,o={dataId:r.dataId,dtype:r.dtype,shape:f.shape},l={dataId:n.dataId,dtype:n.dtype,shape:h.shape},i=new a.BinaryOpProgram(e,f.shape,h.shape);return c.runWebGLProgram(i,[o,l],(0,s.upcastType)(r.dtype,n.dtype))}),i=(0,l.complex)({inputs:{real:n,imag:o},backend:c});return c.disposeIntermediateTensorInfo(n),c.disposeIntermediateTensorInfo(o),i}let m=u||(0,s.upcastType)(f.dtype,h.dtype);if(("string"===f.dtype||"string"===h.dtype||c.shouldExecuteOnCPU([f,h]))&&null!=i){let e=c.texData.get(f.dataId).values,t=c.texData.get(h.dataId).values,r="string"===f.dtype?(0,s.backend_util).fromUint8ToStringArray(e):e,n="string"===f.dtype?(0,s.backend_util).fromUint8ToStringArray(t):t,[a,o]=i(f.shape,h.shape,r,n,m),l=c.makeTensorInfo(o,m);return c.texData.get(l.dataId).values=a,l}return d=(0,s.env)().getBool("WEBGL_PACK_BINARY_OPERATIONS")&&null!=t?new o.BinaryOpPackedProgram(t,f.shape,h.shape,r):new a.BinaryOpProgram(e,f.shape,h.shape),c.runWebGLProgram(d,[f,h],m)}}function m(e,t=!1){if("linear"===e)return t?c.LINEAR:p.LINEAR;if("relu"===e)return t?c.RELU:p.RELU;if("elu"===e)return t?c.ELU:p.ELU;if("relu6"===e)return t?c.RELU6:p.RELU6;if("prelu"===e)return t?u.PRELU_PACKED:u.PRELU;if("leakyrelu"===e)return t?i.LEAKYRELU_PACKED:i.LEAKYRELU;if("sigmoid"===e)return t?c.SIGMOID:p.SIGMOID;throw Error(`Activation ${e} has not been implemented for the WebGL backend.`)}},{"@tensorflow/tfjs-core":"2nuhV","../binaryop_gpu":"ilh7x","../binaryop_packed_gpu":"f1UiT","../kernels/Complex":"3zOos","../kernels/LeakyRelu":"dWhuH","../kernels/Prelu":"er5n7","../unaryop_gpu":"iNthQ","../unaryop_packed_gpu":"k4CIw","@parcel/transformer-js/src/esmodule-helpers.js":"9pCYc"}],ilh7x:[function(e,t,r){/** * @license * Copyright 2017 Google LLC. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. * ============================================================================= */var n=e("@parcel/transformer-js/src/esmodule-helpers.js");n.defineInteropFlag(r),n.export(r,"CHECK_NAN_SNIPPET",()=>o),n.export(r,"SQUARED_DIFFERENCE",()=>l),n.export(r,"BinaryOpProgram",()=>i);var s=e("@tensorflow/tfjs-core"),a=e("./gpgpu_math");let o=` if (isnan(a)) return a; if (isnan(b)) return b; `,l="return (a - b) * (a - b);";class i{constructor(e,t,r){this.variableNames=["A","B"],this.outputShape=(0,s.backend_util).assertAndGetBroadcastShape(t,r),this.enableShapeUniforms=(0,a.useShapeUniforms)(this.outputShape.length),this.userCode=` float binaryOperation(float a, float b) { ${e} } void main() { float a = getAAtOutCoords(); float b = getBAtOutCoords(); setOutput(binaryOperation(a, b)); } `}}},{"@tensorflow/tfjs-core":"2nuhV","./gpgpu_math":"f1P40","@parcel/transformer-js/src/esmodule-helpers.js":"9pCYc"}],f1UiT:[function(e,t,r){/** * @license * Copyright 2018 Google LLC. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. * ============================================================================= */var n=e("@parcel/transformer-js/src/esmodule-helpers.js");n.defineInteropFlag(r),n.export(r,"CHECK_NAN_SNIPPET_PACKED",()=>i),n.export(r,"ELU_DER",()=>u),n.export(r,"NOT_EQUAL",()=>p),n.export(r,"BinaryOpPackedProgram",()=>c);var s=e("@tensorflow/tfjs-core"),a=e("./gpgpu_math"),o=e("./packing_util"),l=e("./shader_compiler");let i=` 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; `,u=` vec4 bGTEZero = vec4(greaterThanEqual(b, vec4(0.))); return (bGTEZero * a) + ((vec4(1.0) - bGTEZero) * (a * (b + vec4(1.0)))); `,p=` return vec4(notEqual(a, b)); `;class c{constructor(e,t,r,n=!1){this.variableNames=["A","B"],this.supportsBroadcasting=!0,this.packedInputs=!0,this.packedOutput=!0,this.outputShape=(0,s.backend_util).assertAndGetBroadcastShape(t,r);let i=this.outputShape.length;this.enableShapeUniforms=(0,a.useShapeUniforms)(i);let u="";if(n){if(0===i||1===(0,s.util).sizeFromShape(this.outputShape))u=` result.y = 0.; result.z = 0.; result.w = 0.; `;else{let e=(0,l.getCoordsDataType)(i);if(u=` ${e} coords = getOutputCoords(); `,1===i)this.enableShapeUniforms?u+=` result.y = (coords + 1) >= outShape ? 0. : result.y; result.z = 0.; result.w = 0.; `:u+=` result.y = (coords + 1) >= ${this.outputShape[0]} ? 0. : result.y; result.z = 0.; result.w = 0.; `;else{let e=(0,o.getChannels)("coords",i);this.enableShapeUniforms?u+=` bool nextRowOutOfBounds = (${e[i-2]} + 1) >= outShape[${i} - 2]; bool nextColOutOfBounds = (${e[i-1]} + 1) >= outShape[${i} - 1]; result.y = nextColOutOfBounds ? 0. : result.y; result.z = nextRowOutOfBounds ? 0. : result.z; result.w = nextColOutOfBounds || nextRowOutOfBounds ? 0. : result.w; `:u+=` bool nextRowOutOfBounds = (${e[i-2]} + 1) >= ${this.outputShape[i-2]}; bool nextColOutOfBounds = (${e[i-1]} + 1) >= ${this.outputShape[i-1]}; result.y = nextColOutOfBounds ? 0. : result.y; result.z = nextRowOutOfBounds ? 0. : result.z; result.w = nextColOutOfBounds || nextRowOutOfBounds ? 0. : result.w; `}}}this.userCode=` vec4 binaryOperation(vec4 a, vec4 b) { ${e} } void main() { vec4 a = getAAtOutCoords(); vec4 b = getBAtOutCoords(); vec4 result = binaryOperation(a, b); ${u} setOutput(result); } `}}},{"@tensorflow/tfjs-core":"2nuhV","./gpgpu_math":"f1P40","./packing_util":"6V5sg","./shader_compiler":"3kYYB","@parcel/transformer-js/src/esmodule-helpers.js":"9pCYc"}],"3zOos":[function(e,t,r){/** * @license * Copyright 2020 Google LLC. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. * ============================================================================= */var n=e("@parcel/transformer-js/src/esmodule-helpers.js");n.defineInteropFlag(r),n.export(r,"complex",()=>o),n.export(r,"complexConfig",()=>l);var s=e("@tensorflow/tfjs-core"),a=e("./Identity");function o(e){let{inputs:t,backend:r}=e,{real:n,imag:s}=t,o=r.makeTensorInfo(n.shape,"complex64"),l=r.texData.get(o.dataId),i=(0,a.identity)({inputs:{x:n},backend:r}),u=(0,a.identity)({inputs:{x:s},backend:r});return l.complexTensorInfos={real:i,imag:u},o}let l={kernelName:s.Complex,backendName:"webgl",kernelFunc:o}},{"@tensorflow/tfjs-core":"2nuhV","./Identity":"4GZPt","@parcel/transformer-js/src/esmodule-helpers.js":"9pCYc"}],"4GZPt":[function(e,t,r){/** * @license * Copyright 2020 Google LLC. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. * ============================================================================= */var n=e("@parcel/transformer-js/src/esmodule-helpers.js");function s(e){let{inputs:t,backend:r}=e,{x:n}=t;return r.incRef(n.dataId),{dataId:n.dataId,shape:n.shape,dtype:n.dtype}}n.defineInteropFlag(r),n.export(r,"identity",()=>s),n.export(r,"identityConfig",()=>a);let a={kernelName:e("@tensorflow/tfjs-core").Identity,backendName:"webgl",kernelFunc:s}},{"@tensorflow/tfjs-core":"2nuhV","@parcel/transformer-js/src/esmodule-helpers.js":"9pCYc"}],dWhuH:[function(e,t,r){/** * @license * Copyright 2020 Google LLC. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. * ============================================================================= */var n=e("@parcel/transformer-js/src/esmodule-helpers.js");n.defineInteropFlag(r),n.export(r,"LEAKYRELU",()=>l),n.export(r,"LEAKYRELU_PACKED",()=>i),n.export(r,"leakyRelu",()=>u),n.export(r,"leakyReluConfig",()=>p);var s=e("@tensorflow/tfjs-core"),a=e("../binaryop_gpu"),o=e("../binaryop_packed_gpu");let l="return (a< 0.) ? b * a : a;",i=` vec4 aLessThanZero = vec4(lessThan(a, vec4(0.))); return (aLessThanZero * (b * a)) + ((vec4(1.0) - aLessThanZero) * a); `;function u(e){let{inputs:t,backend:r,attrs:n}=e,{x:u}=t,{alpha:p}=n,c=r.makeTensorInfo([],"float32",(0,s.util).createScalarValue(p,"float32")),d=(0,s.env)().getBool("WEBGL_PACK_BINARY_OPERATIONS")?new o.BinaryOpPackedProgram(i,u.shape,c.shape):new a.BinaryOpProgram(l,u.shape,c.shape),f=r.runWebGLProgram(d,[u,c],"float32");return r.disposeIntermediateTensorInfo(c),f}let p={kernelName:s.LeakyRelu,backendName:"webgl",kernelFunc:u}},{"@tensorflow/tfjs-core":"2nuhV","../binaryop_gpu":"ilh7x","../binaryop_packed_gpu":"f1UiT","@parcel/transformer-js/src/esmodule-helpers.js":"9pCYc"}],er5n7:[function(e,t,r){/** * @license * Copyright 2020 Google LLC. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. * ============================================================================= */var n=e("@parcel/transformer-js/src/esmodule-helpers.js");n.defineInteropFlag(r),n.export(r,"PRELU",()=>l),n.export(r,"PRELU_PACKED",()=>i),n.export(r,"prelu",()=>u),n.export(r,"preluConfig",()=>p);var s=e("@tensorflow/tfjs-core"),a=e("../binaryop_gpu"),o=e("../binaryop_packed_gpu");let l="return (a< 0.) ? b * a : a;",i=` vec4 aLessThanZero = vec4(lessThan(a, vec4(0.))); return (aLessThanZero * (b * a)) + ((vec4(1.0) - aLessThanZero) * a); `;function u(e){let{inputs:t,backend:r}=e,{x:n,alpha:u}=t,p=(0,s.env)().getBool("WEBGL_PACK_BINARY_OPERATIONS")?new o.BinaryOpPackedProgram(i,n.shape,u.shape):new a.BinaryOpProgram(l,n.shape,u.shape);return r.runWebGLProgram(p,[n,u],"float32")}let p={kernelName:s.Prelu,backendName:"webgl",kernelFunc:u}},{"@tensorflow/tfjs-core":"2nuhV","../binaryop_gpu":"ilh7x","../binaryop_packed_gpu":"f1UiT","@parcel/transformer-js/src/esmodule-helpers.js":"9pCYc"}],aI4G0:[function(e,t,r){/** * @license * Copyright 2018 Google LLC. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. * ============================================================================= */var n=e("@parcel/transformer-js/src/esmodule-helpers.js");n.defineInteropFlag(r),n.export(r,"MatMulPackedProgram",()=>a);var s=e("./gpgpu_math");class a{constructor(e,t,r,n=!1,a=!1,o=!1,l=null,i=!1,u=!1){this.variableNames=["matrixA","matrixB"],this.packedInputs=!0,this.packedOutput=!0,this.outputShape=r,this.enableShapeUniforms=(0,s.useShapeUniforms)(this.outputShape.length);let p=Math.ceil((n?e[1]:e[2])/2),c=n?["a.xxyy","a.zzww"]:["a.xxzz","a.yyww"],d=a?["b.xzxz","b.ywyw"]:["b.xyxy","b.zwzw"],f="",h="";l&&(f=i?`vec4 activation(vec4 a) { vec4 b = getPreluActivationWeightsAtOutCoords(); ${l} }`:u?`vec4 activation(vec4 a) { vec4 b = getLeakyreluAlphaAtOutCoords(); ${l} }`:`vec4 activation(vec4 x) { ${l} }`,h="result = activation(result);"),o&&this.variableNames.push("bias"),i&&this.variableNames.push("preluActivationWeights"),u&&this.variableNames.push("leakyreluAlpha");let m="rc.x",g="rc.x";e[0]c),n.export(r,"multiplyConfig",()=>d);var s=e("@tensorflow/tfjs-core"),a=e("../binaryop_complex_gpu"),o=e("../binaryop_gpu"),l=e("../binaryop_packed_gpu"),i=e("../kernel_utils/shared"),u=e("./Complex");let p="return a * b;";function c(e){let t;let{inputs:r,backend:n}=e,{a:c,b:d}=r,f=(0,s.backend_util).upcastType(c.dtype,d.dtype);if("complex64"===c.dtype){let e=n.texData.get(c.dataId),t=n.texData.get(d.dataId),r=new a.BinaryOpComplexProgram(a.COMPLEX_MULTIPLY.REAL,c.shape,d.shape),s=new a.BinaryOpComplexProgram(a.COMPLEX_MULTIPLY.IMAG,c.shape,d.shape),o=[{dataId:e.complexTensorInfos.real.dataId,dtype:e.complexTensorInfos.real.dtype,shape:c.shape},{dataId:e.complexTensorInfos.imag.dataId,dtype:e.complexTensorInfos.imag.dtype,shape:c.shape},{dataId:t.complexTensorInfos.real.dataId,dtype:t.complexTensorInfos.real.dtype,shape:d.shape},{dataId:t.complexTensorInfos.imag.dataId,dtype:t.complexTensorInfos.imag.dtype,shape:d.shape}],l=n.runWebGLProgram(r,o,"float32"),i=n.runWebGLProgram(s,o,"float32"),p=(0,u.complex)({inputs:{real:l,imag:i},backend:n});return n.disposeIntermediateTensorInfo(l),n.disposeIntermediateTensorInfo(i),p}if(n.shouldExecuteOnCPU([c,d])){let e=n.texData.get(c.dataId),t=n.texData.get(d.dataId),[r,s]=(0,i.multiplyImplCPU)(c.shape,d.shape,e.values,t.values,f),a=n.makeTensorInfo(s,f);return n.texData.get(a.dataId).values=r,a}return t=(0,s.env)().getBool("WEBGL_PACK_BINARY_OPERATIONS")?new l.BinaryOpPackedProgram(p,c.shape,d.shape):new o.BinaryOpProgram(p,c.shape,d.shape),n.runWebGLProgram(t,[c,d],f)}let d={kernelName:s.Multiply,backendName:"webgl",kernelFunc:c}},{"@tensorflow/tfjs-core":"2nuhV","../binaryop_complex_gpu":"2afkq","../binaryop_gpu":"ilh7x","../binaryop_packed_gpu":"f1UiT","../kernel_utils/shared":"01kMd","./Complex":"3zOos","@parcel/transformer-js/src/esmodule-helpers.js":"9pCYc"}],"2afkq":[function(e,t,r){/** * @license * Copyright 2018 Google LLC. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. * ============================================================================= */var n=e("@parcel/transformer-js/src/esmodule-helpers.js");n.defineInteropFlag(r),n.export(r,"COMPLEX_MULTIPLY",()=>a),n.export(r,"BinaryOpComplexProgram",()=>o);var s=e("@tensorflow/tfjs-core");let a={REAL:"return areal * breal - aimag * bimag;",IMAG:"return areal * bimag + aimag * breal;"};class o{constructor(e,t,r){this.variableNames=["AReal","AImag","BReal","BImag"],this.outputShape=(0,s.backend_util).assertAndGetBroadcastShape(t,r),this.userCode=` float binaryOpComplex( float areal, float aimag, float breal, float bimag) { ${e} } void main() { float areal = getARealAtOutCoords(); float aimag = getAImagAtOutCoords(); float breal = getBRealAtOutCoords(); float bimag = getBImagAtOutCoords(); setOutput(binaryOpComplex(areal, aimag, breal, bimag)); } `}}},{"@tensorflow/tfjs-core":"2nuhV","@parcel/transformer-js/src/esmodule-helpers.js":"9pCYc"}],cgfGf:[function(e,t,r){/** * @license * Copyright 2020 Google LLC. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. * ============================================================================= */var n=e("@parcel/transformer-js/src/esmodule-helpers.js");n.defineInteropFlag(r),n.export(r,"reshape",()=>l),n.export(r,"reshapeConfig",()=>i);var s=e("@tensorflow/tfjs-core"),a=e("../kernel_utils/reshape"),o=e("../webgl_util");function l(e){let{inputs:t,backend:r,attrs:n}=e,{x:l}=t,{shape:i}=n,u=(0,s.util).sizeFromShape(l.shape),p=(0,s.util).inferFromImplicitShape(i,u),c=(0,s.util).sizeFromShape(p);(0,s.util).assert(u===c,()=>`The new shape (${p}) has ${c} elements and the old shape (${l.shape}) has ${u} elements. The new shape and old shape must have the same number of elements.`);let d=r.texData.get(l.dataId);return!d.isPacked||(0,o.isReshapeFree)(l.shape,p)||null!==d.texture&&(0,o.isReshapeFree)(d.shape,p)?(r.incRef(l.dataId),{dataId:l.dataId,shape:p,dtype:l.dtype}):(0,a.packedReshape)(l,p,r)}let i={kernelName:s.Reshape,backendName:"webgl",kernelFunc:l}},{"@tensorflow/tfjs-core":"2nuhV","../kernel_utils/reshape":"4NJ1q","../webgl_util":"90dxa","@parcel/transformer-js/src/esmodule-helpers.js":"9pCYc"}],"4NJ1q":[function(e,t,r){/** * @license * Copyright 2020 Google LLC. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. * ============================================================================= */var n=e("@parcel/transformer-js/src/esmodule-helpers.js");n.defineInteropFlag(r),n.export(r,"packedReshape",()=>o);var s=e("../reshape_packed_gpu"),a=e("../webgl_util");function o(e,t,r){let n=[(0,a.getBatchDim)(e.shape),...(0,a.getRowsCols)(e.shape)],o={dtype:e.dtype,shape:n,dataId:e.dataId},l=[(0,a.getBatchDim)(t),...(0,a.getRowsCols)(t)],i=new s.ReshapePackedProgram(l,n),u=r.runWebGLProgram(i,[o],e.dtype,[n],!0);return{dataId:u.dataId,shape:t,dtype:u.dtype}}},{"../reshape_packed_gpu":"eOdKZ","../webgl_util":"90dxa","@parcel/transformer-js/src/esmodule-helpers.js":"9pCYc"}],"3Zq98":[function(e,t,r){/** * @license * Copyright 2020 Google LLC. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. * ============================================================================= */var n=e("@parcel/transformer-js/src/esmodule-helpers.js");n.defineInteropFlag(r),n.export(r,"sum",()=>o),n.export(r,"sumConfig",()=>l);var s=e("@tensorflow/tfjs-core"),a=e("./Sum_impl");function o(e){let{inputs:t,backend:r,attrs:n}=e,{x:s}=t,{axis:o,keepDims:l}=n;return(0,a.sumImpl)(s,o,l,r)}let l={kernelName:s.Sum,backendName:"webgl",kernelFunc:o}},{"@tensorflow/tfjs-core":"2nuhV","./Sum_impl":"l7w5X","@parcel/transformer-js/src/esmodule-helpers.js":"9pCYc"}],l7w5X:[function(e,t,r){/** * @license * Copyright 2020 Google LLC. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. * ============================================================================= */var n=e("@parcel/transformer-js/src/esmodule-helpers.js");n.defineInteropFlag(r),n.export(r,"sumImpl",()=>i);var s=e("@tensorflow/tfjs-core"),a=e("../kernel_utils/reduce"),o=e("./Reshape"),l=e("./Transpose_impl");function i(e,t,r,n){let i=e.shape.length,u=(0,s.util).parseAxisParam(t,e.shape),p=u,c=(0,s.backend_util).getAxesPermutation(p,i),d=null!=c,f=e;d&&(f=(0,l.transposeImpl)(e,c,n),p=(0,s.backend_util).getInnerMostAxes(p.length,i)),(0,s.backend_util).assertAxesAreInnerMostDims("sum",p,i);let[h,m]=(0,s.backend_util).computeOutAndReduceShapes(f.shape,p),g=h;r&&(g=(0,s.backend_util).expandShapeToKeepDim(h,u));let x=(0,s.util).sizeFromShape(m),v=(0,s.util).sizeFromShape(e.shape),y=(0,o.reshape)({inputs:{x:f},attrs:{shape:[v/x,x]},backend:n}),b=(0,s.sumOutType)(e.dtype),_=(0,a.reduce)(y,b,"sum",n),k=(0,o.reshape)({inputs:{x:_},attrs:{shape:g},backend:n});return n.disposeIntermediateTensorInfo(y),n.disposeIntermediateTensorInfo(_),d&&n.disposeIntermediateTensorInfo(f),k}},{"@tensorflow/tfjs-core":"2nuhV","../kernel_utils/reduce":"dRjVh","./Reshape":"cgfGf","./Transpose_impl":"6sweA","@parcel/transformer-js/src/esmodule-helpers.js":"9pCYc"}],dRjVh:[function(e,t,r){/** * @license * Copyright 2020 Google LLC. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. * ============================================================================= */var n=e("@parcel/transformer-js/src/esmodule-helpers.js");n.defineInteropFlag(r),n.export(r,"reduce",()=>l);var s=e("@tensorflow/tfjs-core"),a=e("../mean_gpu"),o=e("../reduce_gpu");function l(e,t,r,n){let l=function(e){let t=[];for(;0===t.length||1!==t[t.length-1].outSize;){let r=t.length?t[t.length-1].outSize:e[1],n=(0,s.backend_util).computeOptimalWindowSize(r);t.push({inSize:r,windowSize:n,outSize:Math.ceil(r/n)})}return t}(e.shape),i=e;for(let s=0;sa);var s=e("@tensorflow/tfjs-core");class a{constructor(e,t){this.variableNames=["x"];let{windowSize:r,batchSize:n,inSize:a,outSize:o}=e;this.outputShape=[n,o];let l=4*Math.floor(r/4),i=r%4,u="sumValue += dot(values, ones);";if(null!=t){let e=1/t;u=`sumValue += dot(values * ${(0,s.util).isInt(e)?e.toPrecision(2):e}, ones);`}let p="";a%r>0&&(p=` if (inIdx< 0 || inIdx >= ${a}) { return 0.0; } `),this.userCode=` const vec4 ones = vec4(1.0, 1.0, 1.0, 1.0); float getValue(int batch, int inIdx) { ${p} return getX(batch, inIdx); } void main() { ivec2 coords = getOutputCoords(); int batch = coords[0]; int outIdx = coords[1]; int inOffset = outIdx * ${r}; float sumValue = 0.0; for (int i = 0; i< ${l}; i += 4) { int inIdx = inOffset + i; vec4 values = vec4( getValue(batch, inIdx), getValue(batch, inIdx + 1), getValue(batch, inIdx + 2), getValue(batch, inIdx + 3) ); ${u} } int inIdx = inOffset + ${l}; if (${1===i}) { vec4 values = vec4(getValue(batch, inIdx), 0.0, 0.0, 0.0); ${u} } else if (${2===i}) { vec4 values = vec4( getValue(batch, inIdx), getValue(batch, inIdx + 1), 0.0, 0.0); ${u} } else if (${3===i}) { vec4 values = vec4( getValue(batch, inIdx), getValue(batch, inIdx + 1), getValue(batch, inIdx + 2), 0.0); ${u} } setOutput(sumValue); } `}}},{"@tensorflow/tfjs-core":"2nuhV","@parcel/transformer-js/src/esmodule-helpers.js":"9pCYc"}],"7tMQR":[function(e,t,r){/** * @license * Copyright 2017 Google LLC. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. * ============================================================================= */var n=e("@parcel/transformer-js/src/esmodule-helpers.js");n.defineInteropFlag(r),n.export(r,"ReduceProgram",()=>s);class s{constructor(e,t){this.variableNames=["x"];let{windowSize:r,batchSize:n,inSize:s,outSize:a}=e;this.outputShape=[n,a];let o="0.0",l="";"prod"===t?o="1.0":"min"===t?(o="1.0 / 1e-20",l="min"):"max"===t&&(o="-1.0 / 1e-20",l="max");let i=`${t}(${t}(${t}(minMaxValue[0], minMaxValue[1]), minMaxValue[2]), minMaxValue[3])`;"sum"===t?i="sumValue":"prod"===t?i="prodValue":"all"===t?i="allValue":"any"===t&&(i="anyValue");let u=4*Math.floor(r/4),p=r%4,c=` if (${"sum"===t}) { sumValue += dot(values, ones); } else if (${"prod"===t}) { vec2 tmp = vec2(values[0], values[1]) * vec2(values[2], values[3]); prodValue *= tmp[0] * tmp[1]; } else { minMaxValue = ${l}(values, minMaxValue); if (${"min"===t} || ${"max"===t}) { minMaxValue = ${l}(values, minMaxValue); bvec4 isNaN = isnan(values); if (isNaN.r || isNaN.g || isNaN.b || isNaN.a) { minMaxValue = vec4(NAN); } } } `,d="vec4";"all"===t?(o="1.0",c=` bool reducedAllValue = all(values); float floatedReducedAllValue = float(reducedAllValue); allValue = float(allValue >= 1.0 && floatedReducedAllValue >= 1.0); `,d="bvec4"):"any"===t&&(o="0.0",c=` bool reducedAnyValue = any(values); float floatedReducedAnyValue = float(reducedAnyValue); anyValue = float(anyValue >= 1.0 || floatedReducedAnyValue >= 1.0); `,d="bvec4");let f="";s%r>0&&(f=` if (inIdx< 0 || inIdx >= ${s}) { return initializationValue; } `),this.userCode=` const float initializationValue = ${o}; const vec4 ones = vec4(1.0, 1.0, 1.0, 1.0); float getValue(int batch, int inIdx) { ${f} return getX(batch, inIdx); } void main() { ivec2 coords = getOutputCoords(); int batch = coords[0]; int outIdx = coords[1]; int inOffset = outIdx * ${r}; vec4 minMaxValue = vec4(${o}); float prodValue = 1.0; float sumValue = 0.0; float allValue = 1.0; float anyValue = 0.0; for (int i = 0; i< ${u}; i += 4) { int inIdx = inOffset + i; ${d} values = ${d}( getValue(batch, inIdx), getValue(batch, inIdx + 1), getValue(batch, inIdx + 2), getValue(batch, inIdx + 3) ); ${c} } int inIdx = inOffset + ${u}; if (${1===p}) { ${d} values = ${d}( getValue(batch, inIdx), initializationValue, initializationValue, initializationValue ); ${c} } else if (${2===p}) { ${d} values = ${d}( getValue(batch, inIdx), getValue(batch, inIdx + 1), initializationValue, initializationValue ); ${c} } else if (${3===p}) { ${d} values = ${d}( getValue(batch, inIdx), getValue(batch, inIdx + 1), getValue(batch, inIdx + 2), initializationValue ); ${c} } setOutput(${i}); } `}}},{"@parcel/transformer-js/src/esmodule-helpers.js":"9pCYc"}],"6sweA":[function(e,t,r){/** * @license * Copyright 2020 Google LLC. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. * ============================================================================= */var n=e("@parcel/transformer-js/src/esmodule-helpers.js");n.defineInteropFlag(r),n.export(r,"transposeImpl",()=>i),n.export(r,"transposeImplCPU",()=>a.transposeImplCPU);var s=e("@tensorflow/tfjs-core"),a=e("../kernel_utils/shared"),o=e("../transpose_gpu"),l=e("../transpose_packed_gpu");function i(e,t,r){let n=(0,s.env)().getBool("WEBGL_PACK_ARRAY_OPERATIONS")?new l.TransposePackedProgram(e.shape,t):new o.TransposeProgram(e.shape,t);return r.runWebGLProgram(n,[e],e.dtype)}},{"@tensorflow/tfjs-core":"2nuhV","../kernel_utils/shared":"01kMd","../transpose_gpu":"dU4Dc","../transpose_packed_gpu":"lyFtz","@parcel/transformer-js/src/esmodule-helpers.js":"9pCYc"}],dU4Dc:[function(e,t,r){/** * @license * Copyright 2017 Google LLC. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. * ============================================================================= */var n=e("@parcel/transformer-js/src/esmodule-helpers.js");n.defineInteropFlag(r),n.export(r,"TransposeProgram",()=>a);var s=e("./shader_compiler");class a{constructor(e,t){this.variableNames=["A"];let r=Array(e.length);for(let n=0;n6)throw Error(`Transpose for rank ${t} is not yet supported`);let r=["resRC.x","resRC.y","resRC.z","resRC.w","resRC.u","resRC.v"],n=Array(t);for(let t=0;to);var s=e("./packing_util"),a=e("./shader_compiler");class o{constructor(e,t){this.variableNames=["A"],this.packedInputs=!0,this.packedOutput=!0;let r=Array(e.length);for(let n=0;n6)throw Error(`Packed transpose for rank ${this.rank} is not yet supported.`);let n=(0,a.getCoordsDataType)(this.rank),o=(0,s.getVecChannels)("rc",this.rank),l=Array(this.rank);for(let e=0;eo),n.export(r,"transposeConfig",()=>l);var s=e("@tensorflow/tfjs-core"),a=e("./Transpose_impl");function o(e){let t;let{inputs:r,backend:n,attrs:s}=e,{x:o}=r,{perm:l}=s,i=Array(o.shape.length);for(let e=0;eu),n.export(r,"absConfig",()=>p);var s=e("@tensorflow/tfjs-core"),a=e("../kernel_utils/shared"),o=e("../unaryop_gpu"),l=e("../unaryop_packed_gpu");let i="return abs(x);";function u(e){let t;let{inputs:r,backend:n}=e,{x:u}=r;if(n.shouldExecuteOnCPU([u])&&"complex64"!==u.dtype){let e=n.texData.get(u.dataId),t=(0,a.simpleAbsImplCPU)(e.values);return n.makeTensorInfo(u.shape,u.dtype,t)}return t=(0,s.env)().getBool("WEBGL_PACK_UNARY_OPERATIONS")?new l.UnaryOpPackedProgram(u.shape,i):new o.UnaryOpProgram(u.shape,i),n.runWebGLProgram(t,[u],u.dtype)}let p={kernelName:s.Abs,backendName:"webgl",kernelFunc:u}},{"@tensorflow/tfjs-core":"2nuhV","../kernel_utils/shared":"01kMd","../unaryop_gpu":"iNthQ","../unaryop_packed_gpu":"k4CIw","@parcel/transformer-js/src/esmodule-helpers.js":"9pCYc"}],"5iMxV":[function(e,t,r){/** * @license * Copyright 2020 Google LLC. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. * ============================================================================= */var n=e("@parcel/transformer-js/src/esmodule-helpers.js");n.defineInteropFlag(r),n.export(r,"acos",()=>l),n.export(r,"acosConfig",()=>i);var s=e("@tensorflow/tfjs-core"),a=e("../kernel_utils/kernel_funcs_utils");let o=e("../unaryop_gpu").CHECK_NAN_SNIPPET+` if (abs(x) > 1.) { return NAN; } return acos(x); `,l=(0,a.unaryKernelFunc)({opSnippet:o}),i={kernelName:s.Acos,backendName:"webgl",kernelFunc:l}},{"@tensorflow/tfjs-core":"2nuhV","../kernel_utils/kernel_funcs_utils":"jMepo","../unaryop_gpu":"iNthQ","@parcel/transformer-js/src/esmodule-helpers.js":"9pCYc"}],hyXtP:[function(e,t,r){/** * @license * Copyright 2020 Google LLC. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. * ============================================================================= */var n=e("@parcel/transformer-js/src/esmodule-helpers.js");n.defineInteropFlag(r),n.export(r,"acosh",()=>l),n.export(r,"acoshConfig",()=>i);var s=e("@tensorflow/tfjs-core"),a=e("../kernel_utils/kernel_funcs_utils");let o=e("../unaryop_gpu").CHECK_NAN_SNIPPET+` if (x< 1.0) return NAN; return log(x + sqrt(x * x - 1.0));`,l=(0,a.unaryKernelFunc)({opSnippet:o}),i={kernelName:s.Acosh,backendName:"webgl",kernelFunc:l}},{"@tensorflow/tfjs-core":"2nuhV","../kernel_utils/kernel_funcs_utils":"jMepo","../unaryop_gpu":"iNthQ","@parcel/transformer-js/src/esmodule-helpers.js":"9pCYc"}],haSsN:[function(e,t,r){/** * @license * Copyright 2020 Google LLC. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. * ============================================================================= */var n=e("@parcel/transformer-js/src/esmodule-helpers.js");n.defineInteropFlag(r),n.export(r,"addKernelFunc",()=>i),n.export(r,"addConfig",()=>u);var s=e("@tensorflow/tfjs-core"),a=e("../kernel_utils/kernel_funcs_utils"),o=e("../kernel_utils/shared");let l="return a + b;",i=(0,a.binaryKernelFunc)({opSnippet:l,packedOpSnippet:l,supportsComplex:!0,cpuKernelImpl:o.addImplCPU}),u={kernelName:s.Add,backendName:"webgl",kernelFunc:i}},{"@tensorflow/tfjs-core":"2nuhV","../kernel_utils/kernel_funcs_utils":"jMepo","../kernel_utils/shared":"01kMd","@parcel/transformer-js/src/esmodule-helpers.js":"9pCYc"}],"03klX":[function(e,t,r){/** * @license * Copyright 2020 Google LLC. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. * ============================================================================= */var n=e("@parcel/transformer-js/src/esmodule-helpers.js");n.defineInteropFlag(r),n.export(r,"addN",()=>i),n.export(r,"addNConfig",()=>u);var s=e("@tensorflow/tfjs-core"),a=e("../addn_gpu"),o=e("../addn_packed_gpu"),l=e("./Identity");function i(e){let{inputs:t,backend:r}=e;if(1===t.length)return(0,l.identity)({inputs:{x:t[0]},backend:r});if(t.length>(0,s.env)().getNumber("WEBGL_MAX_TEXTURES_IN_SHADER")){let e=Math.floor(t.length/2),n=i({inputs:t.slice(0,e),backend:r}),s=i({inputs:t.slice(e),backend:r});return i({inputs:[n,s],backend:r})}let n=t.map(e=>e.dtype).reduce((e,t)=>(0,s.upcastType)(e,t)),u=t.map(e=>e.shape),p=(0,s.env)().getBool("WEBGL_PACK")?new o.AddNPackedProgram(t[0].shape,u):new a.AddNProgram(t[0].shape,u);return r.runWebGLProgram(p,t,n)}let u={kernelName:s.AddN,backendName:"webgl",kernelFunc:i}},{"@tensorflow/tfjs-core":"2nuhV","../addn_gpu":"8kJCc","../addn_packed_gpu":"3uMvC","./Identity":"4GZPt","@parcel/transformer-js/src/esmodule-helpers.js":"9pCYc"}],"8kJCc":[function(e,t,r){/** * @license * Copyright 2019 Google LLC. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. * ============================================================================= */var n=e("@parcel/transformer-js/src/esmodule-helpers.js");n.defineInteropFlag(r),n.export(r,"AddNProgram",()=>s);class s{constructor(e,t){this.outputShape=[],this.outputShape=e,this.variableNames=t.map((e,t)=>`T${t}`);let r=[];this.variableNames.forEach(e=>{r.push(`float v${e} = get${e}AtOutCoords();`)});let n=this.variableNames.map(e=>`v${e}`).join(" + ");this.userCode=` void main() { ${r.join("\n ")} float result = ${n}; setOutput(result); } `}}},{"@parcel/transformer-js/src/esmodule-helpers.js":"9pCYc"}],"3uMvC":[function(e,t,r){/** * @license * Copyright 2019 Google LLC. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. * ============================================================================= */var n=e("@parcel/transformer-js/src/esmodule-helpers.js");n.defineInteropFlag(r),n.export(r,"AddNPackedProgram",()=>s);class s{constructor(e,t){this.outputShape=[],this.packedInputs=!0,this.packedOutput=!0,this.outputShape=e,this.variableNames=t.map((e,t)=>`T${t}`);let r=[];this.variableNames.forEach(e=>{r.push(`vec4 v${e} = get${e}AtOutCoords();`)});let n=this.variableNames.map(e=>`v${e}`).join(" + ");this.userCode=` void main() { ${r.join("\n ")} vec4 result = ${n}; setOutput(result); } `}}},{"@parcel/transformer-js/src/esmodule-helpers.js":"9pCYc"}],"2VNFE":[function(e,t,r){/** * @license * Copyright 2020 Google LLC. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. * ============================================================================= */var n=e("@parcel/transformer-js/src/esmodule-helpers.js");n.defineInteropFlag(r),n.export(r,"all",()=>i),n.export(r,"allConfig",()=>u);var s=e("@tensorflow/tfjs-core"),a=e("../kernel_utils/reduce"),o=e("./Reshape"),l=e("./Transpose");function i(e){let t;let{inputs:r,backend:n,attrs:i}=e,{x:u}=r,{axis:p,keepDims:c}=i,d=u.shape.length,f=(0,s.util).parseAxisParam(p,u.shape),h=f,m=(0,s.backend_util).getAxesPermutation(h,d),g=u;null!=m&&(g=(0,l.transpose)({inputs:{x:u},backend:n,attrs:{perm:m}}),h=(0,s.backend_util).getInnerMostAxes(h.length,d)),(0,s.backend_util).assertAxesAreInnerMostDims("all",h,d);let[x,v]=(0,s.backend_util).computeOutAndReduceShapes(g.shape,h),y=(0,s.util).sizeFromShape(v),b=(0,o.reshape)({inputs:{x:g},backend:n,attrs:{shape:[-1,y]}}),_=(0,a.reduce)(b,b.dtype,"all",n);if(c){let e=(0,s.backend_util).expandShapeToKeepDim(x,f);t=(0,o.reshape)({inputs:{x:_},backend:n,attrs:{shape:e}})}else t=(0,o.reshape)({inputs:{x:_},backend:n,attrs:{shape:x}});return n.disposeIntermediateTensorInfo(b),n.disposeIntermediateTensorInfo(_),null!=m&&n.disposeIntermediateTensorInfo(g),t}let u={kernelName:s.All,backendName:"webgl",kernelFunc:i}},{"@tensorflow/tfjs-core":"2nuhV","../kernel_utils/reduce":"dRjVh","./Reshape":"cgfGf","./Transpose":"jIlsI","@parcel/transformer-js/src/esmodule-helpers.js":"9pCYc"}],"8sdvF":[function(e,t,r){/** * @license * Copyright 2020 Google LLC. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. * ============================================================================= */var n=e("@parcel/transformer-js/src/esmodule-helpers.js");n.defineInteropFlag(r),n.export(r,"any",()=>i),n.export(r,"anyConfig",()=>u);var s=e("@tensorflow/tfjs-core"),a=e("../kernel_utils/reduce"),o=e("./Reshape"),l=e("./Transpose");function i(e){let t;let{inputs:r,backend:n,attrs:i}=e,{x:u}=r,{axis:p,keepDims:c}=i,d=u.shape.length,f=(0,s.util).parseAxisParam(p,u.shape),h=f,m=(0,s.backend_util).getAxesPermutation(h,d),g=u;null!=m&&(g=(0,l.transpose)({inputs:{x:u},backend:n,attrs:{perm:m}}),h=(0,s.backend_util).getInnerMostAxes(h.length,d)),(0,s.backend_util).assertAxesAreInnerMostDims("any",h,d);let[x,v]=(0,s.backend_util).computeOutAndReduceShapes(g.shape,h),y=(0,s.util).sizeFromShape(v),b=(0,o.reshape)({inputs:{x:g},backend:n,attrs:{shape:[-1,y]}}),_=(0,a.reduce)(b,b.dtype,"any",n);if(c){let e=(0,s.backend_util).expandShapeToKeepDim(x,f);t=(0,o.reshape)({inputs:{x:_},backend:n,attrs:{shape:e}})}else t=(0,o.reshape)({inputs:{x:_},backend:n,attrs:{shape:x}});return n.disposeIntermediateTensorInfo(b),n.disposeIntermediateTensorInfo(_),null!=m&&n.disposeIntermediateTensorInfo(g),t}let u={kernelName:s.Any,backendName:"webgl",kernelFunc:i}},{"@tensorflow/tfjs-core":"2nuhV","../kernel_utils/reduce":"dRjVh","./Reshape":"cgfGf","./Transpose":"jIlsI","@parcel/transformer-js/src/esmodule-helpers.js":"9pCYc"}],hdwg5:[function(e,t,r){/** * @license * Copyright 2020 Google LLC. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. * ============================================================================= */var n=e("@parcel/transformer-js/src/esmodule-helpers.js");n.defineInteropFlag(r),n.export(r,"argMax",()=>l),n.export(r,"argMaxConfig",()=>i);var s=e("@tensorflow/tfjs-core"),a=e("../kernel_utils/arg_min_max"),o=e("./Transpose");function l(e){let{inputs:t,backend:r,attrs:n}=e,{x:l}=t,{axis:i}=n,u=(0,s.util).parseAxisParam(i,l.shape),p=(0,s.backend_util).getAxesPermutation(u,l.shape.length),c=l,d=[];null!=p&&(d.push(c=(0,o.transpose)({inputs:{x:l},backend:r,attrs:{perm:p}})),u=(0,s.backend_util).getInnerMostAxes(u.length,c.shape.length)),(0,s.backend_util).assertAxesAreInnerMostDims("argMax",[u[0]],c.shape.length);let f=(0,a.argMinMaxReduce)(r,c,u[0],"max");return d.forEach(e=>r.disposeIntermediateTensorInfo(e)),f}let i={kernelName:s.ArgMax,backendName:"webgl",kernelFunc:l}},{"@tensorflow/tfjs-core":"2nuhV","../kernel_utils/arg_min_max":"dUGPm","./Transpose":"jIlsI","@parcel/transformer-js/src/esmodule-helpers.js":"9pCYc"}],dUGPm:[function(e,t,r){/** * @license * Copyright 2020 Google LLC. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. * ============================================================================= */var n=e("@parcel/transformer-js/src/esmodule-helpers.js");n.defineInteropFlag(r),n.export(r,"argMinMaxReduce",()=>i);var s=e("@tensorflow/tfjs-core"),a=e("../argminmax_gpu"),o=e("../argminmax_packed_gpu"),l=e("../kernels/Reshape");function i(e,t,r,n){let i=[r];if((0,s.backend_util).assertAxesAreInnerMostDims("arg"+n.charAt(0).toUpperCase()+n.slice(1),i,t.shape.length),!(0,s.env)().getBool("WEBGL_PACK_REDUCE")||t.shape.length<=2){let r=[],o=e.texData.get(t.dataId),u=null!==o&&o.isPacked,p=t;u&&r.push(p=e.unpackTensor(t));let[c,d]=(0,s.backend_util).computeOutAndReduceShapes(p.shape,i),f=(0,s.util).sizeFromShape(d),h=(0,l.reshape)({inputs:{x:p},backend:e,attrs:{shape:[-1,f]}});r.push(h);let m=function e(t,r,n,o=null){let l=r.shape[0],i=r.shape[1];null!=o&&(l=o.shape[0],i=o.shape[1]);let u=(0,s.backend_util).computeOptimalWindowSize(i),p={windowSize:u,inSize:i,batchSize:l,outSize:Math.ceil(i/u)},c=new a.ArgMinMaxProgram(p,n,null==o),d=[r];null!=o&&d.push(o);let f=t.runWebGLProgram(c,d,"int32");if(1===f.shape[1])return f;let h=e(t,r,n,f);return t.disposeIntermediateTensorInfo(f),h}(e,h,n);r.push(m);let g=(0,l.reshape)({inputs:{x:m},backend:e,attrs:{shape:c}});return r.forEach(t=>e.disposeIntermediateTensorInfo(t)),g}return function e(t,r,n,a=null){let l=null!=a?a.shape:r.shape,i=l[l.length-1],u=(0,s.backend_util).computeOptimalWindowSize(i),p=new o.ArgMinMaxPackedProgram(l,u,n,null==a),c=null==a?[r]:[r,a],d=t.runWebGLProgram(p,c,"int32");if(d.shape.length===r.shape.length){let s=e(t,r,n,d);return t.disposeIntermediateTensorInfo(d),s}return d}(e,t,n)}},{"@tensorflow/tfjs-core":"2nuhV","../argminmax_gpu":"b5Wd1","../argminmax_packed_gpu":"043Da","../kernels/Reshape":"cgfGf","@parcel/transformer-js/src/esmodule-helpers.js":"9pCYc"}],b5Wd1:[function(e,t,r){/** * @license * Copyright 2017 Google LLC. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. * ============================================================================= */var n=e("@parcel/transformer-js/src/esmodule-helpers.js");n.defineInteropFlag(r),n.export(r,"ArgMinMaxProgram",()=>s);class s{constructor(e,t,r){this.variableNames=["A"];let{windowSize:n,batchSize:s,outSize:a}=e;r||this.variableNames.push("bestIndicesA"),this.outputShape=[s,a],this.userCode=` void main() { ivec2 coords = getOutputCoords(); int batch = coords[0]; int outIdx = coords[1]; int inOffset = outIdx * ${n}; int bestIndex = inOffset; float bestValue = getA(batch, bestIndex); for (int i = 0; i< ${n}; i++) { int inIdx = ${r?"inOffset + i;":"round(getBestIndicesA(batch, inOffset + i));"}; float candidate = getA(batch, inIdx); if (candidate ${"max"===t?">":"<"} bestValue) { bestValue = candidate; bestIndex = inIdx; } } setOutput(float(bestIndex)); } `}}},{"@parcel/transformer-js/src/esmodule-helpers.js":"9pCYc"}],"043Da":[function(e,t,r){/** * @license * Copyright 2019 Google LLC. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. * ============================================================================= */var n=e("@parcel/transformer-js/src/esmodule-helpers.js");n.defineInteropFlag(r),n.export(r,"ArgMinMaxPackedProgram",()=>l);var s=e("@tensorflow/tfjs-core"),a=e("./packing_util"),o=e("./shader_compiler");class l{constructor(e,t,r,n){let l,i;this.variableNames=["A"],this.packedInputs=!0,this.packedOutput=!0,(0,s.util).assert(e.length>2,()=>`Packed arg${r.charAt(0).toUpperCase()+r.slice(1)} supports only inputs with rank above 2.`);let u=Math.ceil(e[e.length-1]/t);this.outputShape=e.slice(0,-1),u>1&&this.outputShape.push(u),n||this.variableNames.push("bestIndicesA");let p=this.outputShape,c=p.length,d=(0,o.getCoordsDataType)(c),f=(0,a.getChannels)("coords",c);if(1===u){i=c+1;let e=(0,o.getCoordsDataType)(i);l=` ${e} sourceLocR = ${e}(${f.join()}, 0); ++${f[c-1]}; ${e} sourceLocG = ${e}(${f.join()}, 0); ++${f[c-2]}; ${e} sourceLocA = ${e}(${f.join()}, 0); --${f[c-1]}; ${e} sourceLocB = ${e}(${f.join()}, 0); --${f[c-2]};`}else i=c,l=` ${d} sourceLocR = coords; ++${f[c-1]}; ${d} sourceLocG = coords; ++${f[c-2]}; ${d} sourceLocA = coords; --${f[c-1]}; ${d} sourceLocB = coords; --${f[c-2]};`;let h=["x","y","z","w","u","v"].slice(0,i),m="."+h[i-1],g=h.map(e=>"int "+e),x=(0,a.getChannels)("sourceLocR",i-1).concat("inIdx.r"),v=(0,a.getChannels)("sourceLocG",i-1).concat("inIdx.g"),y=(0,a.getChannels)("sourceLocB",i-1).concat("inIdx.b"),b=(0,a.getChannels)("sourceLocA",i-1).concat("inIdx.a"),_="max"===r?"greaterThan":"lessThan",k=n?"":` inIdx = round(vec4(getBestIndicesAChannel(${x.join()}), getBestIndicesAChannel(${v.join()}), getBestIndicesAChannel(${y.join()}), getBestIndicesAChannel(${b.join()})));`,j=`vec4( getAChannel(${x.join()}), hasNextCol ? getAChannel(${v.join()}) : 0., hasNextRow ? getAChannel(${y.join()}) : 0., hasNextRow && hasNextCol ? getAChannel(${b.join()}) : 0.)`,I=n?"":` float getBestIndicesAChannel(${g.join()}) { return getChannel(getBestIndicesA(${h.join()}), vec2(${h.slice(-2).join()})); }`;this.userCode=` float getAChannel(${g.join()}) { return getChannel(getA(${h.join()}), vec2(${h.slice(-2).join()})); } ${I} void main() { ${d} coords = getOutputCoords(); bool hasNextCol = ${f[c-1]}< ${p[c-1]-1}; bool hasNextRow = ${f[c-2]} < ${p[c-2]-1}; ${l} ivec4 srcIdx = ivec4(sourceLocR${m}, sourceLocG${m}, sourceLocB${m}, sourceLocA${m}) * ${t}; ivec4 inIdx = srcIdx; vec4 bestIndex = vec4(inIdx); vec4 bestValue = ${j}; for (int i = 0; i < ${t}; i++) { inIdx = srcIdx; ${k} vec4 candidate = ${j}; bvec4 nan = isnan(candidate); bvec4 replace = bvec4( vec4(${_}(candidate, bestValue)) * (vec4(1.0) - vec4(nan))); bestValue = vec4(replace.x ? candidate.x : bestValue.x, replace.y ? candidate.y : bestValue.y, replace.z ? candidate.z : bestValue.z, replace.w ? candidate.w : bestValue.w); bestIndex = mix(bestIndex, vec4(inIdx), vec4(replace)); srcIdx++; } setOutput(bestIndex); } `}}},{"@tensorflow/tfjs-core":"2nuhV","./packing_util":"6V5sg","./shader_compiler":"3kYYB","@parcel/transformer-js/src/esmodule-helpers.js":"9pCYc"}],fh1Sp:[function(e,t,r){/** * @license * Copyright 2020 Google LLC. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. * ============================================================================= */var n=e("@parcel/transformer-js/src/esmodule-helpers.js");n.defineInteropFlag(r),n.export(r,"argMin",()=>l),n.export(r,"argMinConfig",()=>i);var s=e("@tensorflow/tfjs-core"),a=e("../kernel_utils/arg_min_max"),o=e("./Transpose");function l(e){let{inputs:t,backend:r,attrs:n}=e,{x:l}=t,{axis:i}=n,u=(0,s.util).parseAxisParam(i,l.shape),p=(0,s.backend_util).getAxesPermutation(u,l.shape.length),c=l,d=[];null!=p&&(d.push(c=(0,o.transpose)({inputs:{x:l},backend:r,attrs:{perm:p}})),u=(0,s.backend_util).getInnerMostAxes(u.length,c.shape.length)),(0,s.backend_util).assertAxesAreInnerMostDims("argMin",[u[0]],c.shape.length);let f=(0,a.argMinMaxReduce)(r,c,u[0],"min");return d.forEach(e=>r.disposeIntermediateTensorInfo(e)),f}let i={kernelName:s.ArgMin,backendName:"webgl",kernelFunc:l}},{"@tensorflow/tfjs-core":"2nuhV","../kernel_utils/arg_min_max":"dUGPm","./Transpose":"jIlsI","@parcel/transformer-js/src/esmodule-helpers.js":"9pCYc"}],"8DDqZ":[function(e,t,r){/** * @license * Copyright 2020 Google LLC. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. * ============================================================================= */var n=e("@parcel/transformer-js/src/esmodule-helpers.js");n.defineInteropFlag(r),n.export(r,"asin",()=>l),n.export(r,"asinConfig",()=>i);var s=e("@tensorflow/tfjs-core"),a=e("../kernel_utils/kernel_funcs_utils");let o=e("../unaryop_gpu").CHECK_NAN_SNIPPET+` if (abs(x) > 1.) { return NAN; } return asin(x); `,l=(0,a.unaryKernelFunc)({opSnippet:o}),i={kernelName:s.Asin,backendName:"webgl",kernelFunc:l}},{"@tensorflow/tfjs-core":"2nuhV","../kernel_utils/kernel_funcs_utils":"jMepo","../unaryop_gpu":"iNthQ","@parcel/transformer-js/src/esmodule-helpers.js":"9pCYc"}],hflRY:[function(e,t,r){/** * @license * Copyright 2020 Google LLC. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. * ============================================================================= */var n=e("@parcel/transformer-js/src/esmodule-helpers.js");n.defineInteropFlag(r),n.export(r,"asinh",()=>l),n.export(r,"asinhConfig",()=>i);var s=e("@tensorflow/tfjs-core"),a=e("../kernel_utils/kernel_funcs_utils");let o=e("../unaryop_gpu").CHECK_NAN_SNIPPET+"return log(x + sqrt(x * x + 1.0));",l=(0,a.unaryKernelFunc)({opSnippet:o}),i={kernelName:s.Asinh,backendName:"webgl",kernelFunc:l}},{"@tensorflow/tfjs-core":"2nuhV","../kernel_utils/kernel_funcs_utils":"jMepo","../unaryop_gpu":"iNthQ","@parcel/transformer-js/src/esmodule-helpers.js":"9pCYc"}],"9DplV":[function(e,t,r){/** * @license * Copyright 2020 Google LLC. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. * ============================================================================= */var n=e("@parcel/transformer-js/src/esmodule-helpers.js");n.defineInteropFlag(r),n.export(r,"atan",()=>l),n.export(r,"atanConfig",()=>i);var s=e("@tensorflow/tfjs-core"),a=e("../kernel_utils/kernel_funcs_utils");let o=e("../unaryop_gpu").CHECK_NAN_SNIPPET+` return atan(x); `,l=(0,a.unaryKernelFunc)({opSnippet:o}),i={kernelName:s.Atan,backendName:"webgl",kernelFunc:l}},{"@tensorflow/tfjs-core":"2nuhV","../kernel_utils/kernel_funcs_utils":"jMepo","../unaryop_gpu":"iNthQ","@parcel/transformer-js/src/esmodule-helpers.js":"9pCYc"}],"5Uvfw":[function(e,t,r){/** * @license * Copyright 2020 Google LLC. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. * ============================================================================= */var n=e("@parcel/transformer-js/src/esmodule-helpers.js");n.defineInteropFlag(r),n.export(r,"atan2",()=>p),n.export(r,"atan2Config",()=>c);var s=e("@tensorflow/tfjs-core"),a=e("../binaryop_gpu"),o=e("../binaryop_packed_gpu"),l=e("../kernel_utils/kernel_funcs_utils");let i=a.CHECK_NAN_SNIPPET+` return atan(a, b); `,u=` 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); `+o.CHECK_NAN_SNIPPET_PACKED+` return result; `,p=(0,l.binaryKernelFunc)({opSnippet:i,packedOpSnippet:u}),c={kernelName:s.Atan2,backendName:"webgl",kernelFunc:p}},{"@tensorflow/tfjs-core":"2nuhV","../binaryop_gpu":"ilh7x","../binaryop_packed_gpu":"f1UiT","../kernel_utils/kernel_funcs_utils":"jMepo","@parcel/transformer-js/src/esmodule-helpers.js":"9pCYc"}],"1WtgM":[function(e,t,r){/** * @license * Copyright 2020 Google LLC. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. * ============================================================================= */var n=e("@parcel/transformer-js/src/esmodule-helpers.js");n.defineInteropFlag(r),n.export(r,"atanh",()=>l),n.export(r,"atanhConfig",()=>i);var s=e("@tensorflow/tfjs-core"),a=e("../kernel_utils/kernel_funcs_utils");let o=e("../unaryop_gpu").CHECK_NAN_SNIPPET+` if ((x< -1.0) || (x >1.0)) return NAN; return (log(1.0 + x) - log(1.0 - x)) / 2.0;`,l=(0,a.unaryKernelFunc)({opSnippet:o}),i={kernelName:s.Atanh,backendName:"webgl",kernelFunc:l}},{"@tensorflow/tfjs-core":"2nuhV","../kernel_utils/kernel_funcs_utils":"jMepo","../unaryop_gpu":"iNthQ","@parcel/transformer-js/src/esmodule-helpers.js":"9pCYc"}],Y3t4M:[function(e,t,r){/** * @license * Copyright 2020 Google LLC. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. * ============================================================================= */var n=e("@parcel/transformer-js/src/esmodule-helpers.js");n.defineInteropFlag(r),n.export(r,"avgPool",()=>i),n.export(r,"avgPoolConfig",()=>u);var s=e("@tensorflow/tfjs-core"),a=e("../pool_gpu"),o=e("../webgl_util"),l=e("./Identity");function i(e){let{inputs:t,backend:r,attrs:n}=e,{x:i}=t;(0,o.assertNotComplex)(i,"avgPool");let{filterSize:u,strides:p,pad:c,dimRoundingMode:d}=n;(0,s.util).assert((0,s.backend_util).eitherStridesOrDilationsAreOne(p,1),()=>`Error in avgPool: Either strides or dilations must be 1. Got strides ${p} and dilations '1'`);let f=(0,s.backend_util).computePool2DInfo(i.shape,u,p,1,c,d);if(1===f.filterWidth&&1===f.filterHeight&&(0,s.util).arraysEqual(f.inShape,f.outShape))return(0,l.identity)({inputs:{x:i},backend:r});let h=new a.Pool2DProgram(f,"avg",!1);return r.runWebGLProgram(h,[i],"float32")}let u={kernelName:s.AvgPool,backendName:"webgl",kernelFunc:i}},{"@tensorflow/tfjs-core":"2nuhV","../pool_gpu":"awkae","../webgl_util":"90dxa","./Identity":"4GZPt","@parcel/transformer-js/src/esmodule-helpers.js":"9pCYc"}],awkae:[function(e,t,r){/** * @license * Copyright 2017 Google LLC. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. * ============================================================================= */var n=e("@parcel/transformer-js/src/esmodule-helpers.js");n.defineInteropFlag(r),n.export(r,"Pool2DProgram",()=>s),n.export(r,"Pool3DProgram",()=>a);class s{constructor(e,t,r,n=!1,s=!1){if(this.variableNames=["x"],"avg"===t&&r)throw Error("Cannot compute positions for average pool.");let a=e.filterWidth,o=e.strideHeight,l=e.strideWidth,i=e.dilationHeight,u=e.dilationWidth,p=e.effectiveFilterHeight,c=e.effectiveFilterWidth,d=e.padInfo.top,f=e.padInfo.left;this.outputShape=e.outShape;let h="avg"===t,m=`((batch * ${e.inHeight} + xR) * ${e.inWidth} + xC) * ${e.inChannels} + d`,g=`(xR * ${e.inWidth} + xC) * ${e.inChannels} + d`,x="0.0";if(h||(x="-1.0 / 1e-20"),r){this.userCode=` const ivec2 strides = ivec2(${o}, ${l}); const ivec2 pads = ivec2(${d}, ${f}); void main() { ivec4 coords = getOutputCoords(); int batch = coords[0]; int d = coords[3]; ivec2 xRCCorner = coords.yz * strides - pads; int xRCorner = xRCCorner.x; int xCCorner = xRCCorner.y; // max/min x(?, ?, d) to get y(yR, yC, d). // ? = to be determined float minMaxValue = 0.0; float minMaxValueFound = 0.0; int minMaxPosition = 0; float avgValue = 0.0; for (int wR = 0; wR< ${p}; wR += ${i}) { int xR = xRCorner + wR; if (xR < 0 || xR >= ${e.inHeight}) { continue; } for (int wC = 0; wC< ${c}; wC += ${u}) { int xC = xCCorner + wC; if (xC < 0 || xC >= ${e.inWidth}) { continue; } float value = getX(batch, xR, xC, d); // If a min / max value has already been found, use it. If not, // use the current value. float currMinMaxValue = mix( value, minMaxValue, minMaxValueFound); if (value >= currMinMaxValue) { minMaxValue = value; minMaxValueFound = 1.0; minMaxPosition = ${n?s?m:g:`wR * ${c} + wC`}; } } } setOutput(float(minMaxPosition)); } `;return}let v=`${t}(${t}(${t}(minMaxValue[0], minMaxValue[1]), minMaxValue[2]), minMaxValue[3])`;"avg"===t&&(v="avgValue / max(count, 1.0)");let y=4*Math.floor(a/4),b=a%4,_=` if (${h}) { avgValue += dot(values, ones); } else { minMaxValue = max(values, minMaxValue); } `;this.userCode=` const ivec2 strides = ivec2(${o}, ${l}); const ivec2 pads = ivec2(${d}, ${f}); const float initializationValue = ${x}; const vec4 ones = vec4(1.0, 1.0, 1.0, 1.0); float count = 0.0; float getValue(int batch, int xR, int xC, int d) { if (xC< 0 || xC >= ${e.inWidth}) { return initializationValue; } count += 1.0; return getX(batch, xR, xC, d); } void main() { ivec4 coords = getOutputCoords(); int batch = coords[0]; int d = coords[3]; ivec2 xRCCorner = coords.yz * strides - pads; int xRCorner = xRCCorner.x; int xCCorner = xRCCorner.y; // max/min x(?, ?, d) to get y(yR, yC, d). // ? = to be determined vec4 minMaxValue = vec4(${x}); float avgValue = 0.0; count = 0.0; for (int wR = 0; wR< ${p}; wR += ${i}) { int xR = xRCorner + wR; if (xR < 0 || xR >= ${e.inHeight}) { continue; } for (int wC = 0; wC< ${y}; wC += 4) { int xC = xCCorner + wC * ${u}; vec4 values = vec4( getValue(batch, xR, xC, d), getValue(batch, xR, xC + ${u}, d), getValue(batch, xR, xC + 2 * ${u}, d), getValue(batch, xR, xC + 3 * ${u}, d) ); ${_} } int xC = xCCorner + ${y}; if (${1===b}) { vec4 values = vec4( getValue(batch, xR, xC, d), initializationValue, initializationValue, initializationValue ); ${_} } else if (${2===b}) { vec4 values = vec4( getValue(batch, xR, xC, d), getValue(batch, xR, xC + ${u}, d), initializationValue, initializationValue ); ${_} } else if (${3===b}) { vec4 values = vec4( getValue(batch, xR, xC, d), getValue(batch, xR, xC + ${u}, d), getValue(batch, xR, xC + 2 * ${u}, d), initializationValue ); ${_} } } setOutput(${v}); } `}}class a{constructor(e,t,r,n=!1,s=!1){if(this.variableNames=["x"],"avg"===t&&r)throw Error("Cannot compute positions for average pool.");let a=e.filterWidth,o=e.strideDepth,l=e.strideHeight,i=e.strideWidth,u=e.dilationDepth,p=e.dilationHeight,c=e.dilationWidth,d=e.effectiveFilterDepth,f=e.effectiveFilterHeight,h=e.effectiveFilterWidth,m=e.padInfo.front,g=e.padInfo.top,x=e.padInfo.left;this.outputShape=e.outShape;let v="avg"===t,y="0.0";if(v||(y="-1.0 / 1e-20"),r){this.userCode=` const ivec3 strides = ivec3(${o}, ${l}, ${i}); const ivec3 pads = ivec3(${m}, ${g}, ${x}); void main() { ivec5 coords = getOutputCoords(); int batch = coords.x; int ch = coords.u; ivec3 xCorner = ivec3(coords.y, coords.z, coords.w) * strides - pads; int xDCorner = xCorner.x; int xRCorner = xCorner.y; int xCCorner = xCorner.z; // max/min x(?, ?, ?, ch) to get y(yD, yR, yC, ch). // ? = to be determined float minMaxValue = 0.0; float minMaxValueFound = 0.0; int minMaxPosition = 0; for (int wD = 0; wD < ${d}; wD += ${u}) { int xD = xDCorner + wD; if (xD < 0 || xD >= ${e.inDepth}) { continue; } for (int wR = 0; wR< ${f}; wR += ${p}) { int xR = xRCorner + wR; if (xR < 0 || xR >= ${e.inHeight}) { continue; } for (int wC = 0; wC< ${h}; wC += ${c}) { int xC = xCCorner + wC; if (xC < 0 || xC >= ${e.inWidth}) { continue; } float value = getX(batch, xD, xR, xC, ch); // If a min / max value has already been found, use it. If not, // use the current value. float currMinMaxValue = mix( value, minMaxValue, minMaxValueFound); if (value >= currMinMaxValue) { minMaxValue = value; minMaxValueFound = 1.0; 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`}; } } } } setOutput(float(minMaxPosition)); } `;return}let b=`${t}(${t}(${t}(minMaxValue[0], minMaxValue[1]), minMaxValue[2]), minMaxValue[3])`;"avg"===t&&(b="avgValue / max(count, 1.0)");let _=4*Math.floor(a/4),k=a%4,j=` if (${v}) { avgValue += dot(values, ones); } else { minMaxValue = max(values, minMaxValue); } `;this.userCode=` const ivec3 strides = ivec3(${o}, ${l}, ${i}); const ivec3 pads = ivec3(${m}, ${g}, ${x}); const float initializationValue = ${y}; const vec4 ones = vec4(1.0, 1.0, 1.0, 1.0); float count = 0.0; float getValue(int batch, int xD, int xR, int xC, int ch) { if (xC< 0 || xC >= ${e.inWidth}) { return initializationValue; } count += 1.0; return getX(batch, xD, xR, xC, ch); } void main() { ivec5 coords = getOutputCoords(); int batch = coords.x; int ch = coords.u; ivec3 xCorner = ivec3(coords.y, coords.z, coords.w) * strides - pads; int xDCorner = xCorner.x; int xRCorner = xCorner.y; int xCCorner = xCorner.z; // max/min x(?, ?, ?, d) to get y(yD, yR, yC, ch). // ? = to be determined vec4 minMaxValue = vec4(${y}); float avgValue = 0.0; count = 0.0; for (int wD = 0; wD< ${d}; wD += ${u}) { int xD = xDCorner + wD; if (xD < 0 || xD >= ${e.inDepth}) { continue; } for (int wR = 0; wR< ${f}; wR += ${p}) { int xR = xRCorner + wR; if (xR < 0 || xR >= ${e.inHeight}) { continue; } for (int wC = 0; wC< ${_}; wC += 4) { int xC = xCCorner + wC * ${c}; vec4 values = vec4( getValue(batch, xD, xR, xC, ch), getValue(batch, xD, xR, xC + ${c}, ch), getValue(batch, xD, xR, xC + 2 * ${c}, ch), getValue(batch, xD, xR, xC + 3 * ${c}, ch) ); ${j} } int xC = xCCorner + ${_}; if (${1===k}) { vec4 values = vec4( getValue(batch, xD, xR, xC, ch), initializationValue, initializationValue, initializationValue ); ${j} } else if (${2===k}) { vec4 values = vec4( getValue(batch, xD, xR, xC, ch), getValue(batch, xD, xR, xC + ${c}, ch), initializationValue, initializationValue ); ${j} } else if (${3===k}) { vec4 values = vec4( getValue(batch, xD, xR, xC, ch), getValue(batch, xD, xR, xC + ${c}, ch), getValue(batch, xD, xR, xC + 2 * ${c}, ch), initializationValue ); ${j} } } } setOutput(${b}); } `}}},{"@parcel/transformer-js/src/esmodule-helpers.js":"9pCYc"}],ckdCF:[function(e,t,r){/** * @license * Copyright 2020 Google LLC. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. * ============================================================================= */var n=e("@parcel/transformer-js/src/esmodule-helpers.js");n.defineInteropFlag(r),n.export(r,"avgPool3D",()=>o),n.export(r,"avgPool3DConfig",()=>l);var s=e("@tensorflow/tfjs-core"),a=e("../pool_gpu");function o(e){let{inputs:t,backend:r,attrs:n}=e,{x:o}=t,{filterSize:l,strides:i,pad:u,dimRoundingMode:p,dataFormat:c}=n,d=(0,s.backend_util).computePool3DInfo(o.shape,l,i,[1,1,1],u,p,c),f=new a.Pool3DProgram(d,"avg",!1);return r.runWebGLProgram(f,[o],"float32")}let l={kernelName:s.AvgPool3D,backendName:"webgl",kernelFunc:o}},{"@tensorflow/tfjs-core":"2nuhV","../pool_gpu":"awkae","@parcel/transformer-js/src/esmodule-helpers.js":"9pCYc"}],d31lO:[function(e,t,r){/** * @license * Copyright 2020 Google LLC. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. * ============================================================================= */var n=e("@parcel/transformer-js/src/esmodule-helpers.js");n.defineInteropFlag(r),n.export(r,"avgPool3DGrad",()=>o),n.export(r,"avgPool3DGradConfig",()=>l);var s=e("@tensorflow/tfjs-core"),a=e("../avg_pool_backprop_gpu");function o(e){let{inputs:t,backend:r,attrs:n}=e,{dy:o,input:l}=t,{filterSize:i,strides:u,pad:p,dimRoundingMode:c}=n,d=(0,s.backend_util).computePool3DInfo(l.shape,i,u,[1,1,1],p,c),f=new a.AvgPool3DBackpropProgram(d);return r.runWebGLProgram(f,[o],l.dtype)}let l={kernelName:s.AvgPool3DGrad,backendName:"webgl",kernelFunc:o}},{"@tensorflow/tfjs-core":"2nuhV","../avg_pool_backprop_gpu":"59WcT","@parcel/transformer-js/src/esmodule-helpers.js":"9pCYc"}],"59WcT":[function(e,t,r){/** * @license * Copyright 2017 Google LLC. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. * ============================================================================= */var n=e("@parcel/transformer-js/src/esmodule-helpers.js");n.defineInteropFlag(r),n.export(r,"AvgPool2DBackpropProgram",()=>s),n.export(r,"AvgPool3DBackpropProgram",()=>a);class s{constructor(e){this.variableNames=["dy"],this.outputShape=e.inShape;let t=e.filterHeight,r=e.filterWidth,n=e.strideHeight,s=e.strideWidth,a=e.dilationHeight,o=e.dilationWidth,l=e.effectiveFilterHeight,i=e.effectiveFilterWidth,u=l-1-e.padInfo.top,p=i-1-e.padInfo.left;this.userCode=` const ivec2 pads = ivec2(${u}, ${p}); const float avgMultiplier = float(${1/(t*r)}); void main() { ivec4 coords = getOutputCoords(); int b = coords[0]; int d = coords[3]; ivec2 dyRCCorner = coords.yz - pads; int dyRCorner = dyRCCorner.x; int dyCCorner = dyRCCorner.y; // Convolve dy(?, ?, d) with pos mask(:, :, d) to get dx(xR, xC, d). // ? = to be determined. : = across all values in that axis. float dotProd = 0.0; for (int wR = 0; wR< ${l}; wR += ${a}) { float dyR = float(dyRCorner + wR) / ${n}.0; if (dyR < 0.0 || dyR >= ${e.outHeight}.0 || fract(dyR) > 0.0) { continue; } int idyR = int(dyR); for (int wC = 0; wC< ${i}; wC+= ${o}) { float dyC = float(dyCCorner + wC) / ${s}.0; if (dyC < 0.0 || dyC >= ${e.outWidth}.0 || fract(dyC) > 0.0) { continue; } int idyC = int(dyC); float dyValue = getDy(b, idyR, idyC, d); dotProd += dyValue * avgMultiplier; } } setOutput(dotProd); } `}}class a{constructor(e){this.variableNames=["dy"],this.outputShape=e.inShape;let t=e.filterDepth,r=e.filterHeight,n=e.filterWidth,s=e.strideDepth,a=e.strideHeight,o=e.strideWidth,l=e.dilationDepth,i=e.dilationHeight,u=e.dilationWidth,p=e.effectiveFilterDepth,c=e.effectiveFilterHeight,d=e.effectiveFilterWidth,f=p-1-e.padInfo.front,h=c-1-e.padInfo.top,m=d-1-e.padInfo.left;this.userCode=` const ivec3 pads = ivec3(${f}, ${h}, ${m}); const float avgMultiplier = float(${1/(t*r*n)}); void main() { ivec5 coords = getOutputCoords(); int batch = coords.x; int ch = coords.u; ivec3 dyCorner = ivec3(coords.y, coords.z, coords.w) - pads; int dyDCorner = dyCorner.x; int dyRCorner = dyCorner.y; int dyCCorner = dyCorner.z; // Convolve dy(?, ?, ?, d) with pos mask(:, :, :, ch) to get // dx(xD, xR, xC, ch). // ? = to be determined. : = across all values in that axis. float dotProd = 0.0; for (int wD = 0; wD< ${p}; wD += ${l}) { float dyD = float(dyDCorner + wD) / ${s}.0; if (dyD < 0.0 || dyD >= ${e.outDepth}.0 || fract(dyD) > 0.0) { continue; } int idyD = int(dyD); for (int wR = 0; wR< ${c}; wR += ${i}) { float dyR = float(dyRCorner + wR) / ${a}.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 += ${u}) { float dyC = float(dyCCorner + wC) / ${o}.0; if (dyC < 0.0 || dyC >= ${e.outWidth}.0 || fract(dyC) > 0.0) { continue; } int idyC = int(dyC); float dyValue = getDy(batch, idyD, idyR, idyC, ch); dotProd += dyValue * avgMultiplier; } } } setOutput(dotProd); } `}}},{"@parcel/transformer-js/src/esmodule-helpers.js":"9pCYc"}],dtrwN:[function(e,t,r){/** * @license * Copyright 2020 Google LLC. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. * ============================================================================= */var n=e("@parcel/transformer-js/src/esmodule-helpers.js");n.defineInteropFlag(r),n.export(r,"avgPoolGrad",()=>l),n.export(r,"avgPoolGradConfig",()=>i);var s=e("@tensorflow/tfjs-core"),a=e("../avg_pool_backprop_gpu"),o=e("../webgl_util");function l(e){let{inputs:t,backend:r,attrs:n}=e,{dy:l,input:i}=t;(0,o.assertNotComplex)([l,i],"avgPoolGrad");let{filterSize:u,strides:p,pad:c}=n,d=(0,s.backend_util).computePool2DInfo(i.shape,u,p,1,c),f=new a.AvgPool2DBackpropProgram(d);return r.runWebGLProgram(f,[l],i.dtype)}let i={kernelName:s.AvgPoolGrad,backendName:"webgl",kernelFunc:l}},{"@tensorflow/tfjs-core":"2nuhV","../avg_pool_backprop_gpu":"59WcT","../webgl_util":"90dxa","@parcel/transformer-js/src/esmodule-helpers.js":"9pCYc"}],"9LPN8":[function(e,t,r){/** * @license * Copyright 2020 Google LLC. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. * ============================================================================= */var n=e("@parcel/transformer-js/src/esmodule-helpers.js");n.defineInteropFlag(r),n.export(r,"batchMatMul",()=>o),n.export(r,"batchMatMulConfig",()=>l);var s=e("@tensorflow/tfjs-core"),a=e("./BatchMatMul_impl");function o(e){let{inputs:t,backend:r,attrs:n}=e,{a:s,b:o}=t,{transposeA:l,transposeB:i}=n;return(0,a.batchMatMulImpl)({a:s,b:o,transposeA:l,transposeB:i,backend:r})}let l={kernelName:s.BatchMatMul,backendName:"webgl",kernelFunc:o}},{"@tensorflow/tfjs-core":"2nuhV","./BatchMatMul_impl":"ioYKN","@parcel/transformer-js/src/esmodule-helpers.js":"9pCYc"}],"5xrVt":[function(e,t,r){/** * @license * Copyright 2020 Google LLC. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. * ============================================================================= */var n=e("@parcel/transformer-js/src/esmodule-helpers.js");n.defineInteropFlag(r),n.export(r,"batchNorm",()=>l),n.export(r,"batchNormConfig",()=>i);var s=e("@tensorflow/tfjs-core"),a=e("../batchnorm_gpu"),o=e("../batchnorm_packed_gpu");let l=({inputs:e,backend:t,attrs:r})=>{let{x:n,mean:l,variance:i,offset:u,scale:p}=e;(0,s.util).assert(l.shape.length===i.shape.length,()=>"Batch normalization gradient requires mean and variance to have equal ranks."),(0,s.util).assert(null==u||l.shape.length===u.shape.length,()=>"Batch normalization gradient requires mean and offset to have equal ranks."),(0,s.util).assert(null==p||l.shape.length===p.shape.length,()=>"Batch normalization gradient requires mean and scale to have equal ranks.");let{varianceEpsilon:c}=r;null==c&&(c=.001);let d=[n,l,i],f=null;null!=u&&(f=u.shape,d.push(u));let h=null;null!=p&&(h=p.shape,d.push(p));let m=(0,s.env)().getBool("WEBGL_PACK_NORMALIZATION")?new o.BatchNormPackedProgram(n.shape,l.shape,i.shape,f,h,c):new a.BatchNormProgram(n.shape,l.shape,i.shape,f,h,c);return t.runWebGLProgram(m,d,d[0].dtype)},i={kernelName:s.FusedBatchNorm,backendName:"webgl",kernelFunc:l}},{"@tensorflow/tfjs-core":"2nuhV","../batchnorm_gpu":"3ZYdH","../batchnorm_packed_gpu":"fhKDz","@parcel/transformer-js/src/esmodule-helpers.js":"9pCYc"}],"3ZYdH":[function(e,t,r){/** * @license * Copyright 2017 Google LLC. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. * ============================================================================= */var n=e("@parcel/transformer-js/src/esmodule-helpers.js");n.defineInteropFlag(r),n.export(r,"BatchNormProgram",()=>a);var s=e("@tensorflow/tfjs-core");class a{constructor(e,t,r,n,a,o){this.outputShape=[],this.variableNames=["x","mean","variance"],(0,s.backend_util).assertAndGetBroadcastShape(e,t),(0,s.backend_util).assertAndGetBroadcastShape(e,r);let l="0.0";null!=n&&((0,s.backend_util).assertAndGetBroadcastShape(e,n),this.variableNames.push("offset"),l="getOffsetAtOutCoords()");let i="1.0";null!=a&&((0,s.backend_util).assertAndGetBroadcastShape(e,a),this.variableNames.push("scale"),i="getScaleAtOutCoords()"),this.outputShape=e,this.userCode=` void main() { float x = getXAtOutCoords(); float mean = getMeanAtOutCoords(); float variance = getVarianceAtOutCoords(); float offset = ${l}; float scale = ${i}; float inv = scale * inversesqrt(variance + float(${o})); setOutput(dot(vec3(x, -mean, offset), vec3(inv, inv, 1))); } `}}},{"@tensorflow/tfjs-core":"2nuhV","@parcel/transformer-js/src/esmodule-helpers.js":"9pCYc"}],fhKDz:[function(e,t,r){/** * @license * Copyright 2018 Google LLC. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. * ============================================================================= */var n=e("@parcel/transformer-js/src/esmodule-helpers.js");n.defineInteropFlag(r),n.export(r,"BatchNormPackedProgram",()=>a);var s=e("@tensorflow/tfjs-core");class a{constructor(e,t,r,n,a,o){this.packedInputs=!0,this.packedOutput=!0,this.variableNames=["x","mean","variance"],(0,s.backend_util).assertAndGetBroadcastShape(e,t),(0,s.backend_util).assertAndGetBroadcastShape(e,r);let l="vec4(0.0)";null!=n&&((0,s.backend_util).assertAndGetBroadcastShape(e,n),this.variableNames.push("offset"),l="getOffsetAtOutCoords()");let i="vec4(1.0)";null!=a&&((0,s.backend_util).assertAndGetBroadcastShape(e,a),this.variableNames.push("scale"),i="getScaleAtOutCoords()"),this.outputShape=e,this.userCode=` void main() { vec4 offset = ${l}; vec4 scale = ${i}; vec4 x = getXAtOutCoords(); vec4 mean = getMeanAtOutCoords(); vec4 variance = getVarianceAtOutCoords(); vec4 inv = scale * inversesqrt(variance + vec4(${o})); setOutput((x - mean) * inv + offset); } `}}},{"@tensorflow/tfjs-core":"2nuhV","@parcel/transformer-js/src/esmodule-helpers.js":"9pCYc"}],"61dz8":[function(e,t,r){/** * @license * Copyright 2020 Google LLC. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. * ============================================================================= */var n=e("@parcel/transformer-js/src/esmodule-helpers.js");n.defineInteropFlag(r),n.export(r,"batchToSpaceND",()=>i),n.export(r,"batchToSpaceNDConfig",()=>u);var s=e("@tensorflow/tfjs-core"),a=e("./Reshape"),o=e("./Slice"),l=e("./Transpose");let i=e=>{let{inputs:t,backend:r,attrs:n}=e,{x:i}=t,{blockShape:u,crops:p}=n;(0,s.util).assert(i.shape.length<=4,()=>"batchToSpaceND for rank > 4 with a WebGL backend not implemented yet");let c=u.reduce((e,t)=>e*t),d=(0,s.backend_util).getReshaped(i.shape,u,c),f=(0,s.backend_util).getPermuted(d.length,u.length),h=(0,s.backend_util).getReshapedPermuted(i.shape,u,c),m=(0,s.backend_util).getSliceBeginCoords(p,u.length),g=(0,s.backend_util).getSliceSize(h,p,u.length),x=[],v=(0,a.reshape)({inputs:{x:i},backend:r,attrs:{shape:d}}),y=(0,l.transpose)({inputs:{x:v},backend:r,attrs:{perm:f}}),b=(0,a.reshape)({inputs:{x:y},backend:r,attrs:{shape:h}}),_=(0,o.slice)({inputs:{x:b},backend:r,attrs:{begin:m,size:g}});return x.push(v),x.push(y),x.push(b),x.forEach(e=>r.disposeIntermediateTensorInfo(e)),_},u={kernelName:s.BatchToSpaceND,backendName:"webgl",kernelFunc:i}},{"@tensorflow/tfjs-core":"2nuhV","./Reshape":"cgfGf","./Slice":"duMU0","./Transpose":"jIlsI","@parcel/transformer-js/src/esmodule-helpers.js":"9pCYc"}],duMU0:[function(e,t,r){/** * @license * Copyright 2020 Google LLC. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. * ============================================================================= */var n=e("@parcel/transformer-js/src/esmodule-helpers.js");n.defineInteropFlag(r),n.export(r,"slice",()=>i),n.export(r,"sliceConfig",()=>u);var s=e("@tensorflow/tfjs-core"),a=e("../kernel_utils/shared"),o=e("../slice_gpu"),l=e("../slice_packed_gpu");function i(e){let{inputs:t,backend:r,attrs:n}=e,{x:i}=t,{begin:u,size:p}=n,[c,d]=(0,s.slice_util).parseSliceParams(i,u,p);if((0,s.slice_util).assertParamsValid(i,c,d),0===(0,s.util).sizeFromShape(d))return r.makeTensorInfo(d,i.dtype,[]);if(r.shouldExecuteOnCPU([i])||"string"===i.dtype){let e=r.texData.get(i.dataId),t=(0,a.sliceImplCPU)(e.values,c,d,i.shape,i.dtype);return r.makeTensorInfo(d,i.dtype,t)}let{isPacked:f}=r.texData.get(i.dataId),h=(0,s.slice_util).isSliceContinous(i.shape,c,d);if(f||!h){let e=(0,s.env)().getBool("WEBGL_PACK_ARRAY_OPERATIONS")?new l.SlicePackedProgram(d):new o.SliceProgram(d),t=[c];return r.runWebGLProgram(e,[i],i.dtype,t)}return r.uploadToGPU(i.dataId),function(e,t,r,n){let a=n.texData.get(e.dataId),o=n.makeTensorInfo(r,e.dtype),l=n.texData.get(o.dataId);Object.assign(l,a),l.refCount=1,l.shape=r,l.dtype=e.dtype;let i=(0,s.slice_util).computeFlatOffset(t,(0,s.util).computeStrides(e.shape));a.slice&&(i+=a.slice.flatOffset),l.slice={flatOffset:i,origDataId:a.slice&&a.slice.origDataId||e.dataId};let u=n.dataRefCount.get(l.slice.origDataId)||1;return n.dataRefCount.set(l.slice.origDataId,u+1),o}(i,c,d,r)}let u={kernelName:s.Slice,backendName:"webgl",kernelFunc:i}},{"@tensorflow/tfjs-core":"2nuhV","../kernel_utils/shared":"01kMd","../slice_gpu":"kYYZy","../slice_packed_gpu":"7Iupg","@parcel/transformer-js/src/esmodule-helpers.js":"9pCYc"}],kYYZy:[function(e,t,r){/** * @license * Copyright 2017 Google LLC. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. * ============================================================================= */var n=e("@parcel/transformer-js/src/esmodule-helpers.js");n.defineInteropFlag(r),n.export(r,"SliceProgram",()=>a);var s=e("./shader_compiler");class a{constructor(e){let t;this.variableNames=["source"],this.outputShape=e,this.rank=e.length;let r=(0,s.getCoordsDataType)(this.rank);this.customUniforms=[{name:"start",arrayIndex:this.rank,type:"int"}];let n=function(e){if(1===e)return"sourceLoc";if(e<=6)return o.slice(0,e).map(e=>"sourceLoc."+e).join(",");throw Error(`Slicing for rank ${e} is not yet supported`)}(this.rank),a=e.map((e,t)=>`sourceLoc.${o[t]} = start[${t}] + coords.${o[t]};`);t=` ${r} sourceLoc; ${r} coords = getOutputCoords(); ${a.join("\n")} `,this.userCode=` void main() { ${t} setOutput(getSource(${n})); } `}}let o=["x","y","z","w","u","v"]},{"./shader_compiler":"3kYYB","@parcel/transformer-js/src/esmodule-helpers.js":"9pCYc"}],"7Iupg":[function(e,t,r){/** * @license * Copyright 2019 Google LLC. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. * ============================================================================= */var n=e("@parcel/transformer-js/src/esmodule-helpers.js");n.defineInteropFlag(r),n.export(r,"SlicePackedProgram",()=>o);var s=e("./packing_util"),a=e("./shader_compiler");class o{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=(0,a.getCoordsDataType)(this.rank),r=(0,s.getChannels)("coords",this.rank),n=(0,s.getChannels)("sourceLoc",this.rank),o=1===this.rank?"sourceLoc":`vec2(${n.slice(-2).join()})`,l=`getChannel(getSource(${n.join()}), ${o})`,i=` result.x = ${l}; if (++${r[this.rank-1]}< ${e[this.rank-1]}) { ++${n[this.rank-1]}; result.y = ${l}; --${n[this.rank-1]}; } `,u=1===this.rank?"":` --${r[this.rank-1]}; if (++${r[this.rank-2]} < ${e[this.rank-2]}) { ++${n[this.rank-2]}; result.z = ${l}; if (++${r[this.rank-1]} < ${e[this.rank-1]}) { ++${n[this.rank-1]}; result.w = ${l}; } } `,p=this.rank<=4?`sourceLoc = coords + ${t}(${e.map((e,t)=>`start[${t}]`).join()});`:e.map((e,t)=>`${n[t]} = ${r[t]} + start[${t}];`).join("\n");this.userCode=` void main() { ${t} coords = getOutputCoords(); ${t} sourceLoc; ${p} vec4 result = vec4(0.); ${i} ${u} setOutput(result); } `}}},{"./packing_util":"6V5sg","./shader_compiler":"3kYYB","@parcel/transformer-js/src/esmodule-helpers.js":"9pCYc"}],f7Rdr:[function(e,t,r){/** * @license * Copyright 2020 Google LLC. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. * ============================================================================= */var n=e("@parcel/transformer-js/src/esmodule-helpers.js");n.defineInteropFlag(r),n.export(r,"bincount",()=>o),n.export(r,"bincountConfig",()=>l);var s=e("@tensorflow/tfjs-core"),a=e("../kernel_utils/shared");function o(e){let{inputs:t,backend:r,attrs:n}=e,{x:s,weights:o}=t,{size:l}=n,i=r.readSync(s.dataId),u=r.readSync(o.dataId),p=(0,a.bincountImplCPU)(i,u,o.dtype,o.shape,l);return r.makeTensorInfo([l],o.dtype,p)}let l={kernelName:s.Bincount,backendName:"webgl",kernelFunc:o}},{"@tensorflow/tfjs-core":"2nuhV","../kernel_utils/shared":"01kMd","@parcel/transformer-js/src/esmodule-helpers.js":"9pCYc"}],nsRbh:[function(e,t,r){/** * @license * Copyright 2023 Google LLC. * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. * ============================================================================= */var n=e("@parcel/transformer-js/src/esmodule-helpers.js");n.defineInteropFlag(r),n.export(r,"BITWISEAND",()=>i),n.export(r,"BITWISEAND_UNPACKED",()=>u),n.export(r,"bitwiseAnd",()=>p),n.export(r,"bitwiseAndConfig",()=>c);var s=e("@tensorflow/tfjs-core"),a=e("../binaryop_gpu"),o=e("../binaryop_packed_gpu"),l=e("../kernel_utils/shared");let i=` 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); `,u=` return float(int(a.r) & int(b.r)); `;function p(e){let t;let{inputs:r,backend:n}=e,{a:p,b:c}=r,d=(0,s.env)().getBool("WEBGL_PACK_BINARY_OPERATIONS"),f=(0,s.env)().getNumber("WEBGL_VERSION");if(n.shouldExecuteOnCPU([p,c])||1===f){let e=n.texData.get(p.dataId).values,t=n.texData.get(c.dataId).values,[r,s]=(0,l.bitwiseAndImplCPU)(p.shape,c.shape,e,t,p.dtype),a=n.makeTensorInfo(s,p.dtype);return n.texData.get(a.dataId).values=r,a}return t=d?new o.BinaryOpPackedProgram(i,p.shape,c.shape,!1):new a.BinaryOpProgram(u,p.shape,c.shape),n.runWebGLProgram(t,[p,c],p.dtype)}let c={kernelName:s.BitwiseAnd,backendName:"webgl",kernelFunc:p}},{"@tensorflow/tfjs-core":"2nuhV","../binaryop_gpu":"ilh7x","../binaryop_packed_gpu":"f1UiT","../kernel_utils/shared":"01kMd","@parcel/transformer-js/src/esmodule-helpers.js":"9pCYc"}],hsxhy:[function(e,t,r){/** * @license * Copyright 2021 Google LLC. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. * ============================================================================= */var n=e("@parcel/transformer-js/src/esmodule-helpers.js");n.defineInteropFlag(r),n.export(r,"broadcastArgs",()=>a),n.export(r,"broadcastArgsConfig",()=>o);var s=e("@tensorflow/tfjs-core");function a(e){let{inputs:t,backend:r}=e,{s0:n,s1:a}=t,o=r.readSync(n.dataId),l=r.readSync(a.dataId),i=(0,s.backend_util).assertAndGetBroadcastShape(Array.from(o),Array.from(l));return r.makeTensorInfo([i.length],"int32",Int32Array.from(i))}let o={kernelName:s.BroadcastArgs,backendName:"webgl",kernelFunc:a}},{"@tensorflow/tfjs-core":"2nuhV","@parcel/transformer-js/src/esmodule-helpers.js":"9pCYc"}],"7u1bU":[function(e,t,r){/** * @license * Copyright 2020 Google LLC. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. * ============================================================================= */var n=e("@parcel/transformer-js/src/esmodule-helpers.js");n.defineInteropFlag(r),n.export(r,"cast",()=>c),n.export(r,"castConfig",()=>d);var s=e("@tensorflow/tfjs-core"),a=e("../kernel_utils/shared"),o=e("./Complex"),l=e("./Identity"),i=e("./NotEqual"),u=e("./Real"),p=e("../kernel_utils/int");function c(e){let{inputs:t,backend:r,attrs:n}=e,{x:d}=t,{dtype:f}=n;if("complex64"===f){if("complex64"===d.dtype)return(0,l.identity)({inputs:{x:d},backend:r});let e=s.zeros(d.shape),t=c({inputs:{x:d},backend:r,attrs:{dtype:"float32"}}),n=(0,o.complex)({inputs:{real:t,imag:e},backend:r});return e.dispose(),r.disposeIntermediateTensorInfo(t),n}if("complex64"===d.dtype){let e=(0,u.real)({inputs:{input:d},backend:r}),t=c({inputs:{x:e},backend:r,attrs:{dtype:f}});return r.disposeIntermediateTensorInfo(e),t}if(!(0,s.util).hasEncodingLoss(d.dtype,f)){let e=(0,l.identity)({inputs:{x:d},backend:r});return{dataId:e.dataId,shape:e.shape,dtype:f}}if(r.shouldExecuteOnCPU([d])){let e=r.texData.get(d.dataId).values,[t,n,s]=(0,a.castImplCPU)(e,d.shape,d.dtype,f);return r.makeTensorInfo(t,n,s)}if("int32"===f)return(0,p.int)(d,r);if("bool"===f){let e=r.makeTensorInfo([],"bool",(0,s.util).getTypedArrayFromDType("bool",1)),t=(0,i.notEqual)({inputs:{a:d,b:e},backend:r});return r.disposeIntermediateTensorInfo(e),t}throw Error(`Error in Cast: failed to cast ${d.dtype} to ${f}`)}let d={kernelName:s.Cast,backendName:"webgl",kernelFunc:c}},{"@tensorflow/tfjs-core":"2nuhV","../kernel_utils/shared":"01kMd","./Complex":"3zOos","./Identity":"4GZPt","./NotEqual":"9yxhk","./Real":"4c1DV","../kernel_utils/int":"QLRPM","@parcel/transformer-js/src/esmodule-helpers.js":"9pCYc"}],"9yxhk":[function(e,t,r){/** * @license * Copyright 2020 Google LLC. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. * ============================================================================= */var n=e("@parcel/transformer-js/src/esmodule-helpers.js");n.defineInteropFlag(r),n.export(r,"notEqual",()=>l),n.export(r,"notEqualConfig",()=>i);var s=e("@tensorflow/tfjs-core"),a=e("../kernel_utils/kernel_funcs_utils"),o=e("../kernel_utils/shared");let l=(0,a.binaryKernelFunc)({opSnippet:"return float(a != b);",cpuKernelImpl:o.notEqualImplCPU,dtype:"bool"}),i={kernelName:s.NotEqual,backendName:"webgl",kernelFunc:l}},{"@tensorflow/tfjs-core":"2nuhV","../kernel_utils/kernel_funcs_utils":"jMepo","../kernel_utils/shared":"01kMd","@parcel/transformer-js/src/esmodule-helpers.js":"9pCYc"}],"4c1DV":[function(e,t,r){/** * @license * Copyright 2020 Google LLC. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. * ============================================================================= */var n=e("@parcel/transformer-js/src/esmodule-helpers.js");n.defineInteropFlag(r),n.export(r,"real",()=>o),n.export(r,"realConfig",()=>l);var s=e("@tensorflow/tfjs-core"),a=e("./Identity");function o(e){let{inputs:t,backend:r}=e,{input:n}=t,s=r.texData.get(n.dataId);return(0,a.identity)({inputs:{x:s.complexTensorInfos.real},backend:r})}let l={kernelName:s.Real,backendName:"webgl",kernelFunc:o}},{"@tensorflow/tfjs-core":"2nuhV","./Identity":"4GZPt","@parcel/transformer-js/src/esmodule-helpers.js":"9pCYc"}],QLRPM:[function(e,t,r){/** * @license * Copyright 2020 Google LLC. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. * ============================================================================= */var n=e("@parcel/transformer-js/src/esmodule-helpers.js");n.defineInteropFlag(r),n.export(r,"int",()=>a);var s=e("../unaryop_gpu");function a(e,t){let r=new s.UnaryOpProgram(e.shape,"return float(int(x));"),n=t.runWebGLProgram(r,[e],"int32");return{dataId:n.dataId,shape:n.shape,dtype:n.dtype}}},{"../unaryop_gpu":"iNthQ","@parcel/transformer-js/src/esmodule-helpers.js":"9pCYc"}],jQtlI:[function(e,t,r){/** * @license * Copyright 2020 Google LLC. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. * ============================================================================= */var n=e("@parcel/transformer-js/src/esmodule-helpers.js");n.defineInteropFlag(r),n.export(r,"ceil",()=>i),n.export(r,"ceilConfig",()=>u);var s=e("@tensorflow/tfjs-core"),a=e("../kernel_utils/kernel_funcs_utils"),o=e("../kernel_utils/shared");let l="return ceil(x);",i=(0,a.unaryKernelFunc)({opSnippet:l,packedOpSnippet:l,cpuKernelImpl:o.ceilImplCPU}),u={kernelName:s.Ceil,backendName:"webgl",kernelFunc:i}},{"@tensorflow/tfjs-core":"2nuhV","../kernel_utils/kernel_funcs_utils":"jMepo","../kernel_utils/shared":"01kMd","@parcel/transformer-js/src/esmodule-helpers.js":"9pCYc"}],"1v34G":[function(e,t,r){/** * @license * Copyright 2020 Google LLC. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. * ============================================================================= */var n=e("@parcel/transformer-js/src/esmodule-helpers.js");n.defineInteropFlag(r),n.export(r,"clipByValue",()=>l),n.export(r,"clipByValueConfig",()=>i);var s=e("@tensorflow/tfjs-core"),a=e("../clip_gpu"),o=e("../clip_packed_gpu");function l(e){let t;let{inputs:r,backend:n,attrs:l}=e,{x:i}=r,{clipValueMin:u,clipValueMax:p}=l;return t=(0,s.env)().getBool("WEBGL_PACK_CLIP")?new o.ClipPackedProgram(i.shape):new a.ClipProgram(i.shape),n.runWebGLProgram(t,[i],i.dtype,[[u],[p]])}let i={kernelName:s.ClipByValue,backendName:"webgl",kernelFunc:l}},{"@tensorflow/tfjs-core":"2nuhV","../clip_gpu":"3d4iM","../clip_packed_gpu":"8JccK","@parcel/transformer-js/src/esmodule-helpers.js":"9pCYc"}],"3d4iM":[function(e,t,r){/** * @license * Copyright 2017 Google LLC. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. * ============================================================================= */var n=e("@parcel/transformer-js/src/esmodule-helpers.js");n.defineInteropFlag(r),n.export(r,"ClipProgram",()=>s);class s{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(); if (isnan(value)) { setOutput(value); return; } setOutput(clamp(value, minVal, maxVal)); } `}}},{"@parcel/transformer-js/src/esmodule-helpers.js":"9pCYc"}],"8JccK":[function(e,t,r){/** * @license * Copyright 2018 Google LLC. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. * ============================================================================= */var n=e("@parcel/transformer-js/src/esmodule-helpers.js");n.defineInteropFlag(r),n.export(r,"ClipPackedProgram",()=>s);class s{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(); if (any(isnan(value))) { setOutput(value); return; } setOutput(clamp(value, vec4(minVal), vec4(maxVal))); } `}}},{"@parcel/transformer-js/src/esmodule-helpers.js":"9pCYc"}],"2dAj4":[function(e,t,r){/** * @license * Copyright 2020 Google LLC. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. * ============================================================================= */var n=e("@parcel/transformer-js/src/esmodule-helpers.js");n.defineInteropFlag(r),n.export(r,"complexAbs",()=>l),n.export(r,"complexAbsConfig",()=>i);var s=e("@tensorflow/tfjs-core"),a=e("../complex_abs_gpu");function o(e,t){return{dataId:t.dataId,dtype:t.dtype,shape:e.shape}}function l(e){let{inputs:t,backend:r}=e,{x:n}=t,s=r.texData.get(n.dataId),l=new a.ComplexAbsProgram(n.shape),i=[o(n,s.complexTensorInfos.real),o(n,s.complexTensorInfos.imag)];return r.runWebGLProgram(l,i,i[0].dtype)}let i={kernelName:s.ComplexAbs,backendName:"webgl",kernelFunc:l}},{"@tensorflow/tfjs-core":"2nuhV","../complex_abs_gpu":"6URxY","@parcel/transformer-js/src/esmodule-helpers.js":"9pCYc"}],"6URxY":[function(e,t,r){/** * @license * Copyright 2018 Google LLC. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. * ============================================================================= */var n=e("@parcel/transformer-js/src/esmodule-helpers.js");n.defineInteropFlag(r),n.export(r,"ComplexAbsProgram",()=>s);class s{constructor(e){this.variableNames=["real","imag"],this.outputShape=e,this.userCode=` void main() { float re = abs(getRealAtOutCoords()); float im = abs(getImagAtOutCoords()); float mx = max(re, im); // sadly the length function in glsl is not underflow-safe // (at least not on Intel GPUs). So the safe solution is // to ensure underflow-safety in all cases. setOutput( mx == 0.0 ? 0.0 : mx * length(vec2(1, min(re, im)/mx)) ); } `}}},{"@parcel/transformer-js/src/esmodule-helpers.js":"9pCYc"}],lOCXc:[function(e,t,r){/** * @license * Copyright 2020 Google LLC. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. * ============================================================================= */var n=e("@parcel/transformer-js/src/esmodule-helpers.js");n.defineInteropFlag(r),n.export(r,"concat",()=>l),n.export(r,"concatConfig",()=>i);var s=e("@tensorflow/tfjs-core"),a=e("./Concat_impl"),o=e("./Identity");function l(e){let{inputs:t,backend:r,attrs:n}=e,{axis:l}=n,i=(0,s.util).parseAxisParam(l,t[0].shape)[0],u=t.map(e=>e.shape);(0,s.backend_util).assertParamsConsistent(u,i);let p=(0,s.backend_util).computeOutShape(t.map(e=>e.shape),i);if(0===(0,s.util).sizeFromShape(p))return r.makeTensorInfo(p,t[0].dtype,[]);let c=t.filter(e=>(0,s.util).sizeFromShape(e.shape)>0);return 1===c.length?(0,o.identity)({inputs:{x:c[0]},backend:r}):(0,a.concatImpl)(c,i,r)}let i={kernelName:s.Concat,backendName:"webgl",kernelFunc:l}},{"@tensorflow/tfjs-core":"2nuhV","./Concat_impl":"6117v","./Identity":"4GZPt","@parcel/transformer-js/src/esmodule-helpers.js":"9pCYc"}],"6117v":[function(e,t,r){/** * @license * Copyright 2020 Google LLC. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. * ============================================================================= */var n=e("@parcel/transformer-js/src/esmodule-helpers.js");n.defineInteropFlag(r),n.export(r,"concatImpl",()=>function e(t,r,n){let h=t[0].dtype;if("complex64"===h){let s=t.map(e=>(0,d.real)({inputs:{input:e},backend:n})),a=t.map(e=>(0,c.imag)({inputs:{input:e},backend:n})),o=e(s,r,n),l=e(a,r,n),i=(0,p.complex)({inputs:{real:o,imag:l},backend:n});return s.forEach(e=>n.disposeIntermediateTensorInfo(e)),a.forEach(e=>n.disposeIntermediateTensorInfo(e)),n.disposeIntermediateTensorInfo(o),n.disposeIntermediateTensorInfo(l),i}let m=n.shouldExecuteOnCPU(t);if("string"===h&&(m=!0),m){let e=t.map(e=>{let t=(0,s.util).sizeFromShape(e.shape.slice(r));return(0,f.reshape)({inputs:{x:e},backend:n,attrs:{shape:[-1,t]}})}),a=e.map(e=>({vals:n.readSync(e.dataId),shape:e.shape})),o=(0,s.backend_util).computeOutShape(e.map(e=>e.shape),1),i=1===e[0].shape[0],u=(0,l.concatImplCPU)(a,o,h,i),p=(0,s.backend_util).computeOutShape(t.map(e=>e.shape),r),c=n.makeTensorInfo(p,h,u);return e.forEach(e=>n.disposeIntermediateTensorInfo(e)),c}let g=t.filter(e=>(0,s.util).sizeFromShape(e.shape)>0),x=(0,s.env)().getBool("WEBGL_PACK_ARRAY_OPERATIONS")&&g[0].shape.length>1;if(1===g.length){let e=x?new i.UnaryOpProgram(t[0].shape,i.CLONE):new u.UnaryOpPackedProgram(t[0].shape,i.CLONE);return n.runWebGLProgram(e,t,h)}let v=(0,s.env)().getNumber("WEBGL_MAX_TEXTURES_IN_SHADER");if(g.length>v){let t=[];for(let s=0;se.shape),r);return n.runWebGLProgram(e,g,h)}let{tensors2D:y,outShape:b}=function(e,t,r){let n=(0,s.backend_util).computeOutShape(e.map(e=>e.shape),t);return{tensors2D:e.map(e=>(0,f.reshape)({inputs:{x:e},attrs:{shape:[-1,(0,s.util).sizeFromShape(e.shape.slice(t))]},backend:r})),outShape:n}}(g,r,n),_=new a.ConcatProgram(y.map(e=>e.shape)),k=n.runWebGLProgram(_,y,h);y.forEach(e=>n.disposeIntermediateTensorInfo(e));let j=(0,f.reshape)({inputs:{x:k},attrs:{shape:b},backend:n});return n.disposeIntermediateTensorInfo(k),j});var s=e("@tensorflow/tfjs-core"),a=e("../concat_gpu"),o=e("../concat_packed_gpu"),l=e("../kernel_utils/shared"),i=e("../unaryop_gpu"),u=e("../unaryop_packed_gpu"),p=e("./Complex"),c=e("./Imag"),d=e("./Real"),f=e("./Reshape")},{"@tensorflow/tfjs-core":"2nuhV","../concat_gpu":"bWE7Q","../concat_packed_gpu":"9TchT","../kernel_utils/shared":"01kMd","../unaryop_gpu":"iNthQ","../unaryop_packed_gpu":"k4CIw","./Complex":"3zOos","./Imag":"edc2Y","./Real":"4c1DV","./Reshape":"cgfGf","@parcel/transformer-js/src/esmodule-helpers.js":"9pCYc"}],bWE7Q:[function(e,t,r){/** * @license * Copyright 2017 Google LLC. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. * ============================================================================= */var n=e("@parcel/transformer-js/src/esmodule-helpers.js");n.defineInteropFlag(r),n.export(r,"ConcatProgram",()=>a);var s=e("@tensorflow/tfjs-core");class a{constructor(e){this.outputShape=[],this.outputShape=(0,s.backend_util).computeOutShape(e,1),this.variableNames=e.map((e,t)=>`T${t}`);let t=Array(e.length-1);t[0]=e[0][1];for(let r=1;rl);var s=e("@tensorflow/tfjs-core"),a=e("./packing_util"),o=e("./shader_compiler");class l{constructor(e,t){this.packedInputs=!0,this.packedOutput=!0,this.outputShape=[],this.outputShape=(0,s.backend_util).computeOutShape(e,t);let r=this.outputShape,n=r.length,l=(0,o.getCoordsDataType)(n),u=(0,a.getChannels)("coords",n),p=["x","y","z","w","u","v"].slice(0,n);this.variableNames=e.map((e,t)=>`T${t}`);let c=Array(e.length-1);c[0]=e[0][t];for(let r=1;r= ${c[e-1]}) { return getChannel( getT${e}(${i(p,d,t)}), vec2(${i(f,d,t)})); }`}let g=c.length,x=c[c.length-1];m+=` return getChannel( getT${g}(${i(p,d,x)}), vec2(${i(f,d,x)}));`,this.userCode=` float getValue(${p.map(e=>"int "+e)}) { ${m} } void main() { ${l} coords = getOutputCoords(); vec4 result = vec4(getValue(${u}), 0., 0., 0.); ${u[n-1]} = ${u[n-1]} + 1; if (${u[n-1]}< ${r[n-1]}) { result.g = getValue(${u}); } ${u[n-2]} = ${u[n-2]} + 1; if (${u[n-2]} < ${r[n-2]}) { result.a = getValue(${u}); } ${u[n-1]} = ${u[n-1]} - 1; if (${u[n-2]} < ${r[n-2]} && ${u[n-1]} < ${r[n-1]}) { result.b = getValue(${u}); } setOutput(result); } `}}function i(e,t,r){let n=e.indexOf(t);return e.map((e,t)=>t===n?`${e} - ${r}`:e).join()}},{"@tensorflow/tfjs-core":"2nuhV","./packing_util":"6V5sg","./shader_compiler":"3kYYB","@parcel/transformer-js/src/esmodule-helpers.js":"9pCYc"}],edc2Y:[function(e,t,r){/** * @license * Copyright 2020 Google LLC. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. * ============================================================================= */var n=e("@parcel/transformer-js/src/esmodule-helpers.js");n.defineInteropFlag(r),n.export(r,"imag",()=>o),n.export(r,"imagConfig",()=>l);var s=e("@tensorflow/tfjs-core"),a=e("./Identity");function o(e){let{inputs:t,backend:r}=e,{input:n}=t,s=r.texData.get(n.dataId);return(0,a.identity)({inputs:{x:s.complexTensorInfos.imag},backend:r})}let l={kernelName:s.Imag,backendName:"webgl",kernelFunc:o}},{"@tensorflow/tfjs-core":"2nuhV","./Identity":"4GZPt","@parcel/transformer-js/src/esmodule-helpers.js":"9pCYc"}],eJWq5:[function(e,t,r){/** * @license * Copyright 2020 Google LLC. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. * ============================================================================= */var n=e("@parcel/transformer-js/src/esmodule-helpers.js");n.defineInteropFlag(r),n.export(r,"conv2d",()=>u),n.export(r,"conv2DConfig",()=>p);var s=e("@tensorflow/tfjs-core"),a=e("../conv_gpu"),o=e("../conv_packed_gpu"),l=e("./Conv2D_impl"),i=e("./Reshape");function u(e){let t;let{inputs:r,backend:n,attrs:u}=e,{x:p,filter:c}=r,{strides:d,pad:f,dataFormat:h,dilations:m,dimRoundingMode:g}=u,x=(0,s.backend_util).convertConv2DDataFormat(h),v=(0,s.backend_util).computeConv2DInfo(p.shape,c.shape,d,m,f,g,!1,x);if(1===v.filterHeight&&1===v.filterWidth&&1===v.dilationHeight&&1===v.dilationWidth&&1===v.strideHeight&&1===v.strideWidth&&("SAME"===v.padInfo.type||"VALID"===v.padInfo.type))t=(0,l.conv2dByMatMul)({x:p,filter:c,convInfo:v,backend:n});else if(v.strideWidth<=2&&"channelsLast"===x&&(0,s.env)().getBool("WEBGL_EXP_CONV")){let e=new o.Conv2DPackedProgram(v),r=[[v.padInfo.top,v.padInfo.left],[v.strideHeight,v.strideWidth],[v.dilationHeight,v.dilationWidth],[v.inHeight,v.inWidth]];t=n.runWebGLProgram(e,[p,c],"float32",r)}else if((0,s.env)().getBool("WEBGL_CONV_IM2COL"))t=(0,l.conv2dWithIm2Row)({x:p,filter:c,convInfo:v,backend:n});else{let e=new a.Conv2DProgram(v);t=n.runWebGLProgram(e,[p,c],"float32")}let y=(0,i.reshape)({inputs:{x:t},backend:n,attrs:{shape:v.outShape}});return n.disposeIntermediateTensorInfo(t),y}let p={kernelName:s.Conv2D,backendName:"webgl",kernelFunc:u}},{"@tensorflow/tfjs-core":"2nuhV","../conv_gpu":"luVZB","../conv_packed_gpu":"fQD9i","./Conv2D_impl":"5NYOP","./Reshape":"cgfGf","@parcel/transformer-js/src/esmodule-helpers.js":"9pCYc"}],luVZB:[function(e,t,r){/** * @license * Copyright 2017 Google LLC. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. * ============================================================================= */var n=e("@parcel/transformer-js/src/esmodule-helpers.js");n.defineInteropFlag(r),n.export(r,"Conv2DProgram",()=>s),n.export(r,"Conv3DProgram",()=>a);class s{constructor(e,t=!1,r=null,n=!1,s=!1){this.variableNames=["x","W"],this.outputShape=e.outShape;let a=e.padInfo.top,o=e.padInfo.left,l=e.strideHeight,i=e.strideWidth,u=e.dilationHeight,p=e.dilationWidth,c=e.filterHeight,d=e.filterWidth,f=4*Math.floor(e.inChannels/4),h=e.inChannels%4,m="channelsLast"===e.dataFormat,g="",x="";r&&(g=n?`float activation(float a) { float b = getPreluActivationWeightsAtOutCoords(); ${r} }`:s?`float activation(float a) { float b = getLeakyreluAlphaAtOutCoords(); ${r} }`:` float activation(float x) { ${r} } `,x="result = activation(result);"),t&&this.variableNames.push("bias"),n&&this.variableNames.push("preluActivationWeights"),s&&this.variableNames.push("leakyreluAlpha"),this.userCode=` ${g} const ivec2 strides = ivec2(${l}, ${i}); const ivec2 pads = ivec2(${a}, ${o}); void main() { ivec4 coords = getOutputCoords(); int batch = coords[0]; int d2 = coords[${m?3:1}]; ivec2 xRCCorner = ivec2(coords[${m?1:2}], coords[${m?2:3}]) * strides - pads; int xRCorner = xRCCorner.x; int xCCorner = xRCCorner.y; // Convolve x(?, ?, d1) with w(:, :, d1, d2) to get y(yR, yC, d2). // ? = to be determined. : = across all values in that axis. float dotProd = 0.0; for (int wR = 0; wR< ${c}; wR++) { int xR = xRCorner + wR * ${u}; if (xR < 0 || xR >= ${e.inHeight}) { continue; } for (int wC = 0; wC< ${d}; wC++) { int xC = xCCorner + wC * ${p}; if (xC < 0 || xC >= ${e.inWidth}) { continue; } for (int d1 = 0; d1< ${f}; d1 += 4) { vec4 wValues = vec4( getW(wR, wC, d1, d2), getW(wR, wC, d1 + 1, d2), getW(wR, wC, d1 + 2, d2), getW(wR, wC, d1 + 3, d2) ); if (${m}) { vec4 xValues = vec4( getX(batch, xR, xC, d1), getX(batch, xR, xC, d1 + 1), getX(batch, xR, xC, d1 + 2), getX(batch, xR, xC, d1 + 3) ); dotProd += dot(xValues, wValues); } else { vec4 xValues = vec4( getX(batch, d1, xR, xC), getX(batch, d1 + 1, xR, xC), getX(batch, d1 + 2, xR, xC), getX(batch, d1 + 3, xR, xC) ); dotProd += dot(xValues, wValues); } } if (${1===h}) { if (${m}) { dotProd += getX(batch, xR, xC, ${f}) * getW(wR, wC, ${f}, d2); } else { dotProd += getX(batch, ${f}, xR, xC) * getW(wR, wC, ${f}, d2); } } else if (${2===h}) { vec2 wValues = vec2( getW(wR, wC, ${f}, d2), getW(wR, wC, ${f} + 1, d2) ); if (${m}) { vec2 xValues = vec2( getX(batch, xR, xC, ${f}), getX(batch, xR, xC, ${f} + 1) ); dotProd += dot(xValues, wValues); } else { vec2 xValues = vec2( getX(batch, ${f}, xR, xC), getX(batch, ${f} + 1, xR, xC) ); dotProd += dot(xValues, wValues); } } else if (${3===h}) { vec3 wValues = vec3( getW(wR, wC, ${f}, d2), getW(wR, wC, ${f} + 1, d2), getW(wR, wC, ${f} + 2, d2) ); if (${m}) { vec3 xValues = vec3( getX(batch, xR, xC, ${f}), getX(batch, xR, xC, ${f} + 1), getX(batch, xR, xC, ${f} + 2) ); dotProd += dot(xValues, wValues); } else { vec3 xValues = vec3( getX(batch, ${f}, xR, xC), getX(batch, ${f} + 1, xR, xC), getX(batch, ${f} + 2, xR, xC) ); dotProd += dot(xValues, wValues); } } } } float result = dotProd; ${t?"result += getBiasAtOutCoords();":""} ${x} setOutput(result); } `}}class a{constructor(e){this.variableNames=["x","W"],this.outputShape=e.outShape;let t=e.padInfo.front,r=e.padInfo.top,n=e.padInfo.left,s=e.strideDepth,a=e.strideHeight,o=e.strideWidth,l=e.dilationDepth,i=e.dilationHeight,u=e.dilationWidth,p=e.filterDepth,c=e.filterHeight,d=e.filterWidth,f=4*Math.floor(e.inChannels/4),h=e.inChannels%4;this.userCode=` const ivec3 strides = ivec3(${s}, ${a}, ${o}); const ivec3 pads = ivec3(${t}, ${r}, ${n}); void main() { ivec5 coords = getOutputCoords(); int batch = coords.x; int d2 = coords.u; ivec3 xFRCCorner = ivec3(coords.y, coords.z, coords.w) * strides - pads; int xFCorner = xFRCCorner.x; int xRCorner = xFRCCorner.y; int xCCorner = xFRCCorner.z; // Convolve x(?, ?, ?, d1) with w(:, :, :, d1, d2) to get // 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++) { int xF = xFCorner + wF * ${l}; if (xF < 0 || xF >= ${e.inDepth}) { continue; } for (int wR = 0; wR< ${c}; wR++) { int xR = xRCorner + wR * ${i}; if (xR < 0 || xR >= ${e.inHeight}) { continue; } for (int wC = 0; wC< ${d}; wC++) { int xC = xCCorner + wC * ${u}; if (xC < 0 || xC >= ${e.inWidth}) { continue; } for (int d1 = 0; d1< ${f}; d1 += 4) { vec4 xValues = vec4( getX(batch, xF, xR, xC, d1), getX(batch, xF, xR, xC, d1 + 1), getX(batch, xF, xR, xC, d1 + 2), getX(batch, xF, xR, xC, d1 + 3) ); vec4 wValues = vec4( getW(wF, wR, wC, d1, d2), getW(wF, wR, wC, d1 + 1, d2), getW(wF, wR, wC, d1 + 2, d2), getW(wF, wR, wC, d1 + 3, d2) ); dotProd += dot(xValues, wValues); } if (${1===h}) { dotProd += getX(batch, xF, xR, xC, ${f}) * getW(wF, wR, wC, ${f}, d2); } else if (${2===h}) { vec2 xValues = vec2( getX(batch, xF, xR, xC, ${f}), getX(batch, xF, xR, xC, ${f} + 1) ); vec2 wValues = vec2( getW(wF, wR, wC, ${f}, d2), getW(wF, wR, wC, ${f} + 1, d2) ); dotProd += dot(xValues, wValues); } else if (${3===h}) { vec3 xValues = vec3( getX(batch, xF, xR, xC, ${f}), getX(batch, xF, xR, xC, ${f} + 1), getX(batch, xF, xR, xC, ${f} + 2) ); vec3 wValues = vec3( getW(wF, wR, wC, ${f}, d2), getW(wF, wR, wC, ${f} + 1, d2), getW(wF, wR, wC, ${f} + 2, d2) ); dotProd += dot(xValues, wValues); } } } } setOutput(dotProd); } `}}},{"@parcel/transformer-js/src/esmodule-helpers.js":"9pCYc"}],fQD9i:[function(e,t,r){/** * @license * Copyright 2022 Google LLC. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. * ============================================================================= */var n=e("@parcel/transformer-js/src/esmodule-helpers.js");n.defineInteropFlag(r),n.export(r,"Conv2DPackedProgram",()=>o);var s=e("@tensorflow/tfjs-core"),a=e("./gpgpu_math");class o{constructor(e,t=!1,r=null,n=!1,o=!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=(0,a.useShapeUniforms)(this.outputShape.length);let l=e.padInfo.left,i=e.strideWidth,u=e.dilationWidth,p=e.filterHeight,c=e.filterWidth,d=` int xR; int xC; int xCOffset; vec4 wTexel; vec4 previous; vec4 final;`;for(let e=0;e=0 && xR< inDims[0]) { `;for(let t=0;t<(c+1)/2;t++){let r=2*t;if(d+=` xC = xCCorner + ${r*u}; `,1===i){if(r= 0 && xCOffset< inDims[1] && xTexelC${r}Ready == 0) { xTexelC${r} = getX(batch, xR, xCOffset, d1); // Need to manually clear unused channels in case // we're reading from recycled texture. if (xCOffset + 1 >= inDims[1]) { xTexelC${r}.zw = vec2(0.0); } xTexelC${r}Ready = 1; } `,1===u&&r>0?d+=` xC${r} = vec4(xTexelC${r-2}.zw, xTexelC${r}.xy); `:d+=` xCOffset = xC + 1 - 2; if (xCOffset >= 0 && xCOffset< inDims[1]) { previous = getX(batch, xR, xCOffset, d1); // Need to manually clear unused channels in case // we're reading from recycled texture. if (xCOffset + 1 >= inDims[1]) { previous.zw = vec2(0.0); } xC${r} = vec4(previous.zw, xTexelC${r}.xy); } else { xC${r} = vec4(0.0, 0.0, xTexelC${r}.xy); } `):d+=` if (xC >= 0 && xC< inDims[1] && xTexelC${r}Ready == 0) { xTexelC${r} = getX(batch, xR, xC, d1); if (xC + 1 >= inDims[1]) { xTexelC${r}.zw = vec2(0.0); } xTexelC${r}Ready = 1; } xC${r} = xTexelC${r}; `,r+1= 0 && xCOffset< inDims[1] && xTexelC${r+1}Ready == 0) { xTexelC${r+1} = getX(batch, xR, xCOffset, d1); // Need to manually clear unused channels in case // we're reading from recycled texture. if (xCOffset + 1 >= inDims[1]) { xTexelC${r+1}.zw = vec2(0.0); } xTexelC${r+1}Ready = 1; } `,u>1?d+=` xCOffset -= 2; if (xCOffset >= 0 && xCOffset< inDims[1]) { previous = getX(batch, xR, xCOffset, d1); xC${r+1} = vec4(previous.zw, xTexelC${r+1}.xy); } else { xC${r+1} = vec4(0.0, 0.0, xTexelC${r+1}.xy); } `:d+=` xC${r+1} = vec4(xTexelC${r}.zw, xTexelC${r+1}.xy); `):1===e?d+=` xC${r+1} = xTexelC${r}; `:d+=` xCOffset = xC + ${e}; if (xCOffset >= 0 && xCOffset< inDims[1] && xTexelC${r+1}Ready == 0) { xTexelC${r+1} = getX(batch, xR, xCOffset, d1); if (xCOffset + 1 >= inDims[1]) { xTexelC${r+1}.zw = vec2(0.0); } xTexelC${r+1}Ready = 1; } xC${r+1} = xTexelC${r+1}; `}}else r= 0 && xCOffset< inDims[1] && xTexelC${r}Ready == 0) { xTexelC${r} = getX(batch, xR, xCOffset, d1); // Need to manually clear unused channels in case // we're reading from recycled texture. if (xCOffset + 1 >= inDims[1]) { xTexelC${r}.zw = vec2(0.0); } xTexelC${r}Ready = 1; } if(xC + 1 >= 0 && xC + 1< inDims[1] && xTexelC${r+1}Ready == 0) { xTexelC${r+1} = getX(batch, xR, xC + 1, d1); // Need to manually clear unused channels in case // we're reading from recycled texture. if (xC + 2 >= inDims[1]) { xTexelC${r+1}.zw = vec2(0.0); } xTexelC${r+1}Ready = 1; } xC${r} = vec4(xTexelC${r}.zw, xTexelC${r+1}.zw); `,r+1= 0 && xCOffset< inDims[1]) { final = getX(batch, xR, xCOffset, d1); } xC${r+1} = vec4(xTexelC${r+1}.xy, final.xy); `)):(d+=` if(xC >= 0 && xC< inDims[1] && xTexelC${r}Ready == 0) { xTexelC${r} = getX(batch, xR, xC, d1); if (xC + 1 >= inDims[1]) { xTexelC${r}.zw = vec2(0.0); } xTexelC${r}Ready = 1; } xCOffset = xC + strides[1]; if(xCOffset >= 0 && xCOffset< inDims[1] && xTexelC${r+1}Ready == 0) { xTexelC${r+1} = getX(batch, xR, xCOffset, d1); if (xCOffset + 1 >= inDims[1]) { xTexelC${r+1}.zw = vec2(0.); } xTexelC${r+1}Ready = 1; } xC${r} = vec4( xTexelC${r}.xy, xTexelC${r+1}.xy); `,r+1f),n.export(r,"conv2dWithIm2Row",()=>h);var s=e("@tensorflow/tfjs-core"),a=e("../im2col_packed_gpu"),o=e("../kernel_utils/kernel_funcs_utils"),l=e("../mulmat_packed_gpu"),i=e("../webgl_util"),u=e("./BatchMatMul_impl"),p=e("./Identity"),c=e("./Reshape");function d(e,t){let r=e.length;return r>=3?t?[...e.slice(0,-3),e[r-3]*e[r-2],e[r-1]]:[...e.slice(0,-3),e[r-3],e[r-2]*e[r-1]]:!t&&1===r&&e[0]>1?[e[0],1]:null}function f({x:e,filter:t,convInfo:r,backend:n,bias:a=null,preluActivationWeights:o=null,leakyreluAlpha:l=0,activation:f=null}){let h;let m=e.shape,g=n.texData.get(e.dataId),x=r.inChannels,v=m[0]*m[1]*m[2],y=r.outChannels,b="channelsLast"===r.dataFormat,_=[];if(null!=o){let e=d(o.shape,b);null!=e&&(o=(0,c.reshape)({inputs:{x:o},backend:n,attrs:{shape:e}}),_.push(o))}if(null!=a){let e=d(a.shape,b);null!=e&&(a=(0,c.reshape)({inputs:{x:a},backend:n,attrs:{shape:e}}),_.push(a))}if(!((1===v||1===y)&&x>u.MATMUL_SHARED_DIM_THRESHOLD)&&g.isPacked&&b&&null!=g.texture&&m[2]%2!=0&&(0,s.util).arraysEqual(g.shape.slice(-3),m.slice(-3))){let d=m[0]*m[1]*(m[2]+1),x={dataId:e.dataId,shape:[1,d,r.inChannels],dtype:e.dtype},v=g.shape;g.shape=g.shape.slice(),g.shape[g.shape.length-2]++,(0,s.util).assert(i.isReshapeFree(g.shape,x.shape),()=>`packed reshape ${g.shape} to ${x.shape} isn't free`);let y=(0,c.reshape)({inputs:{x:t},backend:n,attrs:{shape:[1,r.inChannels,r.outChannels]}});_.push(y);let b=(0,u.batchMatMulImpl)({a:x,b:y,backend:n,transposeA:!1,transposeB:!1,bias:a,activation:f,preluActivationWeights:o,leakyreluAlpha:l}),k=n.texData.get(b.dataId);(0,s.util).assert(k.isPacked,()=>"batchMatMul result is expected to be packed"),g.shape=v,k.shape=r.outShape,(h=(0,p.identity)({inputs:{x:b},backend:n})).shape=r.outShape,_.push(b)}else{let s=r.outHeight*r.outWidth,i=(0,c.reshape)({inputs:{x:e},backend:n,attrs:{shape:b?[r.batchSize,s,r.inChannels]:[r.batchSize,r.inChannels,s]}}),p=(0,c.reshape)({inputs:{x:t},backend:n,attrs:{shape:[1,r.inChannels,r.outChannels]}}),d=(0,u.batchMatMulImpl)({a:b?i:p,b:b?p:i,transposeA:!b,transposeB:!1,backend:n,bias:a,activation:f,preluActivationWeights:o,leakyreluAlpha:l});h=(0,c.reshape)({inputs:{x:d},backend:n,attrs:{shape:r.outShape}}),_.push(i),_.push(p),_.push(d)}for(let e of _)n.disposeIntermediateTensorInfo(e);return h}function h({x:e,filter:t,convInfo:r,backend:n,bias:i=null,preluActivationWeights:u=null,leakyreluAlpha:p=0,activation:f=null}){let{filterWidth:h,filterHeight:m,inChannels:g,outWidth:x,outHeight:v,dataFormat:y}=r,b="channelsLast"===y,_=h*m*g,k=v*x,j=[r.batchSize,_,k],I=[];if(null!=u){let e=d(u.shape,b);null!=e&&(u=(0,c.reshape)({inputs:{x:u},backend:n,attrs:{shape:e}}),I.push(u))}if(null!=i){let e=d(i.shape,b);null!=e&&(i=(0,c.reshape)({inputs:{x:i},backend:n,attrs:{shape:e}}),I.push(i))}let C=(0,c.reshape)({inputs:{x:t},backend:n,attrs:{shape:[1,_,(0,s.util).sizeFromShape(t.shape)/_]}});I.push(C);let w=new a.Im2ColPackedProgram(j,r),T=[e.shape,[r.padInfo.top,r.padInfo.left],[r.strideHeight,r.strideWidth],[r.dilationHeight,r.dilationWidth],[r.inChannels],[r.filterWidth*r.inChannels],[r.outWidth]],S=n.runWebGLProgram(w,[e],"float32",T),N=(0,c.reshape)({inputs:{x:S},backend:n,attrs:{shape:j}});I.push(S),I.push(N);let E=null!=i,F=null!=u,R="leakyrelu"===f,A=f?(0,o.mapActivationToShaderProgram)(f,!0):null,P=new l.MatMulPackedProgram(b?N.shape:C.shape,b?C.shape:N.shape,b?[r.batchSize,k,r.outChannels]:[r.batchSize,r.outChannels,k],!0,!1,E,A,F,R),D=b?[N,C]:[C,N];if(i&&D.push(i),F&&D.push(u),R){let e=n.makeTensorInfo([],"float32",(0,s.util).createScalarValue(p,"float32"));D.push(e),I.push(e)}let $=n.runWebGLProgram(P,D,"float32"),M=(0,c.reshape)({inputs:{x:$},backend:n,attrs:{shape:r.outShape}});for(let e of(I.push($),I))n.disposeIntermediateTensorInfo(e);return M}},{"@tensorflow/tfjs-core":"2nuhV","../im2col_packed_gpu":"4ijLh","../kernel_utils/kernel_funcs_utils":"jMepo","../mulmat_packed_gpu":"aI4G0","../webgl_util":"90dxa","./BatchMatMul_impl":"ioYKN","./Identity":"4GZPt","./Reshape":"cgfGf","@parcel/transformer-js/src/esmodule-helpers.js":"9pCYc"}],"4ijLh":[function(e,t,r){/** * @license * Copyright 2019 Google LLC. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. * ============================================================================= */var n=e("@parcel/transformer-js/src/esmodule-helpers.js");n.defineInteropFlag(r),n.export(r,"Im2ColPackedProgram",()=>o);var s=e("./glsl_version"),a=e("./gpgpu_math");class o{constructor(e,t){this.variableNames=["A"],this.packedInputs=!0,this.packedOutput=!0,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=(0,a.useShapeUniforms)(this.outputShape.length);let{dataFormat:r}=t,n=(0,s.getGlslDifferences)(),o="channelsLast"===r,l=o?1:2,i=o?2:3,u=this.enableShapeUniforms?"if(blockIndex< outShape[2] && pos < outShape[1]) {":`if(blockIndex < ${e[2]} && pos < ${e[1]}) {`,p="";for(let e=0;e<=1;e++)for(let t=0;t<=1;t++)p+=` blockIndex = rc.z + ${t}; pos = rc.y + ${e}; ${u} offsetY = int(blockIndex / outWidth) * stride[0] - pad[0]; d0 = offsetY + dilation[0] * (pos / itemsPerBlockRow); if(d0 < inputShape[${l}] && d0 >= 0) { // Use custom imod instead mod. On Intel GPU, mod may generate // unexpected value. // https://github.com/tensorflow/tfjs/issues/5447 offsetX = imod(blockIndex, outWidth) * stride[1] - pad[1]; d1 = offsetX + dilation[1] * (imod(pos, itemsPerBlockRow) / inChannels); if(d1< inputShape[${i}] && d1 >= 0) { ch = imod(pos, inChannels); if (${o}) { innerDims = vec2(d1, ch); result[${2*e+t}] = getChannel( getA(rc.x, d0, int(innerDims.x), int(innerDims.y)), innerDims); } else { innerDims = vec2(d0, d1); result[${2*e+t}] = getChannel( getA(rc.x, ch, int(innerDims.x), int(innerDims.y)), innerDims); } } } } `;this.userCode=` void main() { ivec3 rc = getOutputCoords(); vec4 result = vec4(0); int blockIndex, pos, offsetY, d0, offsetX, d1, ch; vec2 innerDims; ${p} ${n.output} = result; } `}}},{"./glsl_version":"aKRJc","./gpgpu_math":"f1P40","@parcel/transformer-js/src/esmodule-helpers.js":"9pCYc"}],bKBpL:[function(e,t,r){/** * @license * Copyright 2020 Google LLC. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. * ============================================================================= */var n=e("@parcel/transformer-js/src/esmodule-helpers.js");n.defineInteropFlag(r),n.export(r,"conv2DBackpropFilter",()=>o),n.export(r,"conv2DBackpropFilterConfig",()=>l);var s=e("@tensorflow/tfjs-core"),a=e("../conv_backprop_gpu");function o(e){let{inputs:t,backend:r,attrs:n}=e,{x:o,dy:l}=t,{strides:i,pad:u,dataFormat:p,dimRoundingMode:c,filterShape:d}=n,f=(0,s.backend_util).convertConv2DDataFormat(p),h=(0,s.backend_util).computeConv2DInfo(o.shape,d,i,1,u,c,!1,f),m=new a.Conv2DDerFilterProgram(h);return r.runWebGLProgram(m,[o,l],"float32")}let l={kernelName:s.Conv2DBackpropFilter,backendName:"webgl",kernelFunc:o}},{"@tensorflow/tfjs-core":"2nuhV","../conv_backprop_gpu":"9Sr0X","@parcel/transformer-js/src/esmodule-helpers.js":"9pCYc"}],"9Sr0X":[function(e,t,r){/** * @license * Copyright 2017 Google LLC. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. * ============================================================================= */var n=e("@parcel/transformer-js/src/esmodule-helpers.js");n.defineInteropFlag(r),n.export(r,"Conv2DDerFilterProgram",()=>s),n.export(r,"Conv2DDerInputProgram",()=>a),n.export(r,"Conv3DDerFilterProgram",()=>o),n.export(r,"Conv3DDerInputProgram",()=>l);class s{constructor(e){this.variableNames=["x","dy"],this.outputShape=e.filterShape;let t=e.strideHeight,r=e.strideWidth,n=e.padInfo.top,s=e.padInfo.left,a="channelsLast"===e.dataFormat;this.userCode=` void main() { ivec4 coords = getOutputCoords(); int wR = coords.x; int wC = coords.y; int d1 = coords.z; int d2 = coords.w; // Convolve x(?, ?, d1) with dy(:, :, d2) to get dw(wR, wC, d1, d2). // ? = to be determined. : = across all values in that axis. float dotProd = 0.0; 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 >= ${e.inHeight}) { continue; } for (int yC = 0; yC< ${e.outWidth}; yC++) { int xC = wC + yC * ${r} - ${s}; if (xC < 0 || xC >= ${e.inWidth}) { continue; } ${a?`float dyValue = getDy(b, yR, yC, d2); float xValue = getX(b, xR, xC, d1); dotProd += (xValue * dyValue);`:`float dyValue = getDy(b, d2, yR, yC); float xValue = getX(b, d1, xR, xC); dotProd += (xValue * dyValue);`} } } } setOutput(dotProd); } `}}class a{constructor(e){this.variableNames=["dy","W"],this.outputShape=e.inShape;let t=e.filterHeight,r=e.filterWidth,n=e.strideHeight,s=e.strideWidth,a="channelsLast"===e.dataFormat,o=t-1-e.padInfo.top,l=r-1-e.padInfo.left;this.userCode=` const ivec2 pads = ivec2(${o}, ${l}); void main() { ivec4 coords = getOutputCoords(); int batch = coords[0]; int d1 = coords[${a?3:1}]; ivec2 dyCorner = ivec2(coords[${a?1:2}], coords[${a?2:3}]) - 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< ${t}; wR++) { float dyR = float(dyRCorner + wR) / ${n}.0; if (dyR < 0.0 || dyR >= ${e.outHeight}.0 || fract(dyR) > 0.0) { continue; } int idyR = int(dyR); int wRPerm = ${t} - 1 - wR; for (int wC = 0; wC< ${r}; wC++) { float dyC = float(dyCCorner + wC) / ${s}.0; if (dyC < 0.0 || dyC >= ${e.outWidth}.0 || fract(dyC) > 0.0) { continue; } int idyC = int(dyC); int wCPerm = ${r} - 1 - wC; for (int d2 = 0; d2< ${e.outChannels}; d2++) { if (${a}) { float xValue = getDy(batch, idyR, idyC, d2); float wValue = getW(wRPerm, wCPerm, d1, d2); dotProd += xValue * wValue; } else { float xValue = getDy(batch, d2, idyR, idyC); float wValue = getW(wRPerm, wCPerm, d1, d2); dotProd += xValue * wValue; } } } } setOutput(dotProd); } `}}class o{constructor(e){this.variableNames=["x","dy"],this.outputShape=e.filterShape;let t=e.strideDepth,r=e.strideHeight,n=e.strideWidth,s=e.padInfo.front,a=e.padInfo.top,o=e.padInfo.left;this.userCode=` void main() { ivec5 coords = getOutputCoords(); int wF = coords.x; int wR = coords.y; int wC = coords.z; int d1 = coords.w; int d2 = coords.u; float dotProd = 0.0; 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 >= ${e.inDepth}) { continue; } for (int yR = 0; yR< ${e.outHeight}; yR++) { int xR = wR + yR * ${r} - ${a}; if (xR < 0 || xR >= ${e.inHeight}) { continue; } for (int yC = 0; yC< ${e.outWidth}; yC++) { int xC = wC + yC * ${n} - ${o}; if (xC < 0 || xC >= ${e.inWidth}) { continue; } float dyValue = getDy(b, yF, yR, yC, d2); float xValue = getX(b, xF, xR, xC, d1); dotProd += (xValue * dyValue); } } } } setOutput(dotProd); } `}}class l{constructor(e){this.variableNames=["dy","W"],this.outputShape=e.inShape;let t=e.filterDepth,r=e.filterHeight,n=e.filterWidth,s=e.strideDepth,a=e.strideHeight,o=e.strideWidth,l=t-1-e.padInfo.front,i=r-1-e.padInfo.top,u=n-1-e.padInfo.left;this.userCode=` const ivec3 pads = ivec3(${l}, ${i}, ${u}); void main() { ivec5 coords = getOutputCoords(); int batch = coords.x; int d1 = coords.u; ivec3 dyCorner = ivec3(coords.y, coords.z, coords.w) - pads; int dyFCorner = dyCorner.x; int dyRCorner = dyCorner.y; int dyCCorner = dyCorner.z; float dotProd = 0.0; for (int wF = 0; wF< ${t}; wF++) { float dyF = float(dyFCorner + wF) / ${s}.0; if (dyF < 0.0 || dyF >= ${e.outDepth}.0 || fract(dyF) > 0.0) { continue; } int idyF = int(dyF); int wFPerm = ${t} - 1 - wF; for (int wR = 0; wR< ${r}; wR++) { float dyR = float(dyRCorner + wR) / ${a}.0; if (dyR < 0.0 || dyR >= ${e.outHeight}.0 || fract(dyR) > 0.0) { continue; } int idyR = int(dyR); int wRPerm = ${r} - 1 - wR; for (int wC = 0; wC< ${n}; wC++) { float dyC = float(dyCCorner + wC) / ${o}.0; if (dyC < 0.0 || dyC >= ${e.outWidth}.0 || fract(dyC) > 0.0) { continue; } int idyC = int(dyC); int wCPerm = ${n} - 1 - wC; 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; } } } } setOutput(dotProd); } `}}},{"@parcel/transformer-js/src/esmodule-helpers.js":"9pCYc"}],"5rapU":[function(e,t,r){/** * @license * Copyright 2020 Google LLC. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. * ============================================================================= */var n=e("@parcel/transformer-js/src/esmodule-helpers.js");n.defineInteropFlag(r),n.export(r,"conv2DBackpropInput",()=>l),n.export(r,"conv2DBackpropInputConfig",()=>i);var s=e("@tensorflow/tfjs-core"),a=e("../conv_backprop_gpu"),o=e("../conv_backprop_packed_gpu");function l(e){let{inputs:t,backend:r,attrs:n}=e,{dy:l,filter:i}=t,{inputShape:u,strides:p,pad:c,dataFormat:d,dimRoundingMode:f}=n,h=(0,s.backend_util).convertConv2DDataFormat(d),m=(0,s.backend_util).computeConv2DInfo(u,i.shape,p,1,c,f,!1,h);if((0,s.env)().getBool("WEBGL_PACK_CONV2DTRANSPOSE")&&"channelsLast"===h){let e=[[m.strideHeight,m.strideWidth]],t=new o.Conv2DDerInputPackedProgram(m);return r.runWebGLProgram(t,[l,i],"float32",e)}{let e=new a.Conv2DDerInputProgram(m);return r.runWebGLProgram(e,[l,i],"float32")}}let i={kernelName:s.Conv2DBackpropInput,backendName:"webgl",kernelFunc:l}},{"@tensorflow/tfjs-core":"2nuhV","../conv_backprop_gpu":"9Sr0X","../conv_backprop_packed_gpu":"jmy7H","@parcel/transformer-js/src/esmodule-helpers.js":"9pCYc"}],jmy7H:[function(e,t,r){/** * @license * Copyright 2023 Google LLC. * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. * ============================================================================= */var n=e("@parcel/transformer-js/src/esmodule-helpers.js");n.defineInteropFlag(r),n.export(r,"Conv2DDerInputPackedProgram",()=>a);var s=e("./gpgpu_math");class a{constructor(e){this.variableNames=["dy","W"],this.packedInputs=!0,this.packedOutput=!0,this.customUniforms=[{name:"strides",type:"vec2"}],this.outputShape=e.inShape,this.enableShapeUniforms=(0,s.useShapeUniforms)(this.outputShape.length);let t=e.filterHeight,r=e.filterWidth,n=t-1-e.padInfo.top,a=r-1-e.padInfo.left;this.userCode=` const ivec2 pads = ivec2(${n}, ${a}); void main() { ivec4 coords = getOutputCoords(); int batch = coords[0]; int d1 = coords[3]; ivec2 dyCorner = ivec2(coords[1], coords[2]) - pads; int dyRCorner = dyCorner.x; int dyCCorner = dyCorner.y; vec4 result = vec4(0.); for (int wR = 0; wR< ${t}; wR++) { float dyR = float(dyRCorner + wR) / strides[0]; if (dyR < 0.0 || dyR >= ${e.outHeight}.0 || fract(dyR) > 0.0) { continue; } int idyR = int(dyR); int wRPerm = ${t} - 1 - wR; for (int wC = 0; wC< ${r}; wC++) { int wCPerm = ${r} - 1 - wC; float dyC = float(dyCCorner + wC) / strides[1]; 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< ${e.outWidth}.0) && (fract(dyC2) == 0.0); int idyC2 = int(dyC2); if (idyCVal && idyCVal2) { 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) ? dySample : getDy(batch, idyR, idyC2, d2); vec2 dyValue = mod(float(idyC), 2.) == 0. ? dySample.xy : dySample.zw; result.xy += vec2(dot(dyValue, wValue.xy), dot(dyValue, wValue.zw)); dyValue = mod(float(idyC2), 2.) == 0. ? dySample2.xy : dySample2.zw; result.zw += vec2(dot(dyValue, wValue.xy), dot(dyValue, wValue.zw)); } } else if (idyCVal) { 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. ? dySample.xy : dySample.zw; result.xy += vec2(dot(dyValue, wValue.xy), dot(dyValue, wValue.zw)); } } else if (idyCVal2) { 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. ? dySample.xy : dySample.zw; result.zw += vec2(dot(dyValue, wValue.xy), dot(dyValue, wValue.zw)); } } } } setOutput(result); } `}}},{"./gpgpu_math":"f1P40","@parcel/transformer-js/src/esmodule-helpers.js":"9pCYc"}],j8BRE:[function(e,t,r){/** * @license * Copyright 2020 Google LLC. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. * ============================================================================= */var n=e("@parcel/transformer-js/src/esmodule-helpers.js");n.defineInteropFlag(r),n.export(r,"conv3D",()=>o),n.export(r,"conv3DConfig",()=>l);var s=e("@tensorflow/tfjs-core"),a=e("../conv_gpu");function o(e){let{inputs:t,backend:r,attrs:n}=e,{x:o,filter:l}=t,{strides:i,pad:u,dilations:p}=n,c=(0,s.backend_util).computeConv3DInfo(o.shape,l.shape,i,p,u),d=new a.Conv3DProgram(c);return r.runWebGLProgram(d,[o,l],"float32")}let l={kernelName:s.Conv3D,backendName:"webgl",kernelFunc:o}},{"@tensorflow/tfjs-core":"2nuhV","../conv_gpu":"luVZB","@parcel/transformer-js/src/esmodule-helpers.js":"9pCYc"}],dNJCE:[function(e,t,r){/** * @license * Copyright 2020 Google LLC. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. * ============================================================================= */var n=e("@parcel/transformer-js/src/esmodule-helpers.js");n.defineInteropFlag(r),n.export(r,"conv3DBackpropFilterV2",()=>o),n.export(r,"conv3DBackpropFilterV2Config",()=>l);var s=e("@tensorflow/tfjs-core"),a=e("../conv_backprop_gpu");function o(e){let{inputs:t,backend:r,attrs:n}=e,{x:o,dy:l}=t,{strides:i,pad:u,filterShape:p}=n,c=(0,s.backend_util).computeConv3DInfo(o.shape,p,i,1,u),d=new a.Conv3DDerFilterProgram(c);return r.runWebGLProgram(d,[o,l],"float32")}let l={kernelName:s.Conv3DBackpropFilterV2,backendName:"webgl",kernelFunc:o}},{"@tensorflow/tfjs-core":"2nuhV","../conv_backprop_gpu":"9Sr0X","@parcel/transformer-js/src/esmodule-helpers.js":"9pCYc"}],k11Sv:[function(e,t,r){/** * @license * Copyright 2020 Google LLC. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. * ============================================================================= */var n=e("@parcel/transformer-js/src/esmodule-helpers.js");n.defineInteropFlag(r),n.export(r,"conv3DBackpropInput",()=>o),n.export(r,"conv3DBackpropInputConfig",()=>l);var s=e("@tensorflow/tfjs-core"),a=e("../conv_backprop_gpu");function o(e){let{inputs:t,backend:r,attrs:n}=e,{dy:o,filter:l}=t,{pad:i,strides:u,inputShape:p}=n,c=(0,s.backend_util).computeConv3DInfo(p,l.shape,u,1,i),d=new a.Conv3DDerInputProgram(c);return r.runWebGLProgram(d,[o,l],"float32")}let l={kernelName:s.Conv3DBackpropInputV2,backendName:"webgl",kernelFunc:o}},{"@tensorflow/tfjs-core":"2nuhV","../conv_backprop_gpu":"9Sr0X","@parcel/transformer-js/src/esmodule-helpers.js":"9pCYc"}],eTcSM:[function(e,t,r){/** * @license * Copyright 2020 Google LLC. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. * ============================================================================= */var n=e("@parcel/transformer-js/src/esmodule-helpers.js");n.defineInteropFlag(r),n.export(r,"cos",()=>u),n.export(r,"cosConfig",()=>p);var s=e("@tensorflow/tfjs-core"),a=e("../binaryop_packed_gpu"),o=e("../kernel_utils/kernel_funcs_utils");let l=o.CHECK_NAN_SNIPPET_UNARY+` return cos(x); `,i=` vec4 result = cos(x); bvec4 isNaN = isnan(x); ${a.CHECK_NAN_SNIPPET_PACKED} return result; `,u=(0,o.unaryKernelFunc)({opSnippet:l,packedOpSnippet:i}),p={kernelName:s.Cos,backendName:"webgl",kernelFunc:u}},{"@tensorflow/tfjs-core":"2nuhV","../binaryop_packed_gpu":"f1UiT","../kernel_utils/kernel_funcs_utils":"jMepo","@parcel/transformer-js/src/esmodule-helpers.js":"9pCYc"}],dmuwg:[function(e,t,r){/** * @license * Copyright 2020 Google LLC. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. * ============================================================================= */var n=e("@parcel/transformer-js/src/esmodule-helpers.js");n.defineInteropFlag(r),n.export(r,"cosh",()=>l),n.export(r,"coshConfig",()=>i);var s=e("@tensorflow/tfjs-core"),a=e("../kernel_utils/kernel_funcs_utils");let o=` float e2x = exp(-x); return (e2x + 1.0 / e2x) / 2.0; `,l=(0,a.unaryKernelFunc)({opSnippet:o}),i={kernelName:s.Cosh,backendName:"webgl",kernelFunc:l}},{"@tensorflow/tfjs-core":"2nuhV","../kernel_utils/kernel_funcs_utils":"jMepo","@parcel/transformer-js/src/esmodule-helpers.js":"9pCYc"}],dF1gD:[function(e,t,r){/** * @license * Copyright 2020 Google LLC. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. * ============================================================================= */var n=e("@parcel/transformer-js/src/esmodule-helpers.js");n.defineInteropFlag(r),n.export(r,"cropAndResize",()=>o),n.export(r,"cropAndResizeConfig",()=>l);var s=e("@tensorflow/tfjs-core"),a=e("../crop_and_resize_gpu");let o=e=>{let{inputs:t,backend:r,attrs:n}=e,{image:s,boxes:o,boxInd:l}=t,{cropSize:i,method:u,extrapolationValue:p}=n,c=new a.CropAndResizeProgram(s.shape,o.shape,i,u,p);return r.runWebGLProgram(c,[s,o,l],"float32")},l={kernelName:s.CropAndResize,backendName:"webgl",kernelFunc:o}},{"@tensorflow/tfjs-core":"2nuhV","../crop_and_resize_gpu":"5cd3R","@parcel/transformer-js/src/esmodule-helpers.js":"9pCYc"}],"5cd3R":[function(e,t,r){/** * @license * Copyright 2017 Google LLC. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. * ============================================================================= */var n=e("@parcel/transformer-js/src/esmodule-helpers.js");n.defineInteropFlag(r),n.export(r,"CropAndResizeProgram",()=>s);class s{constructor(e,t,r,n,s){this.variableNames=["Image","Boxes","BoxInd"],this.outputShape=[];let[a,o,l,i]=e,[u]=t,[p,c]=r;this.outputShape=[u,p,c,i];let[d,f]=[`${o-1}.0`,`${l-1}.0`],[h,m,g]=p>1?[`${(o-1)/(p-1)}`,"(y2-y1) * height_ratio",`y1*${d} + float(y)*(height_scale)`]:["0.0","0.0",`0.5 * (y1+y2) * ${d}`],[x,v,y]=c>1?[`${(l-1)/(c-1)}`,"(x2-x1) * width_ratio",`x1*${f} + float(x)*(width_scale)`]:["0.0","0.0",`0.5 * (x1+x2) * ${f}`];this.userCode=` const float height_ratio = float(${h}); const float width_ratio = float(${x}); void main() { ivec4 coords = getOutputCoords(); int b = coords[0]; int y = coords[1]; int x = coords[2]; int d = coords[3]; // get box vals float y1 = getBoxes(b,0); float x1 = getBoxes(b,1); float y2 = getBoxes(b,2); float x2 = getBoxes(b,3); // get image in batch index int bInd = round(getBoxInd(b)); if(bInd< 0 || bInd >= ${a}) { return; } float height_scale = ${m}; float width_scale = ${v}; float in_y = ${g}; if( in_y< 0.0 || in_y >${d} ) { setOutput(float(${s})); return; } float in_x = ${y}; if( in_x< 0.0 || in_x >${f} ) { setOutput(float(${s})); return; } vec2 sourceFracIndexCR = vec2(in_x,in_y); if(${"bilinear"===n?1:0} == 1) { // Compute the four integer indices. ivec2 sourceFloorCR = ivec2(sourceFracIndexCR); ivec2 sourceCeilCR = ivec2(ceil(sourceFracIndexCR)); float topLeft = getImage(b, sourceFloorCR.y, sourceFloorCR.x, d); float bottomLeft = getImage(b, sourceCeilCR.y, sourceFloorCR.x, d); float topRight = getImage(b, sourceFloorCR.y, sourceCeilCR.x, d); float bottomRight = getImage(b, sourceCeilCR.y, sourceCeilCR.x, d); vec2 fracCR = sourceFracIndexCR - vec2(sourceFloorCR); float top = topLeft + (topRight - topLeft) * fracCR.x; float bottom = bottomLeft + (bottomRight - bottomLeft) * fracCR.x; float newValue = top + (bottom - top) * fracCR.y; setOutput(newValue); } else { // Compute the coordinators of nearest neighbor point. ivec2 sourceNearestCR = ivec2(floor( sourceFracIndexCR + vec2(0.5,0.5))); float newValue = getImage(b, sourceNearestCR.y, sourceNearestCR.x, d); setOutput(newValue); } } `}}},{"@parcel/transformer-js/src/esmodule-helpers.js":"9pCYc"}],dTkdA:[function(e,t,r){/** * @license * Copyright 2022 Google LLC. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. * ============================================================================= */var n=e("@parcel/transformer-js/src/esmodule-helpers.js");n.defineInteropFlag(r),n.export(r,"cumprod",()=>l),n.export(r,"cumprodConfig",()=>i);var s=e("@tensorflow/tfjs-core"),a=e("../cum_gpu"),o=e("./Cum_impl");function l(e){let{inputs:t,backend:r,attrs:n}=e,{x:s}=t,{axis:l,exclusive:i,reverse:u}=n;return(0,o.cumImpl)(a.CumOpType.Prod,s,r,l,i,u)}let i={kernelName:s.Cumprod,backendName:"webgl",kernelFunc:l}},{"@tensorflow/tfjs-core":"2nuhV","../cum_gpu":"jdR5r","./Cum_impl":"gfPb4","@parcel/transformer-js/src/esmodule-helpers.js":"9pCYc"}],jdR5r:[function(e,t,r){var n,s,a=e("@parcel/transformer-js/src/esmodule-helpers.js");a.defineInteropFlag(r),a.export(r,"CumOpType",()=>s),a.export(r,"CumProgram",()=>l);var o=e("./shader_compiler");(n=s||(s={})).Prod="*",n.Sum="+";class l{constructor(e,t,r,n){this.op=e,this.outputShape=t,this.variableNames=["x"],this.customUniforms=[{name:"index",type:"float"}];let a=this.outputShape.length,l=this.op===s.Prod?"1.0":"0.0",p=r?l:`getX(${i(a,"coords",this.op)})`,c=this.outputShape[this.outputShape.length-1],d="",f="";r?(d=n?`end != ${c-1}`:"end != 0",f=n?"end + 1":"end - 1"):(d=n?`end + pow2< ${c}`:"end >= pow2",f=n?"end + pow2":"end - pow2"),this.userCode=` void main() { ${(0,o.getCoordsDataType)(a)} coords = getOutputCoords(); int end = ${u(a,"coords",this.op)}; float val = ${p}; int pow2 = int(pow(2.0, index)); if (${d}) { int idx = ${f}; ${u(a,"coords",this.op)} = idx; val ${this.op}= getX(${i(a,"coords",this.op)}); } setOutput(val); } `}}function i(e,t,r){if(1===e)return`${t}`;if(2===e)return`${t}.x, ${t}.y`;if(3===e)return`${t}.x, ${t}.y, ${t}.z`;if(4===e)return`${t}.x, ${t}.y, ${t}.z, ${t}.w`;throw Error(`Cumulative ${r} for rank ${e} is not yet supported`)}function u(e,t,r){if(1===e)return`${t}`;if(2===e)return`${t}.y`;if(3===e)return`${t}.z`;if(4===e)return`${t}.w`;throw Error(`Cumulative ${r} for rank ${e} is not yet supported`)}},{"./shader_compiler":"3kYYB","@parcel/transformer-js/src/esmodule-helpers.js":"9pCYc"}],gfPb4:[function(e,t,r){/** * @license * Copyright 2022 Google LLC. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. * ============================================================================= */var n=e("@parcel/transformer-js/src/esmodule-helpers.js");n.defineInteropFlag(r),n.export(r,"cumImpl",()=>i);var s=e("@tensorflow/tfjs-core"),a=e("../cum_gpu"),o=e("./Identity"),l=e("./Transpose");function i(e,t,r,n,i,u){let p=t.shape.length,c=(0,s.backend_util).getAxesPermutation([n],p),d=t;null!=c&&(d=(0,l.transpose)({inputs:{x:t},backend:r,attrs:{perm:c}}));let f=(0,s.backend_util).getInnerMostAxes(1,p)[0];if(f!==p-1)throw Error(`WebGL cumprod shader expects an inner-most axis=${t.shape.length-1} but got axis=${n}`);let h=d.shape[f],m=(0,o.identity)({inputs:{x:d},backend:r});for(let t=0;t<=Math.ceil(Math.log2(h))-1;t++){let n=new a.CumProgram(e,d.shape,!1,u),s=[[t]],o=m;m=r.runWebGLProgram(n,[m],m.dtype,s),r.disposeIntermediateTensorInfo(o)}if(i){let t=new a.CumProgram(e,d.shape,i,u),n=m;m=r.runWebGLProgram(t,[m],m.dtype),r.disposeIntermediateTensorInfo(n)}if(null!=c){let e=(0,s.backend_util).getUndoAxesPermutation(c),t=(0,l.transpose)({inputs:{x:m},backend:r,attrs:{perm:e}});return r.disposeIntermediateTensorInfo(m),r.disposeIntermediateTensorInfo(d),t}return m}},{"@tensorflow/tfjs-core":"2nuhV","../cum_gpu":"jdR5r","./Identity":"4GZPt","./Transpose":"jIlsI","@parcel/transformer-js/src/esmodule-helpers.js":"9pCYc"}],be0FU:[function(e,t,r){/** * @license * Copyright 2022 Google LLC. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. * ============================================================================= */var n=e("@parcel/transformer-js/src/esmodule-helpers.js");n.defineInteropFlag(r),n.export(r,"cumsum",()=>l),n.export(r,"cumsumConfig",()=>i);var s=e("@tensorflow/tfjs-core"),a=e("../cum_gpu"),o=e("./Cum_impl");function l(e){let{inputs:t,backend:r,attrs:n}=e,{x:s}=t,{axis:l,exclusive:i,reverse:u}=n;return(0,o.cumImpl)(a.CumOpType.Sum,s,r,l,i,u)}let i={kernelName:s.Cumsum,backendName:"webgl",kernelFunc:l}},{"@tensorflow/tfjs-core":"2nuhV","../cum_gpu":"jdR5r","./Cum_impl":"gfPb4","@parcel/transformer-js/src/esmodule-helpers.js":"9pCYc"}],"1Cvpk":[function(e,t,r){/** * @license * Copyright 2020 Google LLC. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. * ============================================================================= */var n=e("@parcel/transformer-js/src/esmodule-helpers.js");n.defineInteropFlag(r),n.export(r,"denseBincount",()=>o),n.export(r,"denseBincountConfig",()=>l);var s=e("@tensorflow/tfjs-core"),a=e("../kernel_utils/shared");function o(e){let{inputs:t,backend:r,attrs:n}=e,{x:s,weights:o}=t,{size:l,binaryOutput:i}=n;if(1===s.shape.length){let e=r.readSync(s.dataId),t=r.readSync(o.dataId),n=(0,a.bincountImplCPU)(e,t,o.dtype,o.shape,l);return r.makeTensorInfo([l],o.dtype,n)}if(2===s.shape.length){let e=r.bufferSync(s),t=r.bufferSync(o),n=(0,a.bincountReduceImplCPU)(e,t,l,i);return r.makeTensorInfo(n.shape,o.dtype,n.values)}throw Error(`Error in denseBincount: input must be at most rank 2, but got rank${s.shape.length}.`)}let l={kernelName:s.DenseBincount,backendName:"webgl",kernelFunc:o}},{"@tensorflow/tfjs-core":"2nuhV","../kernel_utils/shared":"01kMd","@parcel/transformer-js/src/esmodule-helpers.js":"9pCYc"}],"2cZK3":[function(e,t,r){/** * @license * Copyright 2020 Google LLC. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. * ============================================================================= */var n=e("@parcel/transformer-js/src/esmodule-helpers.js");n.defineInteropFlag(r),n.export(r,"depthToSpace",()=>o),n.export(r,"depthToSpaceConfig",()=>l);var s=e("@tensorflow/tfjs-core"),a=e("../depth_to_space_gpu");function o(e){let{inputs:t,backend:r,attrs:n}=e,{x:s}=t,{blockSize:o,dataFormat:l}=n,i=s.shape[0],u="NHWC"===l?s.shape[1]:s.shape[2],p="NHWC"===l?s.shape[2]:s.shape[3],c="NHWC"===l?s.shape[3]:s.shape[1],d=u*o,f=p*o,h=c/(o*o),m=new a.DepthToSpaceProgram("NHWC"===l?[i,d,f,h]:[i,h,d,f],o,l);return r.runWebGLProgram(m,[s],s.dtype)}let l={kernelName:s.DepthToSpace,backendName:"webgl",kernelFunc:o}},{"@tensorflow/tfjs-core":"2nuhV","../depth_to_space_gpu":"e7PKB","@parcel/transformer-js/src/esmodule-helpers.js":"9pCYc"}],e7PKB:[function(e,t,r){/** * @license * Copyright 2018 Google LLC. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. * ============================================================================= */var n=e("@parcel/transformer-js/src/esmodule-helpers.js");n.defineInteropFlag(r),n.export(r,"DepthToSpaceProgram",()=>s);class s{constructor(e,t,r){this.variableNames=["x"],this.outputShape=[],this.outputShape=e,this.blockSize=t,this.dataFormat=r,this.userCode=` void main() { ivec4 coords = getOutputCoords(); int b = coords[0]; int h = ${this.getHeightCoordString()}; int w = ${this.getWidthCoordString()}; int d = ${this.getDepthCoordString()}; 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"NHWC"===this.dataFormat?"coords[1]":"coords[2]"}getWidthCoordString(){return"NHWC"===this.dataFormat?"coords[2]":"coords[3]"}getDepthCoordString(){return"NHWC"===this.dataFormat?"coords[3]":"coords[1]"}getOutputDepthSize(){return"NHWC"===this.dataFormat?this.outputShape[3]:this.outputShape[1]}getInputSamplingString(){return"NHWC"===this.dataFormat?"getX(b, in_h, in_w, in_d)":"getX(b, in_d, in_h, in_w)"}}},{"@parcel/transformer-js/src/esmodule-helpers.js":"9pCYc"}],csjtT:[function(e,t,r){/** * @license * Copyright 2020 Google LLC. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. * ============================================================================= */var n=e("@parcel/transformer-js/src/esmodule-helpers.js");n.defineInteropFlag(r),n.export(r,"depthwiseConv2dNative",()=>l),n.export(r,"depthwiseConv2dNativeConfig",()=>i);var s=e("@tensorflow/tfjs-core"),a=e("../conv_gpu_depthwise"),o=e("../conv_packed_gpu_depthwise");function l(e){let t;let{inputs:r,backend:n,attrs:l}=e,{x:i,filter:u}=r,{strides:p,pad:c,dilations:d,dimRoundingMode:f}=l,h=d;null==h&&(h=[1,1]),(0,s.util).assert((0,s.backend_util).eitherStridesOrDilationsAreOne(p,h),()=>`Error in depthwiseConv2d: Either strides or dilations must be 1. Got strides ${p} and dilations '${h}'`);let m=(0,s.backend_util).computeConv2DInfo(i.shape,u.shape,p,h,c,f,!0);t=(0,s.env)().getBool("WEBGL_PACK_DEPTHWISECONV")&&m.strideWidth<=2&&m.outChannels/m.inChannels==1?new o.DepthwiseConvPacked2DProgram(m):new a.DepthwiseConv2DProgram(m);let g=[[m.padInfo.top,m.padInfo.left],[m.strideHeight,m.strideWidth],[m.dilationHeight,m.dilationWidth],[m.inHeight,m.inWidth]];return n.runWebGLProgram(t,[i,u],"float32",g)}let i={kernelName:s.DepthwiseConv2dNative,backendName:"webgl",kernelFunc:l}},{"@tensorflow/tfjs-core":"2nuhV","../conv_gpu_depthwise":"cQOMv","../conv_packed_gpu_depthwise":"grFEk","@parcel/transformer-js/src/esmodule-helpers.js":"9pCYc"}],cQOMv:[function(e,t,r){/** * @license * Copyright 2017 Google LLC. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. * ============================================================================= */var n=e("@parcel/transformer-js/src/esmodule-helpers.js");n.defineInteropFlag(r),n.export(r,"DepthwiseConv2DProgram",()=>a);var s=e("./gpgpu_math");class a{constructor(e,t=!1,r=null,n=!1,a=!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=(0,s.useShapeUniforms)(this.outputShape.length);let o=e.filterHeight,l=e.filterWidth,i=e.outChannels/e.inChannels,u="",p="";r&&(u=n?`float activation(float a) { float b = getPreluActivationWeightsAtOutCoords(); ${r} }`:a?`float activation(float a) { float b = getLeakyreluAlphaAtOutCoords(); ${r} }`:` float activation(float x) { ${r} } `,p="result = activation(result);"),t&&this.variableNames.push("bias"),n&&this.variableNames.push("preluActivationWeights"),a&&this.variableNames.push("leakyreluAlpha"),this.userCode=` ${u} void main() { ivec4 coords = getOutputCoords(); int batch = coords.x; ivec2 xRCCorner = coords.yz * strides - pads; int d2 = coords.w; int d1 = d2 / ${i}; int q = d2 - d1 * ${i}; int xRCorner = xRCCorner.x; int xCCorner = xRCCorner.y; // Convolve x(?, ?, d1) with w(:, :, d1, q) to get y(yR, yC, d2). // ? = to be determined. : = across all values in that axis. float dotProd = 0.0; // TO DO(dsmilkov): Flatten the two for loops and vec4 the operations. for (int wR = 0; wR< ${o}; wR++) { int xR = xRCorner + wR * dilations[0]; if (xR < 0 || xR >= inDims[0]) { continue; } for (int wC = 0; wC< ${l}; wC++) { int xC = xCCorner + wC * dilations[1]; if (xC < 0 || xC >= inDims[1]) { continue; } float xVal = getX(batch, xR, xC, d1); float wVal = getW(wR, wC, d1, q); dotProd += xVal * wVal; } } float result = dotProd; ${t?"result += getBiasAtOutCoords();":""} ${p} setOutput(result); } `}}},{"./gpgpu_math":"f1P40","@parcel/transformer-js/src/esmodule-helpers.js":"9pCYc"}],grFEk:[function(e,t,r){/** * @license * Copyright 2018 Google LLC. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. * ============================================================================= */var n=e("@parcel/transformer-js/src/esmodule-helpers.js");n.defineInteropFlag(r),n.export(r,"DepthwiseConvPacked2DProgram",()=>o);var s=e("@tensorflow/tfjs-core"),a=e("./gpgpu_math");class o{constructor(e,t=!1,r=null,n=!1,o=!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=(0,a.useShapeUniforms)(this.outputShape.length);let l=e.outChannels/e.inChannels,i=e.padInfo.left,u=e.strideWidth,p=e.dilationWidth,c=e.filterHeight,d=e.filterWidth,f=` int xR; int xC; int xCOffset; vec4 wTexel; vec4 previous; vec4 final;`;for(let e=0;e=0 && xR< inDims[0]) { `;for(let e=0;e<(d+1)/2;e++){let t=2*e;if(f+=` xC = xCCorner + ${t*p}; `,1===u){if(t= 0 && xCOffset< inDims[1] && xTexelC${t}Ready == 0) { xTexelC${t} = getX(batch, xR, xCOffset, d1); // Need to manually clear unused channels in case // we're reading from recycled texture. if (xCOffset + 1 >= inDims[1]) { xTexelC${t}.zw = vec2(0.0); } xTexelC${t}Ready = 1; } `,1===p&&t>0?f+=` xC${t} = vec4(xTexelC${t-2}.zw, xTexelC${t}.xy); `:f+=` xCOffset = xC + 1 - 2; if (xCOffset >= 0 && xCOffset< inDims[1]) { previous = getX(batch, xR, xCOffset, d1); // Need to manually clear unused channels in case // we're reading from recycled texture. if (xCOffset + 1 >= inDims[1]) { previous.zw = vec2(0.0); } xC${t} = vec4(previous.zw, xTexelC${t}.xy); } else { xC${t} = vec4(0.0, 0.0, xTexelC${t}.xy); } `):f+=` if (xC >= 0 && xC< inDims[1] && xTexelC${t}Ready == 0) { xTexelC${t} = getX(batch, xR, xC, d1); if (xC + 1 >= inDims[1]) { xTexelC${t}.zw = vec2(0.0); } xTexelC${t}Ready = 1; } xC${t} = xTexelC${t}; `,t+1= 0 && xCOffset< inDims[1] && xTexelC${t+1}Ready == 0) { xTexelC${t+1} = getX(batch, xR, xCOffset, d1); // Need to manually clear unused channels in case // we're reading from recycled texture. if (xCOffset + 1 >= inDims[1]) { xTexelC${t+1}.zw = vec2(0.0); } xTexelC${t+1}Ready = 1; } `,p>1?f+=` xCOffset -= 2; if (xCOffset >= 0 && xCOffset< inDims[1]) { previous = getX(batch, xR, xCOffset, d1); xC${t+1} = vec4(previous.zw, xTexelC${t+1}.xy); } else { xC${t+1} = vec4(0.0, 0.0, xTexelC${t+1}.xy); } `:f+=` xC${t+1} = vec4(xTexelC${t}.zw, xTexelC${t+1}.xy); `):1===e?f+=` xC${t+1} = xTexelC${t}; `:f+=` xCOffset = xC + ${e}; if (xCOffset >= 0 && xCOffset< inDims[1] && xTexelC${t+1}Ready == 0) { xTexelC${t+1} = getX(batch, xR, xCOffset, d1); if (xCOffset + 1 >= inDims[1]) { xTexelC${t+1}.zw = vec2(0.0); } xTexelC${t+1}Ready = 1; } xC${t+1} = xTexelC${t+1}; `}}else t= 0 && xCOffset< inDims[1] && xTexelC${t}Ready == 0) { xTexelC${t} = getX(batch, xR, xCOffset, d1); // Need to manually clear unused channels in case // we're reading from recycled texture. if (xCOffset + 1 >= inDims[1]) { xTexelC${t}.zw = vec2(0.0); } xTexelC${t}Ready = 1; } if(xC + 1 >= 0 && xC + 1< inDims[1] && xTexelC${t+1}Ready == 0) { xTexelC${t+1} = getX(batch, xR, xC + 1, d1); // Need to manually clear unused channels in case // we're reading from recycled texture. if (xC + 2 >= inDims[1]) { xTexelC${t+1}.zw = vec2(0.0); } xTexelC${t+1}Ready = 1; } xC${t} = vec4(xTexelC${t}.zw, xTexelC${t+1}.zw); `,t+1= 0 && xCOffset< inDims[1]) { final = getX(batch, xR, xCOffset, d1); } xC${t+1} = vec4(xTexelC${t+1}.xy, final.xy); `)):(f+=` if(xC >= 0 && xC< inDims[1] && xTexelC${t}Ready == 0) { xTexelC${t} = getX(batch, xR, xC, d1); if (xC + 1 >= inDims[1]) { xTexelC${t}.zw = vec2(0.0); } xTexelC${t}Ready = 1; } xCOffset = xC + strides[1]; if(xCOffset >= 0 && xCOffset< inDims[1] && xTexelC${t+1}Ready == 0) { xTexelC${t+1} = getX(batch, xR, xCOffset, d1); if (xCOffset + 1 >= inDims[1]) { xTexelC${t+1}.zw = vec2(0.); } xTexelC${t+1}Ready = 1; } xC${t} = vec4( xTexelC${t}.xy, xTexelC${t+1}.xy); `,t+1o),n.export(r,"depthwiseConv2dNativeBackpropFilterConfig",()=>l);var s=e("@tensorflow/tfjs-core"),a=e("../conv_backprop_gpu_depthwise");function o(e){let{inputs:t,backend:r,attrs:n}=e,{x:o,dy:l}=t,{strides:i,dilations:u,pad:p,dimRoundingMode:c,filterShape:d}=n,f=(0,s.backend_util).computeConv2DInfo(o.shape,d,i,u,p,c,!0),h=new a.DepthwiseConv2DDerFilterProgram(f);return r.runWebGLProgram(h,[o,l],"float32")}let l={kernelName:s.DepthwiseConv2dNativeBackpropFilter,backendName:"webgl",kernelFunc:o}},{"@tensorflow/tfjs-core":"2nuhV","../conv_backprop_gpu_depthwise":"2dMvT","@parcel/transformer-js/src/esmodule-helpers.js":"9pCYc"}],"2dMvT":[function(e,t,r){/** * @license * Copyright 2018 Google LLC. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. * ============================================================================= */var n=e("@parcel/transformer-js/src/esmodule-helpers.js");n.defineInteropFlag(r),n.export(r,"DepthwiseConv2DDerFilterProgram",()=>s),n.export(r,"DepthwiseConv2DDerInputProgram",()=>a);class s{constructor(e){this.variableNames=["x","dy"],this.outputShape=e.filterShape;let t=e.strideHeight,r=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; int wC = coords.y; int d1 = coords.z; int dm = coords.w; int d2 = d1 * ${a} + dm; float dotProd = 0.0; // TO DO: Vec4 over the batch size for (int b = 0; b< ${e.batchSize}; b++) { for (int yR = 0; yR < ${e.outHeight}; yR++) { int xR = wR + yR * ${t} - ${n}; if (xR < 0 || xR >= ${e.inHeight}) { continue; } for (int yC = 0; yC< ${e.outWidth}; yC++) { int xC = wC + yC * ${r} - ${s}; if (xC < 0 || xC >= ${e.inWidth}) { continue; } float dyValue = getDy(b, yR, yC, d2); float xValue = getX(b, xR, xC, d1); dotProd += (xValue * dyValue); } } } setOutput(dotProd); } `}}class a{constructor(e){this.variableNames=["dy","W"],this.outputShape=e.inShape;let t=e.filterHeight,r=e.filterWidth,n=e.strideHeight,s=e.strideWidth,a=t-1-e.padInfo.top,o=r-1-e.padInfo.left,l=e.outChannels/e.inChannels;this.userCode=` const ivec2 pads = ivec2(${a}, ${o}); void main() { ivec4 coords = getOutputCoords(); int batch = coords[0]; int d1 = coords[3]; ivec2 dyCorner = coords.yz - pads; int dyRCorner = dyCorner.x; int dyCCorner = dyCorner.y; float dotProd = 0.0; for (int wR = 0; wR< ${t}; wR++) { float dyR = float(dyRCorner + wR) / ${n}.0; if (dyR < 0.0 || dyR >= ${e.outHeight}.0 || fract(dyR) > 0.0) { continue; } int idyR = int(dyR); int wRPerm = ${t} - 1 - wR; for (int wC = 0; wC< ${r}; wC++) { float dyC = float(dyCCorner + wC) / ${s}.0; if (dyC < 0.0 || dyC >= ${e.outWidth}.0 || fract(dyC) > 0.0) { continue; } int idyC = int(dyC); int wCPerm = ${r} - 1 - wC; // TO DO: Vec4 over the channelMul for (int dm = 0; dm< ${l}; dm++) { int d2 = d1 * ${l} + dm; float xValue = getDy(batch, idyR, idyC, d2); float wValue = getW(wRPerm, wCPerm, d1, dm); dotProd += xValue * wValue; } } } setOutput(dotProd); } `}}},{"@parcel/transformer-js/src/esmodule-helpers.js":"9pCYc"}],"6afCV":[function(e,t,r){/** * @license * Copyright 2020 Google LLC. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. * ============================================================================= */var n=e("@parcel/transformer-js/src/esmodule-helpers.js");n.defineInteropFlag(r),n.export(r,"depthwiseConv2dNativeBackpropInput",()=>o),n.export(r,"depthwiseConv2dNativeBackpropInputConfig",()=>l);var s=e("@tensorflow/tfjs-core"),a=e("../conv_backprop_gpu_depthwise");function o(e){let{inputs:t,backend:r,attrs:n}=e,{dy:o,filter:l}=t,{strides:i,dilations:u,pad:p,dimRoundingMode:c,inputShape:d}=n,f=(0,s.backend_util).computeConv2DInfo(d,l.shape,i,u,p,c,!0),h=new a.DepthwiseConv2DDerInputProgram(f);return r.runWebGLProgram(h,[o,l],"float32")}let l={kernelName:s.DepthwiseConv2dNativeBackpropInput,backendName:"webgl",kernelFunc:o}},{"@tensorflow/tfjs-core":"2nuhV","../conv_backprop_gpu_depthwise":"2dMvT","@parcel/transformer-js/src/esmodule-helpers.js":"9pCYc"}],"9Tigc":[function(e,t,r){/** * @license * Copyright 2020 Google LLC. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. * ============================================================================= */var n=e("@parcel/transformer-js/src/esmodule-helpers.js");n.defineInteropFlag(r),n.export(r,"diag",()=>l),n.export(r,"diagConfig",()=>i);var s=e("@tensorflow/tfjs-core"),a=e("../diag_gpu"),o=e("./Reshape");function l(e){let{inputs:t,backend:r}=e,{x:n}=t,l=[...n.shape,...n.shape],i=(0,s.util).sizeFromShape(n.shape),u=(0,o.reshape)({inputs:{x:n},backend:r,attrs:{shape:[i]}}),p=new a.DiagProgram(i),c=r.runWebGLProgram(p,[u],u.dtype),d=(0,o.reshape)({inputs:{x:c},backend:r,attrs:{shape:l}});return r.disposeIntermediateTensorInfo(u),r.disposeIntermediateTensorInfo(c),d}let i={kernelName:s.Diag,backendName:"webgl",kernelFunc:l}},{"@tensorflow/tfjs-core":"2nuhV","../diag_gpu":"1OUHV","./Reshape":"cgfGf","@parcel/transformer-js/src/esmodule-helpers.js":"9pCYc"}],"1OUHV":[function(e,t,r){/** * @license * Copyright 2019 Google LLC. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. * ============================================================================= */var n=e("@parcel/transformer-js/src/esmodule-helpers.js");n.defineInteropFlag(r),n.export(r,"DiagProgram",()=>s);class s{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); } `}}},{"@parcel/transformer-js/src/esmodule-helpers.js":"9pCYc"}],aYl3M:[function(e,t,r){/** * @license * Copyright 2020 Google LLC. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. * ============================================================================= */var n=e("@parcel/transformer-js/src/esmodule-helpers.js");n.defineInteropFlag(r),n.export(r,"dilation2D",()=>l),n.export(r,"dilation2DConfig",()=>i);var s=e("@tensorflow/tfjs-core"),a=e("../dilation_gpu"),o=e("./Reshape");function l(e){let t;let{inputs:r,backend:n,attrs:l}=e,{x:i,filter:u}=r,{strides:p,pad:c,dilations:d}=l,f=(0,s.backend_util).computeDilation2DInfo(i.shape,u.shape,p,c,"NHWC",d),h=new a.Dilation2DProgram(f);t=n.runWebGLProgram(h,[i,u],"float32");let m=(0,o.reshape)({inputs:{x:t},backend:n,attrs:{shape:f.outShape}});return n.disposeIntermediateTensorInfo(t),m}let i={kernelName:s.Dilation2D,backendName:"webgl",kernelFunc:l}},{"@tensorflow/tfjs-core":"2nuhV","../dilation_gpu":"adkiG","./Reshape":"cgfGf","@parcel/transformer-js/src/esmodule-helpers.js":"9pCYc"}],adkiG:[function(e,t,r){/** * @license * Copyright 2017 Google LLC. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. * ============================================================================= */var n=e("@parcel/transformer-js/src/esmodule-helpers.js");n.defineInteropFlag(r),n.export(r,"Dilation2DProgram",()=>s);class s{constructor(e){this.variableNames=["x","W"],this.outputShape=e.outShape;let{inHeight:t,inWidth:r,padInfo:n,strideHeight:s,strideWidth:a,filterHeight:o,filterWidth:l,dilationHeight:i,dilationWidth:u}=e,{top:p,left:c}=n;this.userCode=` const ivec2 strides = ivec2(${s}, ${a}); const ivec2 pads = ivec2(${p}, ${c}); const float neg_infinity = -3.4e38; void main() { ivec4 coords = getOutputCoords(); int batch = coords.x; int d1 = coords.w; ivec2 outTopLeftCorner = coords.yz * strides - pads; int hBeg = outTopLeftCorner.x; int wBeg = outTopLeftCorner.y; float curVal = neg_infinity; for (int h = 0; h< ${o}; h++) { int hIn = hBeg + h * ${i}; if (hIn >= 0 && hIn< ${t}) { for (int w = 0; w < ${l}; w++) { int wIn = wBeg + w * ${u}; if (wIn >= 0 && wIn< ${r}) { float xVal = getX(batch, hIn, wIn, d1); float wVal = getW(h, w, d1); float val = xVal + wVal; if (val >curVal) { curVal = val; } } } } } float result = curVal; setOutput(result); } `}}},{"@parcel/transformer-js/src/esmodule-helpers.js":"9pCYc"}],"9a4cr":[function(e,t,r){/** * @license * Copyright 2021 Google LLC. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. * ============================================================================= */var n=e("@parcel/transformer-js/src/esmodule-helpers.js");n.defineInteropFlag(r),n.export(r,"einsum",()=>u),n.export(r,"einsumConfig",()=>p);var s=e("@tensorflow/tfjs-core"),a=e("./Multiply"),o=e("./Reshape"),l=e("./Sum"),i=e("./Transpose");function u(e){let{inputs:t,backend:r,attrs:n}=e,{equation:u}=n,{allDims:p,summedDims:c,idDims:d}=(0,s.backend_util).decodeEinsumEquation(u,t.length);(0,s.backend_util).checkEinsumDimSizes(p.length,d,t);let{path:f,steps:h}=(0,s.backend_util).getEinsumComputePath(c,d),m=h.length,g=null,x=p.length,v=[];for(let e=0;e=0&&(g=(0,l.sum)({inputs:{x:g},backend:r,attrs:{axis:f[e]-(p.length-x),keepDims:!1}}),v.push(g)),x--)}for(let e of v)e!==g&&r.disposeIntermediateTensorInfo(e);return g}let p={kernelName:s.Einsum,backendName:"webgl",kernelFunc:u}},{"@tensorflow/tfjs-core":"2nuhV","./Multiply":"hh4HM","./Reshape":"cgfGf","./Sum":"3Zq98","./Transpose":"jIlsI","@parcel/transformer-js/src/esmodule-helpers.js":"9pCYc"}],jqCx8:[function(e,t,r){/** * @license * Copyright 2020 Google LLC. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. * ============================================================================= */var n=e("@parcel/transformer-js/src/esmodule-helpers.js");n.defineInteropFlag(r),n.export(r,"eluConfig",()=>i);var s=e("@tensorflow/tfjs-core"),a=e("../kernel_utils/kernel_funcs_utils");let o=` vec4 result; result.r = (x.r >= 0.0) ? x.r : (exp(x.r) - 1.0); result.g = (x.g >= 0.0) ? x.g : (exp(x.g) - 1.0); result.b = (x.b >= 0.0) ? x.b : (exp(x.b) - 1.0); result.a = (x.a >= 0.0) ? x.a : (exp(x.a) - 1.0); return result; `,l=(0,a.unaryKernelFunc)({opSnippet:"return (x >= 0.0) ? x : (exp(x) - 1.0);",packedOpSnippet:o}),i={kernelName:s.Elu,backendName:"webgl",kernelFunc:l}},{"@tensorflow/tfjs-core":"2nuhV","../kernel_utils/kernel_funcs_utils":"jMepo","@parcel/transformer-js/src/esmodule-helpers.js":"9pCYc"}],aeCUF:[function(e,t,r){/** * @license * Copyright 2020 Google LLC. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. * ============================================================================= */var n=e("@parcel/transformer-js/src/esmodule-helpers.js");n.defineInteropFlag(r),n.export(r,"eluGrad",()=>i),n.export(r,"eluGradConfig",()=>u);var s=e("@tensorflow/tfjs-core"),a=e("../binaryop_gpu"),o=e("../binaryop_packed_gpu");let l=` vec4 bGTEZero = vec4(greaterThanEqual(b, vec4(0.))); return (bGTEZero * a) + ((vec4(1.0) - bGTEZero) * (a * (b + vec4(1.0)))); `,i=e=>{let{inputs:t,backend:r}=e,{dy:n,y:i}=t,u=(0,s.env)().getBool("WEBGL_PACK_BINARY_OPERATIONS")?new o.BinaryOpPackedProgram(l,n.shape,i.shape):new a.BinaryOpProgram("return (b >= 0.0) ? a : a * (b + 1.0);",n.shape,i.shape);return r.runWebGLProgram(u,[n,i],n.dtype)},u={kernelName:s.EluGrad,backendName:"webgl",kernelFunc:i}},{"@tensorflow/tfjs-core":"2nuhV","../binaryop_gpu":"ilh7x","../binaryop_packed_gpu":"f1UiT","@parcel/transformer-js/src/esmodule-helpers.js":"9pCYc"}],"6iWbL":[function(e,t,r){/** * @license * Copyright 2020 Google LLC. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. * ============================================================================= */var n=e("@parcel/transformer-js/src/esmodule-helpers.js");n.defineInteropFlag(r),n.export(r,"equal",()=>i),n.export(r,"equalConfig",()=>u);var s=e("@tensorflow/tfjs-core"),a=e("../kernel_utils/kernel_funcs_utils"),o=e("../kernel_utils/shared");let l=` return vec4(equal(a, b)); `,i=(0,a.binaryKernelFunc)({opSnippet:"return float(a == b);",packedOpSnippet:l,dtype:"bool",cpuKernelImpl:o.equalImplCPU}),u={kernelName:s.Equal,backendName:"webgl",kernelFunc:i}},{"@tensorflow/tfjs-core":"2nuhV","../kernel_utils/kernel_funcs_utils":"jMepo","../kernel_utils/shared":"01kMd","@parcel/transformer-js/src/esmodule-helpers.js":"9pCYc"}],"1dtRL":[function(e,t,r){/** * @license * Copyright 2020 Google LLC. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. * ============================================================================= */var n=e("@parcel/transformer-js/src/esmodule-helpers.js");n.defineInteropFlag(r),n.export(r,"erf",()=>l),n.export(r,"erfConfig",()=>i);var s=e("@tensorflow/tfjs-core"),a=e("../kernel_utils/kernel_funcs_utils");let o=` // Error function is calculated approximately with elementary function. // See "Handbook of Mathematical Functions with Formulas, // Graphs, and Mathematical Tables", Abramowitz and Stegun. float p = ${s.backend_util.ERF_P}; float a1 = ${s.backend_util.ERF_A1}; float a2 = ${s.backend_util.ERF_A2}; float a3 = ${s.backend_util.ERF_A3}; float a4 = ${s.backend_util.ERF_A4}; float a5 = ${s.backend_util.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)); `,l=(0,a.unaryKernelFunc)({opSnippet:o}),i={kernelName:s.Erf,backendName:"webgl",kernelFunc:l}},{"@tensorflow/tfjs-core":"2nuhV","../kernel_utils/kernel_funcs_utils":"jMepo","@parcel/transformer-js/src/esmodule-helpers.js":"9pCYc"}],kSaqw:[function(e,t,r){/** * @license * Copyright 2020 Google LLC. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. * ============================================================================= */var n=e("@parcel/transformer-js/src/esmodule-helpers.js");n.defineInteropFlag(r),n.export(r,"EXP",()=>l),n.export(r,"exp",()=>u),n.export(r,"expConfig",()=>p);var s=e("@tensorflow/tfjs-core"),a=e("../kernel_utils/kernel_funcs_utils"),o=e("../kernel_utils/shared");let l=a.CHECK_NAN_SNIPPET_UNARY+` return exp(x); `,i=` vec4 result = exp(x); bvec4 isNaN = isnan(x); result.r = isNaN.r ? x.r : result.r; result.g = isNaN.g ? x.g : result.g; result.b = isNaN.b ? x.b : result.b; result.a = isNaN.a ? x.a : result.a; return result; `,u=(0,a.unaryKernelFunc)({opSnippet:l,packedOpSnippet:i,cpuKernelImpl:o.expImplCPU,dtype:"float32"}),p={kernelName:s.Exp,backendName:"webgl",kernelFunc:u}},{"@tensorflow/tfjs-core":"2nuhV","../kernel_utils/kernel_funcs_utils":"jMepo","../kernel_utils/shared":"01kMd","@parcel/transformer-js/src/esmodule-helpers.js":"9pCYc"}],"6l4Rf":[function(e,t,r){/** * @license * Copyright 2020 Google LLC. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the License); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an AS IS BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. * ============================================================================= */var n=e("@parcel/transformer-js/src/esmodule-helpers.js");n.defineInteropFlag(r),n.export(r,"expandDims",()=>o),n.export(r,"expandDimsConfig",()=>l);var s=e("@tensorflow/tfjs-core"),a=e("./Reshape");function o(e){let{inputs:t,attrs:r,backend:n}=e,{dim:o}=r,{input:l}=t,i=l.shape.length,u=l.shape.slice(),p=o;return o<0&&((0,s.util).assert(-(i+1)<=o,()=>`Axis must be in the interval [${-(i+1)}, ${i}]`),p=i+o+1),u.splice(p,0,1),(0,a.reshape)({inputs:{x:l},backend:n,attrs:{shape:u}})}let l={kernelName:s.ExpandDims,backendName:"webgl",kernelFunc:o}},{"@tensorflow/tfjs-core":"2nuhV","./Reshape":"cgfGf","@parcel/transformer-js/src/esmodule-helpers.js":"9pCYc"}],"2xgQM":[function(e,t,r){/** * @license * Copyright 2020 Google LLC. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. * ============================================================================= */var n=e("@parcel/transformer-js/src/esmodule-helpers.js");n.defineInteropFlag(r),n.export(r,"expm1",()=>i),n.export(r,"expm1Config",()=>u);var s=e("@tensorflow/tfjs-core"),a=e("../kernel_utils/kernel_funcs_utils"),o=e("../kernel_utils/shared");let l="return exp(x) - 1.0;",i=(0,a.unaryKernelFunc)({opSnippet:l,packedOpSnippet:l,cpuKernelImpl:o.expm1ImplCPU}),u={kernelName:s.Expm1,backendName:"webgl",kernelFunc:i}},{"@tensorflow/tfjs-core":"2nuhV","../kernel_utils/kernel_funcs_utils":"jMepo","../kernel_utils/shared":"01kMd","@parcel/transformer-js/src/esmodule-helpers.js":"9pCYc"}],"7QH0m":[function(e,t,r){/** * @license * Copyright 2020 Google LLC. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. * ============================================================================= */var n=e("@parcel/transformer-js/src/esmodule-helpers.js");n.defineInteropFlag(r),n.export(r,"fft",()=>o),n.export(r,"fftConfig",()=>l);var s=e("@tensorflow/tfjs-core"),a=e("./FFT_impl");function o(e){let{inputs:t,backend:r}=e,{input:n}=t;return(0,a.fftImpl)(n,!1,r)}let l={kernelName:s.FFT,backendName:"webgl",kernelFunc:o}},{"@tensorflow/tfjs-core":"2nuhV","./FFT_impl":"8pkwi","@parcel/transformer-js/src/esmodule-helpers.js":"9pCYc"}],"8pkwi":[function(e,t,r){/** * @license * Copyright 2020 Google LLC. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. * ============================================================================= */var n=e("@parcel/transformer-js/src/esmodule-helpers.js");n.defineInteropFlag(r),n.export(r,"fftImpl",()=>i);var s=e("@tensorflow/tfjs-core"),a=e("../fft_gpu"),o=e("./Complex"),l=e("./Reshape");function i(e,t,r){let n=r.texData.get(e.dataId),i=(0,s.util).sizeFromShape(e.shape),u=e.shape[e.shape.length-1],p=(0,l.reshape)({inputs:{x:e},backend:r,attrs:{shape:[i/u,u]}}),c=p.shape,d=new a.FFTProgram("real",c,t),f=new a.FFTProgram("imag",c,t),h=[{dataId:n.complexTensorInfos.real.dataId,dtype:n.complexTensorInfos.real.dtype,shape:c},{dataId:n.complexTensorInfos.imag.dataId,dtype:n.complexTensorInfos.imag.dtype,shape:c}],m=r.runWebGLProgram(d,h,"float32"),g=r.runWebGLProgram(f,h,"float32"),x=(0,o.complex)({inputs:{real:m,imag:g},backend:r});r.disposeIntermediateTensorInfo(m),r.disposeIntermediateTensorInfo(g);let v=(0,l.reshape)({inputs:{x:x},backend:r,attrs:{shape:e.shape}});return r.disposeIntermediateTensorInfo(p),r.disposeIntermediateTensorInfo(x),v}},{"@tensorflow/tfjs-core":"2nuhV","../fft_gpu":"clLTK","./Complex":"3zOos","./Reshape":"cgfGf","@parcel/transformer-js/src/esmodule-helpers.js":"9pCYc"}],clLTK:[function(e,t,r){/** * @license * Copyright 2018 Google LLC. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. * ============================================================================= */var n=e("@parcel/transformer-js/src/esmodule-helpers.js");n.defineInteropFlag(r),n.export(r,"FFTProgram",()=>s);class s{constructor(e,t,r){let n;this.variableNames=["real","imag"];let s=t[1];this.outputShape=t;let a=r?`2.0 * ${Math.PI}`:`-2.0 * ${Math.PI}`,o=r?`${s}.0`:"1.0";if("real"===e)n="return real * expR - imag * expI;";else if("imag"===e)n="return real * expI + imag * expR;";else throw Error(`FFT component must be either "real" or "imag", got ${e}.`);this.userCode=` const float exponentMultiplier = ${a}; float unaryOpComplex(float real, float expR, float imag, float expI) { ${n} } float mulMatDFT(int batch, int index) { float indexRatio = float(index) / float(${s}); float exponentMultiplierTimesIndexRatio = exponentMultiplier * indexRatio; float result = 0.0; for (int i = 0; i< ${s}; i++) { // x = (-2|2 * PI / N) * index * i; float x = exponentMultiplierTimesIndexRatio * float(i); float expR = cos(x); float expI = sin(x); float real = getReal(batch, i); float imag = getImag(batch, i); result += unaryOpComplex(real, expR, imag, expI) / ${o}; } return result; } void main() { ivec2 coords = getOutputCoords(); setOutput(mulMatDFT(coords[0], coords[1])); } `}}},{"@parcel/transformer-js/src/esmodule-helpers.js":"9pCYc"}],"6vZGW":[function(e,t,r){/** * @license * Copyright 2020 Google LLC. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. * ============================================================================= */var n=e("@parcel/transformer-js/src/esmodule-helpers.js");n.defineInteropFlag(r),n.export(r,"fill",()=>o),n.export(r,"fillConfig",()=>l);var s=e("@tensorflow/tfjs-core"),a=e("../fill_gpu");function o(e){let{backend:t,attrs:r}=e,{shape:n,value:o}=r,{dtype:l}=r;if("string"===(l=l||(0,s.util).inferDtype(o))){let e=(0,s.util).getArrayFromDType(l,(0,s.util).sizeFromShape(n));return e.fill(o),t.makeTensorInfo(n,l,e)}{let e=new a.FillProgram(n,o),r=[[o]];return t.runWebGLProgram(e,[],l,r)}}let l={kernelName:s.Fill,backendName:"webgl",kernelFunc:o}},{"@tensorflow/tfjs-core":"2nuhV","../fill_gpu":"3ic0V","@parcel/transformer-js/src/esmodule-helpers.js":"9pCYc"}],"3ic0V":[function(e,t,r){/** * @license * Copyright 2019 Google LLC. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. * ============================================================================= */var n=e("@parcel/transformer-js/src/esmodule-helpers.js");n.defineInteropFlag(r),n.export(r,"FillProgram",()=>s);class s{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); } `}}},{"@parcel/transformer-js/src/esmodule-helpers.js":"9pCYc"}],"1WuC5":[function(e,t,r){/** * @license * Copyright 2020 Google LLC. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. * ============================================================================= */var n=e("@parcel/transformer-js/src/esmodule-helpers.js");n.defineInteropFlag(r),n.export(r,"flipLeftRightConfig",()=>o);var s=e("@tensorflow/tfjs-core"),a=e("../flip_left_right_gpu");let o={kernelName:s.FlipLeftRight,backendName:"webgl",kernelFunc:({inputs:e,backend:t})=>{let{image:r}=e,n=new a.FlipLeftRightProgram(r.shape);return t.runWebGLProgram(n,[r],r.dtype)}}},{"@tensorflow/tfjs-core":"2nuhV","../flip_left_right_gpu":"6XFtb","@parcel/transformer-js/src/esmodule-helpers.js":"9pCYc"}],"6XFtb":[function(e,t,r){/** * @license * Copyright 2020 Google LLC. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. * ============================================================================= */var n=e("@parcel/transformer-js/src/esmodule-helpers.js");n.defineInteropFlag(r),n.export(r,"FlipLeftRightProgram",()=>s);class s{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 = ${t} - x - 1; float outputValue; 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); } `}}},{"@parcel/transformer-js/src/esmodule-helpers.js":"9pCYc"}],hZsyB:[function(e,t,r){/** * @license * Copyright 2020 Google LLC. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. * ============================================================================= */var n=e("@parcel/transformer-js/src/esmodule-helpers.js");n.defineInteropFlag(r),n.export(r,"floor",()=>i),n.export(r,"floorConfig",()=>u);var s=e("@tensorflow/tfjs-core"),a=e("../kernel_utils/kernel_funcs_utils"),o=e("../kernel_utils/shared");let l="return floor(x);",i=(0,a.unaryKernelFunc)({opSnippet:l,packedOpSnippet:l,cpuKernelImpl:o.floorImplCPU}),u={kernelName:s.Floor,backendName:"webgl",kernelFunc:i}},{"@tensorflow/tfjs-core":"2nuhV","../kernel_utils/kernel_funcs_utils":"jMepo","../kernel_utils/shared":"01kMd","@parcel/transformer-js/src/esmodule-helpers.js":"9pCYc"}],lFtmo:[function(e,t,r){/** * @license * Copyright 2020 Google LLC. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. * ============================================================================= */var n=e("@parcel/transformer-js/src/esmodule-helpers.js");n.defineInteropFlag(r),n.export(r,"floorDiv",()=>i),n.export(r,"floorDivConfig",()=>u);var s=e("@tensorflow/tfjs-core"),a=e("../kernel_utils/kernel_funcs_utils");let o=` float s = sign(a) * sign(b); int ia = round(a); int ib = round(b); if (ib != 0) { // Windows (D3D) wants guaranteed non-zero int division at compile-time. return float(idiv(ia, ib, s)); } else { return NAN; } `,l=` ivec4 ia = round(a); ivec4 ib = round(b); bvec4 cond = notEqual(ib, ivec4(0)); ivec4 result = ivec4(0); vec4 s = sign(a) * sign(b); // Windows (D3D) wants guaranteed non-zero int division at compile-time. if (cond[0]) { result[0] = idiv(ia[0], ib[0], s[0]); } if (cond[1]) { result[1] = idiv(ia[1], ib[1], s[1]); } if (cond[2]) { result[2] = idiv(ia[2], ib[2], s[2]); } if (cond[3]) { result[3] = idiv(ia[3], ib[3], s[3]); } return vec4(result); `,i=(0,a.binaryKernelFunc)({opSnippet:o,packedOpSnippet:l,dtype:"int32"}),u={kernelName:s.FloorDiv,backendName:"webgl",kernelFunc:i}},{"@tensorflow/tfjs-core":"2nuhV","../kernel_utils/kernel_funcs_utils":"jMepo","@parcel/transformer-js/src/esmodule-helpers.js":"9pCYc"}],"9ItVc":[function(e,t,r){let n;/** * @license * Copyright 2019 Google LLC. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. * ============================================================================= */var s=e("@parcel/transformer-js/src/esmodule-helpers.js");s.defineInteropFlag(r),s.export(r,"fromPixelsConfig",()=>u);var a=e("@tensorflow/tfjs-core"),o=e("../tex_util"),l=e("./FromPixels_utils/from_pixels_gpu"),i=e("./FromPixels_utils/from_pixels_packed_gpu");let u={kernelName:a.FromPixels,backendName:"webgl",kernelFunc:function(e){let{inputs:t,backend:r,attrs:s}=e,{pixels:u}=t,{numChannels:c}=s,d="undefined"!=typeof HTMLVideoElement&&u instanceof HTMLVideoElement,f="undefined"!=typeof HTMLImageElement&&u instanceof HTMLImageElement,[h,m]=d?[u.videoWidth,u.videoHeight]:[u.width,u.height],g=[m,h],x=[m,h,c];if(f||d){let e=(0,a.env)().getBool("CANVAS2D_WILL_READ_FREQUENTLY_FOR_GPU");(null==n||e!==p)&&(p=e,n=document.createElement("canvas").getContext("2d",{willReadFrequently:p})),n.canvas.width=h,n.canvas.height=m,n.drawImage(u,0,0,h,m),u=n.canvas}let v=r.makeTensorInfo(g,"int32");r.texData.get(v.dataId).usage=o.TextureUsage.PIXELS,r.gpgpu.uploadPixelDataToTexture(r.getTexture(v.dataId),u);let y=(0,a.env)().getBool("WEBGL_PACK")?new i.FromPixelsPackedProgram(x):new l.FromPixelsProgram(x),b=r.runWebGLProgram(y,[v],"int32");return r.disposeData(v.dataId),b}},p=(0,a.env)().getBool("CANVAS2D_WILL_READ_FREQUENTLY_FOR_GPU")},{"@tensorflow/tfjs-core":"2nuhV","../tex_util":"9R0ee","./FromPixels_utils/from_pixels_gpu":"h94Qh","./FromPixels_utils/from_pixels_packed_gpu":"3vCNf","@parcel/transformer-js/src/esmodule-helpers.js":"9pCYc"}],h94Qh:[function(e,t,r){/** * @license * Copyright 2018 Google LLC. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. * ============================================================================= */var n=e("@parcel/transformer-js/src/esmodule-helpers.js");n.defineInteropFlag(r),n.export(r,"FromPixelsProgram",()=>a);var s=e("../../glsl_version");class a{constructor(e){this.variableNames=["A"];let t=(0,s.getGlslDifferences)(),[r,n]=e;this.outputShape=e,this.userCode=` void main() { ivec3 coords = getOutputCoords(); int texR = coords[0]; int texC = coords[1]; int depth = coords[2]; vec2 uv = (vec2(texC, texR) + halfCR) / vec2(${n}.0, ${r}.0); vec4 values = ${t.texture2D}(A, uv); float value; if (depth == 0) { value = values.r; } else if (depth == 1) { value = values.g; } else if (depth == 2) { value = values.b; } else if (depth == 3) { value = values.a; } setOutput(floor(value * 255.0 + 0.5)); } `}}},{"../../glsl_version":"aKRJc","@parcel/transformer-js/src/esmodule-helpers.js":"9pCYc"}],"3vCNf":[function(e,t,r){/** * @license * Copyright 2018 Google LLC. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. * ============================================================================= */var n=e("@parcel/transformer-js/src/esmodule-helpers.js");n.defineInteropFlag(r),n.export(r,"FromPixelsPackedProgram",()=>a);var s=e("../../glsl_version");class a{constructor(e){this.variableNames=["A"],this.packedInputs=!1,this.packedOutput=!0;let t=(0,s.getGlslDifferences)(),[r,n]=e;this.outputShape=e,this.userCode=` void main() { ivec3 coords = getOutputCoords(); int texR = coords[0]; int texC = coords[1]; int depth = coords[2]; vec4 result = vec4(0.); for(int row=0; row<=1; row++) { for(int col=0; col<=1; col++) { texC = coords[1] + row; depth = coords[2] + col; vec2 uv = (vec2(texC, texR) + halfCR) / vec2(${n}.0, ${r}.0); vec4 values = ${t.texture2D}(A, uv); float value; if (depth == 0) { value = values.r; } else if (depth == 1) { value = values.g; } else if (depth == 2) { value = values.b; } else if (depth == 3) { value = values.a; } result[row * 2 + col] = floor(value * 255.0 + 0.5); } } ${t.output} = result; } `}}},{"../../glsl_version":"aKRJc","@parcel/transformer-js/src/esmodule-helpers.js":"9pCYc"}],"3HPmW":[function(e,t,r){/** * @license * Copyright 2020 Google LLC. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. * ============================================================================= */var n=e("@parcel/transformer-js/src/esmodule-helpers.js");n.defineInteropFlag(r),n.export(r,"fusedConv2d",()=>p),n.export(r,"fusedConv2DConfig",()=>c);var s=e("@tensorflow/tfjs-core"),a=e("../conv_gpu"),o=e("../conv_packed_gpu"),l=e("../kernel_utils/kernel_funcs_utils"),i=e("./Conv2D_impl"),u=e("./Reshape");function p(e){let t;let{inputs:r,backend:n,attrs:p}=e,{x:c,filter:d,bias:f,preluActivationWeights:h}=r,{strides:m,pad:g,dataFormat:x,dilations:v,dimRoundingMode:y,activation:b,leakyreluAlpha:_}=p,k=(0,s.backend_util).convertConv2DDataFormat(x),j=(0,s.backend_util).computeConv2DInfo(c.shape,d.shape,m,v,g,y,!1,k),I=[],C=null!=f,w=null!=h,T="leakyrelu"===b,S=()=>{let e=[c,d],t=(e,t)=>{if("NCHW"===t&&1===e.shape.length&&1!==e.shape[0]){let t=(0,u.reshape)({inputs:{x:e},backend:n,attrs:{shape:[e.shape[0],1,1]}});return I.push(t),t}return e};if(C&&e.push(t(f,x)),w&&e.push(t(h,x)),T){let t=n.makeTensorInfo([],"float32",(0,s.util).createScalarValue(_,"float32"));e.push(t),I.push(t)}return e};if(1===j.filterHeight&&1===j.filterWidth&&1===j.dilationHeight&&1===j.dilationWidth&&1===j.strideHeight&&1===j.strideWidth&&("SAME"===j.padInfo.type||"VALID"===j.padInfo.type))t=(0,i.conv2dByMatMul)({x:c,filter:d,convInfo:j,backend:n,bias:f,activation:b,preluActivationWeights:h,leakyreluAlpha:_});else if(j.strideWidth<=2&&"channelsLast"===k&&(0,s.env)().getBool("WEBGL_EXP_CONV")){let e=b?(0,l.mapActivationToShaderProgram)(b,!0):null,r=new o.Conv2DPackedProgram(j,C,e,w,T),s=[[j.padInfo.top,j.padInfo.left],[j.strideHeight,j.strideWidth],[j.dilationHeight,j.dilationWidth],[j.inHeight,j.inWidth]],a=S();t=n.runWebGLProgram(r,a,"float32",s)}else if((0,s.env)().getBool("WEBGL_CONV_IM2COL"))t=(0,i.conv2dWithIm2Row)({x:c,filter:d,convInfo:j,backend:n,bias:f,activation:b,preluActivationWeights:h,leakyreluAlpha:_});else{let e=b?(0,l.mapActivationToShaderProgram)(b,!1):null,r=new a.Conv2DProgram(j,C,e,w,T),s=S();t=n.runWebGLProgram(r,s,"float32")}let N=(0,u.reshape)({inputs:{x:t},backend:n,attrs:{shape:j.outShape}});return I.push(t),I.forEach(e=>n.disposeIntermediateTensorInfo(e)),N}let c={kernelName:s.FusedConv2D,backendName:"webgl",kernelFunc:p}},{"@tensorflow/tfjs-core":"2nuhV","../conv_gpu":"luVZB","../conv_packed_gpu":"fQD9i","../kernel_utils/kernel_funcs_utils":"jMepo","./Conv2D_impl":"5NYOP","./Reshape":"cgfGf","@parcel/transformer-js/src/esmodule-helpers.js":"9pCYc"}],fVWLN:[function(e,t,r){/** * @license * Copyright 2020 Google LLC. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. * ============================================================================= */var n=e("@parcel/transformer-js/src/esmodule-helpers.js");n.defineInteropFlag(r),n.export(r,"fusedDepthwiseConv2D",()=>i),n.export(r,"fusedDepthwiseConv2DConfig",()=>u);var s=e("@tensorflow/tfjs-core"),a=e("../conv_gpu_depthwise"),o=e("../conv_packed_gpu_depthwise"),l=e("../kernel_utils/kernel_funcs_utils");function i(e){let t;let{inputs:r,backend:n,attrs:i}=e,{x:u,filter:p,bias:c,preluActivationWeights:d}=r,{strides:f,pad:h,dilations:m,dimRoundingMode:g,activation:x,leakyreluAlpha:v}=i,y=[],b=m;null==b&&(b=[1,1]),(0,s.util).assert((0,s.backend_util).eitherStridesOrDilationsAreOne(f,b),()=>`Error in depthwiseConv2d: Either strides or dilations must be 1. Got strides ${f} and dilations '${b}'`);let _=(0,s.backend_util).computeConv2DInfo(u.shape,p.shape,f,b,h,g,!0),k=(0,s.env)().getBool("WEBGL_PACK_DEPTHWISECONV")&&_.strideWidth<=2&&_.outChannels/_.inChannels==1,j=x?(0,l.mapActivationToShaderProgram)(x,k):null,I=[u,p],C=null!=c,w=null!=d,T="leakyrelu"===x;if(C&&I.push(c),w&&I.push(d),T){let e=n.makeTensorInfo([],"float32",(0,s.util).createScalarValue(v,"float32"));I.push(e),y.push(e)}t=k?new o.DepthwiseConvPacked2DProgram(_,C,j,w,T):new a.DepthwiseConv2DProgram(_,C,j,w,T);let S=[[_.padInfo.top,_.padInfo.left],[_.strideHeight,_.strideWidth],[_.dilationHeight,_.dilationWidth],[_.inHeight,_.inWidth]],N=n.runWebGLProgram(t,I,"float32",S);return y.forEach(e=>n.disposeIntermediateTensorInfo(e)),N}let u={kernelName:s.FusedDepthwiseConv2D,backendName:"webgl",kernelFunc:i}},{"@tensorflow/tfjs-core":"2nuhV","../conv_gpu_depthwise":"cQOMv","../conv_packed_gpu_depthwise":"grFEk","../kernel_utils/kernel_funcs_utils":"jMepo","@parcel/transformer-js/src/esmodule-helpers.js":"9pCYc"}],aSlIh:[function(e,t,r){/** * @license * Copyright 2020 Google LLC. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. * ============================================================================= */var n=e("@parcel/transformer-js/src/esmodule-helpers.js");n.defineInteropFlag(r),n.export(r,"gatherNd",()=>i),n.export(r,"gatherNdConfig",()=>u);var s=e("@tensorflow/tfjs-core"),a=e("../gather_nd_gpu"),o=e("../kernel_utils/shared"),l=e("./Reshape");function i(e){let{inputs:t,backend:r}=e,{params:n,indices:i}=t,u=i.shape,p=u[u.length-1],c=(0,s.util).sizeFromShape(n.shape),[d,f,h,m]=(0,s.backend_util).prepareAndValidate(n,i),g=(0,l.reshape)({inputs:{x:i},backend:r,attrs:{shape:[f,p]}}),x=(0,l.reshape)({inputs:{x:n},backend:r,attrs:{shape:[(0,s.util).sizeFromShape(n.shape)/h,h]}});if(r.shouldExecuteOnCPU([n,i])||"string"===n.dtype){let e=r.readSync(i.dataId),t=r.bufferSync(n),s=(0,o.gatherNdImplCPU)(e,t,n.dtype,f,p,h,m,n.shape,c);return r.makeTensorInfo(d,n.dtype,s.values)}let v=new a.GatherNDProgram(p,m,[f,h],n.shape),y=r.runWebGLProgram(v,[x,g],x.dtype),b=(0,l.reshape)({inputs:{x:y},backend:r,attrs:{shape:d}});return r.disposeIntermediateTensorInfo(g),r.disposeIntermediateTensorInfo(x),r.disposeIntermediateTensorInfo(y),b}let u={kernelName:s.GatherNd,backendName:"webgl",kernelFunc:i}},{"@tensorflow/tfjs-core":"2nuhV","../gather_nd_gpu":"7GioY","../kernel_utils/shared":"01kMd","./Reshape":"cgfGf","@parcel/transformer-js/src/esmodule-helpers.js":"9pCYc"}],"7GioY":[function(e,t,r){var n=e("@parcel/transformer-js/src/esmodule-helpers.js");n.defineInteropFlag(r),n.export(r,"GatherNDProgram",()=>a);var s=e("./shader_compiler");class a{constructor(e,t,r,n){this.sliceDim=e,this.strides=t,this.paramsShape=n,this.variableNames=["x","indices"],this.outputShape=r;let a=(0,s.getCoordsDataType)(r.length),o=` int index;`;for(let e=0;e= ${this.paramsShape[e]}; flattenIndex += index * ${this.strides[e]};`;this.userCode=` void main() { ${a} coords = getOutputCoords(); int flattenIndex = 0; bool out_of_bounds = false; ${o} setOutput(out_of_bounds ? 0.0 : getX(flattenIndex, coords[1])); } `}}},{"./shader_compiler":"3kYYB","@parcel/transformer-js/src/esmodule-helpers.js":"9pCYc"}],"4dBGm":[function(e,t,r){/** * @license * Copyright 2020 Google LLC. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. * ============================================================================= */var n=e("@parcel/transformer-js/src/esmodule-helpers.js");n.defineInteropFlag(r),n.export(r,"gatherV2",()=>i),n.export(r,"gatherV2Config",()=>u);var s=e("@tensorflow/tfjs-core"),a=e("../gather_gpu"),o=e("../kernel_utils/shared"),l=e("./Reshape");function i(e){let{inputs:t,backend:r,attrs:n}=e,{x:i,indices:u}=t,{axis:p,batchDims:c}=n,d=(0,s.util).parseAxisParam(p,i.shape)[0];if((0,s.env)().get("DEBUG")){let e=r.readSync(u.dataId),t=i.shape[d];for(let r=0;r=0,()=>`GatherV2: the index value ${n} is not in [0, ${t-1}]`)}}let f=(0,s.backend_util).segment_util.collectGatherOpShapeInfo(i,u,d,c),h=(0,s.util).sizeFromShape(u.shape),m=[],g=(0,l.reshape)({inputs:{x:i},backend:r,attrs:{shape:[f.batchSize,f.outerSize,f.dimSize,f.sliceSize]}}),x=(0,l.reshape)({inputs:{x:u},backend:r,attrs:{shape:[f.batchSize,h/f.batchSize]}});m.push(g),m.push(x);let v=[f.batchSize,f.outerSize,h/f.batchSize,f.sliceSize];if(r.shouldExecuteOnCPU([i,u])||"string"===i.dtype){let e=r.bufferSync(x),t=r.bufferSync(g),n=(0,o.gatherV2ImplCPU)(t,e,v);return m.forEach(e=>r.disposeIntermediateTensorInfo(e)),r.makeTensorInfo(f.outputShape,n.dtype,n.values)}let y=new a.GatherProgram(g.shape,v),b=r.runWebGLProgram(y,[g,x],g.dtype);m.push(b);let _=(0,l.reshape)({inputs:{x:b},backend:r,attrs:{shape:f.outputShape}});return m.forEach(e=>r.disposeIntermediateTensorInfo(e)),_}let u={kernelName:s.GatherV2,backendName:"webgl",kernelFunc:i}},{"@tensorflow/tfjs-core":"2nuhV","../gather_gpu":"ayPno","../kernel_utils/shared":"01kMd","./Reshape":"cgfGf","@parcel/transformer-js/src/esmodule-helpers.js":"9pCYc"}],ayPno:[function(e,t,r){/** * @license * Copyright 2017 Google LLC. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. * ============================================================================= */var n=e("@parcel/transformer-js/src/esmodule-helpers.js");n.defineInteropFlag(r),n.export(r,"GatherProgram",()=>a);var s=e("./shader_compiler");class a{constructor(e,t){this.variableNames=["A","indices"],this.outputShape=t,this.rank=t.length;let r=(0,s.getCoordsDataType)(this.rank),n=function(e,t){let r=["resRC.x","resRC.y","resRC.z","resRC.w"],n=[];for(let t=0;t= 0) && (index< ${e[2]}) ? 1.0 : 0.0; setOutput(inBounds * getA(${n})); } `}}},{"./shader_compiler":"3kYYB","@parcel/transformer-js/src/esmodule-helpers.js":"9pCYc"}],"3wLuO":[function(e,t,r){/** * @license * Copyright 2020 Google LLC. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. * ============================================================================= */var n=e("@parcel/transformer-js/src/esmodule-helpers.js");n.defineInteropFlag(r),n.export(r,"greater",()=>i),n.export(r,"greaterConfig",()=>u);var s=e("@tensorflow/tfjs-core"),a=e("../kernel_utils/kernel_funcs_utils"),o=e("../kernel_utils/shared");let l=` return vec4(greaterThan(a, b)); `,i=(0,a.binaryKernelFunc)({opSnippet:"return float(a > b);",packedOpSnippet:l,cpuKernelImpl:o.greaterImplCPU,dtype:"bool"}),u={kernelName:s.Greater,backendName:"webgl",kernelFunc:i}},{"@tensorflow/tfjs-core":"2nuhV","../kernel_utils/kernel_funcs_utils":"jMepo","../kernel_utils/shared":"01kMd","@parcel/transformer-js/src/esmodule-helpers.js":"9pCYc"}],"4Wunt":[function(e,t,r){/** * @license * Copyright 2020 Google LLC. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. * ============================================================================= */var n=e("@parcel/transformer-js/src/esmodule-helpers.js");n.defineInteropFlag(r),n.export(r,"greaterEqual",()=>i),n.export(r,"greaterEqualConfig",()=>u);var s=e("@tensorflow/tfjs-core"),a=e("../kernel_utils/kernel_funcs_utils"),o=e("../kernel_utils/shared");let l=` return vec4(greaterThanEqual(a, b)); `,i=(0,a.binaryKernelFunc)({opSnippet:"return float(a >= b);",packedOpSnippet:l,dtype:"bool",cpuKernelImpl:o.greaterEqualImplCPU}),u={kernelName:s.GreaterEqual,backendName:"webgl",kernelFunc:i}},{"@tensorflow/tfjs-core":"2nuhV","../kernel_utils/kernel_funcs_utils":"jMepo","../kernel_utils/shared":"01kMd","@parcel/transformer-js/src/esmodule-helpers.js":"9pCYc"}],"1wLde":[function(e,t,r){/** * @license * Copyright 2020 Google LLC. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. * ============================================================================= */var n=e("@parcel/transformer-js/src/esmodule-helpers.js");n.defineInteropFlag(r),n.export(r,"ifft",()=>o),n.export(r,"ifftConfig",()=>l);var s=e("@tensorflow/tfjs-core"),a=e("./FFT_impl");function o(e){let{inputs:t,backend:r}=e,{input:n}=t;return(0,a.fftImpl)(n,!0,r)}let l={kernelName:s.IFFT,backendName:"webgl",kernelFunc:o}},{"@tensorflow/tfjs-core":"2nuhV","./FFT_impl":"8pkwi","@parcel/transformer-js/src/esmodule-helpers.js":"9pCYc"}],"4Tbar":[function(e,t,r){/** * @license * Copyright 2020 Google LLC. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. * ============================================================================= */var n=e("@parcel/transformer-js/src/esmodule-helpers.js");n.defineInteropFlag(r),n.export(r,"isFinite",()=>a),n.export(r,"isFiniteConfig",()=>o);var s=e("@tensorflow/tfjs-core");let a=(0,e("../kernel_utils/kernel_funcs_utils").unaryKernelFunc)({opSnippet:"return float(!isnan(x) && !isinf(x));",dtype:"bool"}),o={kernelName:s.IsFinite,backendName:"webgl",kernelFunc:a}},{"@tensorflow/tfjs-core":"2nuhV","../kernel_utils/kernel_funcs_utils":"jMepo","@parcel/transformer-js/src/esmodule-helpers.js":"9pCYc"}],acHvJ:[function(e,t,r){/** * @license * Copyright 2020 Google LLC. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. * ============================================================================= */var n=e("@parcel/transformer-js/src/esmodule-helpers.js");n.defineInteropFlag(r),n.export(r,"isInf",()=>a),n.export(r,"isInfConfig",()=>o);var s=e("@tensorflow/tfjs-core");let a=(0,e("../kernel_utils/kernel_funcs_utils").unaryKernelFunc)({opSnippet:"return float(isinf(x));",dtype:"bool"}),o={kernelName:s.IsInf,backendName:"webgl",kernelFunc:a}},{"@tensorflow/tfjs-core":"2nuhV","../kernel_utils/kernel_funcs_utils":"jMepo","@parcel/transformer-js/src/esmodule-helpers.js":"9pCYc"}],"86FtF":[function(e,t,r){/** * @license * Copyright 2020 Google LLC. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. * ============================================================================= */var n=e("@parcel/transformer-js/src/esmodule-helpers.js");n.defineInteropFlag(r),n.export(r,"isNaN",()=>a),n.export(r,"isNaNConfig",()=>o);var s=e("@tensorflow/tfjs-core");let a=(0,e("../kernel_utils/kernel_funcs_utils").unaryKernelFunc)({opSnippet:"return float(isnan(x));",dtype:"bool"}),o={kernelName:s.IsNan,backendName:"webgl",kernelFunc:a}},{"@tensorflow/tfjs-core":"2nuhV","../kernel_utils/kernel_funcs_utils":"jMepo","@parcel/transformer-js/src/esmodule-helpers.js":"9pCYc"}],"7tjns":[function(e,t,r){/** * @license * Copyright 2020 Google LLC. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. * ============================================================================= */var n=e("@parcel/transformer-js/src/esmodule-helpers.js");n.defineInteropFlag(r),n.export(r,"less",()=>i),n.export(r,"lessConfig",()=>u);var s=e("@tensorflow/tfjs-core"),a=e("../kernel_utils/kernel_funcs_utils"),o=e("../kernel_utils/shared");let l=` return vec4(lessThan(a, b)); `,i=(0,a.binaryKernelFunc)({opSnippet:"return float(a< b);",packedOpSnippet:l,cpuKernelImpl:o.lessImplCPU,dtype:"bool"}),u={kernelName:s.Less,backendName:"webgl",kernelFunc:i}},{"@tensorflow/tfjs-core":"2nuhV","../kernel_utils/kernel_funcs_utils":"jMepo","../kernel_utils/shared":"01kMd","@parcel/transformer-js/src/esmodule-helpers.js":"9pCYc"}],bHZeL:[function(e,t,r){/** * @license * Copyright 2020 Google LLC. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. * ============================================================================= */var n=e("@parcel/transformer-js/src/esmodule-helpers.js");n.defineInteropFlag(r),n.export(r,"LESS_EQUAL",()=>l),n.export(r,"LESS_EQUAL_PACKED",()=>i),n.export(r,"lessEqual",()=>u),n.export(r,"lessEqualConfig",()=>p);var s=e("@tensorflow/tfjs-core"),a=e("../kernel_utils/kernel_funcs_utils"),o=e("../kernel_utils/shared");let l="return float(a<= b);",i=` return vec4(lessThanEqual(a, b)); `,u=(0,a.binaryKernelFunc)({opSnippet:l,packedOpSnippet:i,cpuKernelImpl:o.lessEqualImplCPU,dtype:"bool"}),p={kernelName:s.LessEqual,backendName:"webgl",kernelFunc:u}},{"@tensorflow/tfjs-core":"2nuhV","../kernel_utils/kernel_funcs_utils":"jMepo","../kernel_utils/shared":"01kMd","@parcel/transformer-js/src/esmodule-helpers.js":"9pCYc"}],"3eEez":[function(e,t,r){/** * @license * Copyright 2020 Google LLC. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. * ============================================================================= */var n=e("@parcel/transformer-js/src/esmodule-helpers.js");n.defineInteropFlag(r),n.export(r,"linSpace",()=>o),n.export(r,"linSpaceConfig",()=>l);var s=e("@tensorflow/tfjs-core"),a=e("../kernel_utils/shared");function o(e){let{backend:t,attrs:r}=e,{start:n,stop:s,num:o}=r,l=(0,a.linSpaceImplCPU)(n,s,o);return t.makeTensorInfo([l.length],"float32",l)}let l={kernelName:s.LinSpace,backendName:"webgl",kernelFunc:o}},{"@tensorflow/tfjs-core":"2nuhV","../kernel_utils/shared":"01kMd","@parcel/transformer-js/src/esmodule-helpers.js":"9pCYc"}],kmufp:[function(e,t,r){/** * @license * Copyright 2020 Google LLC. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. * ============================================================================= */var n=e("@parcel/transformer-js/src/esmodule-helpers.js");n.defineInteropFlag(r),n.export(r,"log",()=>u),n.export(r,"logConfig",()=>p);var s=e("@tensorflow/tfjs-core"),a=e("../kernel_utils/kernel_funcs_utils"),o=e("../kernel_utils/shared");let l=a.CHECK_NAN_SNIPPET_UNARY+` return x< 0.0 ? 0./0. : log(x); `,i=` vec4 result = log(x); bvec4 isNaN = isnan(x); result.r = isNaN.r ? x.r : (x.r < 0.0 ? 0./0. : result.r); result.g = isNaN.g ? x.g : (x.g < 0.0 ? 0./0. : result.g); 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; `,u=(0,a.unaryKernelFunc)({opSnippet:l,packedOpSnippet:i,cpuKernelImpl:o.logImplCPU}),p={kernelName:s.Log,backendName:"webgl",kernelFunc:u}},{"@tensorflow/tfjs-core":"2nuhV","../kernel_utils/kernel_funcs_utils":"jMepo","../kernel_utils/shared":"01kMd","@parcel/transformer-js/src/esmodule-helpers.js":"9pCYc"}],"1x1xV":[function(e,t,r){/** * @license * Copyright 2020 Google LLC. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. * ============================================================================= */var n=e("@parcel/transformer-js/src/esmodule-helpers.js");n.defineInteropFlag(r),n.export(r,"log1p",()=>l),n.export(r,"log1pConfig",()=>i);var s=e("@tensorflow/tfjs-core"),a=e("../kernel_utils/kernel_funcs_utils");let o=a.CHECK_NAN_SNIPPET_UNARY+` return log(1.0 + x); `,l=(0,a.unaryKernelFunc)({opSnippet:o}),i={kernelName:s.Log1p,backendName:"webgl",kernelFunc:l}},{"@tensorflow/tfjs-core":"2nuhV","../kernel_utils/kernel_funcs_utils":"jMepo","@parcel/transformer-js/src/esmodule-helpers.js":"9pCYc"}],dFsxi:[function(e,t,r){/** * @license * Copyright 2020 Google LLC. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. * ============================================================================= */var n=e("@parcel/transformer-js/src/esmodule-helpers.js");n.defineInteropFlag(r),n.export(r,"logicalAnd",()=>l),n.export(r,"logicalAndConfig",()=>i);var s=e("@tensorflow/tfjs-core"),a=e("../kernel_utils/kernel_funcs_utils");let o=` return vec4( vec4(greaterThanEqual(a, vec4(1.0))) * vec4(greaterThanEqual(b, vec4(1.0)))); `,l=(0,a.binaryKernelFunc)({opSnippet:"return float(a >= 1.0 && b >= 1.0);",packedOpSnippet:o,dtype:"bool"}),i={kernelName:s.LogicalAnd,backendName:"webgl",kernelFunc:l}},{"@tensorflow/tfjs-core":"2nuhV","../kernel_utils/kernel_funcs_utils":"jMepo","@parcel/transformer-js/src/esmodule-helpers.js":"9pCYc"}],"82qaf":[function(e,t,r){/** * @license * Copyright 2020 Google LLC. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. * ============================================================================= */var n=e("@parcel/transformer-js/src/esmodule-helpers.js");n.defineInteropFlag(r),n.export(r,"logicalNot",()=>a),n.export(r,"logicalNotConfig",()=>o);var s=e("@tensorflow/tfjs-core");let a=(0,e("../kernel_utils/kernel_funcs_utils").unaryKernelFunc)({opSnippet:"return float(!(x >= 1.0));"}),o={kernelName:s.LogicalNot,backendName:"webgl",kernelFunc:a}},{"@tensorflow/tfjs-core":"2nuhV","../kernel_utils/kernel_funcs_utils":"jMepo","@parcel/transformer-js/src/esmodule-helpers.js":"9pCYc"}],"2WeL3":[function(e,t,r){/** * @license * Copyright 2020 Google LLC. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. * ============================================================================= */var n=e("@parcel/transformer-js/src/esmodule-helpers.js");n.defineInteropFlag(r),n.export(r,"logicalOr",()=>l),n.export(r,"logicalOrConfig",()=>i);var s=e("@tensorflow/tfjs-core"),a=e("../kernel_utils/kernel_funcs_utils");let o=` return min( vec4(greaterThanEqual(a, vec4(1.0))) + vec4(greaterThanEqual(b, vec4(1.0))), vec4(1.0)); `,l=(0,a.binaryKernelFunc)({opSnippet:"return float(a >= 1.0 || b >= 1.0);",packedOpSnippet:o,dtype:"bool"}),i={kernelName:s.LogicalOr,backendName:"webgl",kernelFunc:l}},{"@tensorflow/tfjs-core":"2nuhV","../kernel_utils/kernel_funcs_utils":"jMepo","@parcel/transformer-js/src/esmodule-helpers.js":"9pCYc"}],"8fQO3":[function(e,t,r){/** * @license * Copyright 2020 Google LLC. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. * ============================================================================= */var n=e("@parcel/transformer-js/src/esmodule-helpers.js");n.defineInteropFlag(r),n.export(r,"lrn",()=>l),n.export(r,"LRNConfig",()=>i);var s=e("@tensorflow/tfjs-core"),a=e("../lrn_gpu"),o=e("../lrn_packed_gpu");let l=e=>{let{inputs:t,backend:r,attrs:n}=e,{x:l}=t,{depthRadius:i,bias:u,alpha:p,beta:c}=n,d=(0,s.env)().getBool("WEBGL_PACK_NORMALIZATION")?new o.LRNPackedProgram(l.shape,i,u,p,c):new a.LRNProgram(l.shape,i,u,p,c);return r.runWebGLProgram(d,[l],l.dtype)},i={kernelName:s.LRN,backendName:"webgl",kernelFunc:l}},{"@tensorflow/tfjs-core":"2nuhV","../lrn_gpu":"1L1HP","../lrn_packed_gpu":"1xp2s","@parcel/transformer-js/src/esmodule-helpers.js":"9pCYc"}],"1L1HP":[function(e,t,r){/** * @license * Copyright 2017 Google LLC. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. * ============================================================================= */var n=e("@parcel/transformer-js/src/esmodule-helpers.js");n.defineInteropFlag(r),n.export(r,"LRNProgram",()=>s);class s{constructor(e,t,r,n,s){let a;this.variableNames=["x"],this.outputShape=[];let o=e[3]-1;this.outputShape=e;let l=`float(${r}) + float(${n}) * sum`;a=.5===s?`inversesqrt(${l})`:1===s?`1.0/(${l})`:`exp(log(${l}) * float(-${s}));`,this.userCode=` void main() { ivec4 coords = getOutputCoords(); int b = coords[0]; int r = coords[1]; int c = coords[2]; int d = coords[3]; float x = getX(b, r, c, d); float sum = 0.0; for (int j = -${t}; j<= ${t}; j++) { int idx = d + j; if (idx >= 0 && idx<= ${o}) { float z = getX(b, r, c, idx); sum += z * z; } } float val = x * ${a}; setOutput(val); } `}}},{"@parcel/transformer-js/src/esmodule-helpers.js":"9pCYc"}],"1xp2s":[function(e,t,r){/** * @license * Copyright 2019 Google LLC. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. * ============================================================================= */var n=e("@parcel/transformer-js/src/esmodule-helpers.js");n.defineInteropFlag(r),n.export(r,"LRNPackedProgram",()=>s);class s{constructor(e,t,r,n,s){let a;this.variableNames=["x"],this.outputShape=[],this.packedInputs=!0,this.packedOutput=!0;let o=e[3]-1;this.outputShape=e;let l=`float(${r}) + float(${n}) * sum`;a=.5===s?`inversesqrt(${l})`:1===s?`1.0/(${l})`:`exp(log(${l}) * float(-${s}));`,this.userCode=` void main() { ivec4 coords = getOutputCoords(); int b = coords.x; int r = coords.y; int c = coords.z; int d = coords.w; bool hasNextCol = d< ${this.outputShape[3]}; bool hasNextRow = c < ${this.outputShape[2]}; vec4 sum = vec4(0.); vec4 xFragAtOutputCoords = getX(b, r, c, d); vec4 xAtOutputCoords = vec4( getChannel(xFragAtOutputCoords, vec2(c, d)), hasNextCol ? getChannel(xFragAtOutputCoords, vec2(c, d + 1)) : 0.0, hasNextRow ? getChannel(xFragAtOutputCoords , vec2(c + 1, d)) : 0.0, (hasNextRow && hasNextCol) ? getChannel(xFragAtOutputCoords, vec2(c + 1, d + 1)) : 0.0 ); int firstChannel = d - ${t}; vec2 cache = vec2(0.); if(firstChannel >= 0){ vec4 firstChannelFrag = getX(b, r, c, firstChannel); cache.x = getChannel(firstChannelFrag, vec2(c, firstChannel)); if(hasNextRow){ cache.y = getChannel(firstChannelFrag, vec2(c + 1, firstChannel)); } } ivec2 depth = ivec2(d, d + 1); for (int j = - ${t}; j<= ${t}; j++) { ivec2 idx = depth + j; bvec2 aboveLowerBound = greaterThanEqual(idx, ivec2(0)); bvec2 belowUpperBound = lessThanEqual(idx, ivec2(${o})); bool depthInRange = aboveLowerBound.x && belowUpperBound.x; bool depthPlusOneInRange = aboveLowerBound.y && belowUpperBound.y; if(depthInRange || depthPlusOneInRange){ vec4 z = vec4(0.); vec4 xFragAtCurrentDepth; z.xz = cache.xy; if(depthPlusOneInRange && hasNextCol){ xFragAtCurrentDepth = idx.y != d ? getX(b, r, c, idx.y) : xFragAtOutputCoords; z.y = getChannel(xFragAtCurrentDepth, vec2(c, idx.y)); if(hasNextRow){ z.w = getChannel(xFragAtCurrentDepth, vec2(c + 1, idx.y)); } } cache.xy = z.yw; sum += z * z; } } vec4 result = xAtOutputCoords * ${a}; setOutput(result); } `}}},{"@parcel/transformer-js/src/esmodule-helpers.js":"9pCYc"}],hKNPS:[function(e,t,r){/** * @license * Copyright 2020 Google LLC. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. * ============================================================================= */var n=e("@parcel/transformer-js/src/esmodule-helpers.js");n.defineInteropFlag(r),n.export(r,"lrnGrad",()=>o),n.export(r,"LRNGradConfig",()=>l);var s=e("@tensorflow/tfjs-core"),a=e("../lrn_grad_gpu");let o=e=>{let{inputs:t,backend:r,attrs:n}=e,{x:s,y:o,dy:l}=t,{depthRadius:i,bias:u,alpha:p,beta:c}=n,d=new a.LRNGradProgram(s.shape,i,u,p,c);return r.runWebGLProgram(d,[s,o,l],s.dtype)},l={kernelName:s.LRNGrad,backendName:"webgl",kernelFunc:o}},{"@tensorflow/tfjs-core":"2nuhV","../lrn_grad_gpu":"4ExZT","@parcel/transformer-js/src/esmodule-helpers.js":"9pCYc"}],"4ExZT":[function(e,t,r){/** * @license * Copyright 2018 Google LLC. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. * ============================================================================= */var n=e("@parcel/transformer-js/src/esmodule-helpers.js");n.defineInteropFlag(r),n.export(r,"LRNGradProgram",()=>s);class s{constructor(e,t,r,n,s){this.variableNames=["inputImage","outputImage","dy"],this.outputShape=[],this.outputShape=e,this.depth=e[3],this.depthRadius=t,this.bias=r,this.alpha=n,this.beta=s,this.userCode=` void main() { ivec4 coords = getOutputCoords(); int b = coords[0]; int r = coords[1]; int c = coords[2]; float result = 0.0; for (int d = 0; d< ${this.depth}; ++d) { int depthBegin = int(max(0.0, float(d - ${t}))); int depthEnd = int(min(float(${this.depth}), float(d + ${t} + 1))); const int MIN_DEPTH_BEGIN = 0; const int MAX_DEPTH_END = ${this.depth}; float norm = 0.0; for (int k = MIN_DEPTH_BEGIN; k < MAX_DEPTH_END; ++k) { if (k < depthBegin){ continue; } else if (k >= depthBegin && k< depthEnd) { norm += getInputImage(b, r, c, k) * getInputImage(b, r, c, k); } else { break; } } norm = float(${n}) * norm + float(${r}); for(int k = MIN_DEPTH_BEGIN; k < MAX_DEPTH_END; ++k){ if (k < depthBegin){ continue; } else if (k >= depthBegin && k< depthEnd){ float dyi = -2.0 * float(${n}) * float(${s}) * getInputImage(b, r, c, k) * getOutputImage(b, r, c, d) / norm; if (k == d) { dyi += pow(norm, -1.0 * ${s}); } if (k == coords[3]) { dyi *= getDy(b, r, c, d); result += dyi; } } else { break; } } } setOutput(result); } `}}},{"@parcel/transformer-js/src/esmodule-helpers.js":"9pCYc"}],"1NJ4x":[function(e,t,r){/** * @license * Copyright 2020 Google LLC. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. * ============================================================================= */var n=e("@parcel/transformer-js/src/esmodule-helpers.js");n.defineInteropFlag(r),n.export(r,"max",()=>i),n.export(r,"maxConfig",()=>u);var s=e("@tensorflow/tfjs-core"),a=e("../kernel_utils/shared"),o=e("./Max_impl"),l=e("./Transpose_impl");function i(e){let t;let{inputs:r,backend:n,attrs:i}=e,{x:u}=r,{reductionIndices:p,keepDims:c}=i,d=u.shape.length,f=(0,s.util).parseAxisParam(p,u.shape),h=f,m=(0,s.backend_util).getAxesPermutation(h,d),g=null!=m,x=n.shouldExecuteOnCPU([u]),v=u;if(g){if(x){let e=n.texData.get(v.dataId).values,t=Array(d);for(let e=0;el);var s=e("@tensorflow/tfjs-core"),a=e("../kernel_utils/reduce"),o=e("../kernels/Reshape");function l(e,t,r,n){let l=(0,s.util).sizeFromShape(t),i=(0,s.util).sizeFromShape(e.shape),u=(0,o.reshape)({inputs:{x:e},attrs:{shape:[i/l,l]},backend:n}),p=(0,a.reduce)(u,e.dtype,"max",n),c=(0,o.reshape)({inputs:{x:p},attrs:{shape:r},backend:n});return n.disposeIntermediateTensorInfo(u),n.disposeIntermediateTensorInfo(p),c}},{"@tensorflow/tfjs-core":"2nuhV","../kernel_utils/reduce":"dRjVh","../kernels/Reshape":"cgfGf","@parcel/transformer-js/src/esmodule-helpers.js":"9pCYc"}],iIAVk:[function(e,t,r){/** * @license * Copyright 2020 Google LLC. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. * ============================================================================= */var n=e("@parcel/transformer-js/src/esmodule-helpers.js");n.defineInteropFlag(r),n.export(r,"maximum",()=>c),n.export(r,"maximumConfig",()=>d);var s=e("@tensorflow/tfjs-core"),a=e("../binaryop_gpu"),o=e("../binaryop_packed_gpu"),l=e("../kernel_utils/kernel_funcs_utils"),i=e("../kernel_utils/shared");let u=a.CHECK_NAN_SNIPPET+` return max(a, b); `,p=` 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); `+o.CHECK_NAN_SNIPPET_PACKED+` return result; `,c=(0,l.binaryKernelFunc)({opSnippet:u,packedOpSnippet:p,cpuKernelImpl:i.maximumImplCPU}),d={kernelName:s.Maximum,backendName:"webgl",kernelFunc:c}},{"@tensorflow/tfjs-core":"2nuhV","../binaryop_gpu":"ilh7x","../binaryop_packed_gpu":"f1UiT","../kernel_utils/kernel_funcs_utils":"jMepo","../kernel_utils/shared":"01kMd","@parcel/transformer-js/src/esmodule-helpers.js":"9pCYc"}],dhN4J:[function(e,t,r){/** * @license * Copyright 2020 Google LLC. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. * ============================================================================= */var n=e("@parcel/transformer-js/src/esmodule-helpers.js");n.defineInteropFlag(r),n.export(r,"maxPool",()=>i),n.export(r,"maxPoolConfig",()=>u);var s=e("@tensorflow/tfjs-core"),a=e("../pool_gpu"),o=e("../webgl_util"),l=e("./Identity");function i(e){let{inputs:t,backend:r,attrs:n}=e,{x:i}=t;(0,o.assertNotComplex)(i,"maxPool");let{filterSize:u,strides:p,pad:c,dimRoundingMode:d}=n;(0,s.util).assert((0,s.backend_util).eitherStridesOrDilationsAreOne(p,1),()=>`Error in maxPool: Either strides or dilations must be 1. Got strides ${p} and dilations '1'`);let f=(0,s.backend_util).computePool2DInfo(i.shape,u,p,1,c,d);if(1===f.filterWidth&&1===f.filterHeight&&(0,s.util).arraysEqual(f.inShape,f.outShape))return(0,l.identity)({inputs:{x:i},backend:r});let h=new a.Pool2DProgram(f,"max",!1);return r.runWebGLProgram(h,[i],i.dtype)}let u={kernelName:s.MaxPool,backendName:"webgl",kernelFunc:i}},{"@tensorflow/tfjs-core":"2nuhV","../pool_gpu":"awkae","../webgl_util":"90dxa","./Identity":"4GZPt","@parcel/transformer-js/src/esmodule-helpers.js":"9pCYc"}],"8hzKq":[function(e,t,r){/** * @license * Copyright 2020 Google LLC. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. * ============================================================================= */var n=e("@parcel/transformer-js/src/esmodule-helpers.js");n.defineInteropFlag(r),n.export(r,"maxPool3d",()=>o),n.export(r,"maxPool3DConfig",()=>l);var s=e("@tensorflow/tfjs-core"),a=e("../pool_gpu");function o(e){let{inputs:t,backend:r,attrs:n}=e,{x:o}=t,{filterSize:l,strides:i,pad:u,dataFormat:p,dimRoundingMode:c}=n,d=(0,s.backend_util).computePool3DInfo(o.shape,l,i,[1,1,1],u,c,p),f=new a.Pool3DProgram(d,"max",!1);return r.runWebGLProgram(f,[o],o.dtype)}let l={kernelName:s.MaxPool3D,backendName:"webgl",kernelFunc:o}},{"@tensorflow/tfjs-core":"2nuhV","../pool_gpu":"awkae","@parcel/transformer-js/src/esmodule-helpers.js":"9pCYc"}],"8Gc7C":[function(e,t,r){/** * @license * Copyright 2020 Google LLC. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. * ============================================================================= */var n=e("@parcel/transformer-js/src/esmodule-helpers.js");n.defineInteropFlag(r),n.export(r,"maxPool3DGrad",()=>l),n.export(r,"maxPool3DGradConfig",()=>i);var s=e("@tensorflow/tfjs-core"),a=e("../max_pool_backprop_gpu"),o=e("../pool_gpu");function l(e){let{inputs:t,backend:r,attrs:n}=e,{dy:l,input:i}=t,{filterSize:u,strides:p,pad:c,dimRoundingMode:d}=n,f=(0,s.backend_util).computePool3DInfo(i.shape,u,p,[1,1,1],c,d),h=new o.Pool3DProgram(f,"max",!0),m=r.runWebGLProgram(h,[i],i.dtype),g=new a.MaxPool3DBackpropProgram(f),x=r.runWebGLProgram(g,[l,m],i.dtype);return r.disposeIntermediateTensorInfo(m),x}let i={kernelName:s.MaxPool3DGrad,backendName:"webgl",kernelFunc:l}},{"@tensorflow/tfjs-core":"2nuhV","../max_pool_backprop_gpu":"2R8Uk","../pool_gpu":"awkae","@parcel/transformer-js/src/esmodule-helpers.js":"9pCYc"}],"2R8Uk":[function(e,t,r){/** * @license * Copyright 2017 Google LLC. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. * ============================================================================= */var n=e("@parcel/transformer-js/src/esmodule-helpers.js");n.defineInteropFlag(r),n.export(r,"MaxPool2DBackpropProgram",()=>s),n.export(r,"MaxPool3DBackpropProgram",()=>a);class s{constructor(e){this.variableNames=["dy","maxPos"],this.outputShape=e.inShape;let t=e.strideHeight,r=e.strideWidth,n=e.dilationHeight,s=e.effectiveFilterHeight,a=e.effectiveFilterWidth,o=s-1-e.padInfo.top,l=a-1-e.padInfo.left;this.userCode=` const ivec2 pads = ivec2(${o}, ${l}); void main() { ivec4 coords = getOutputCoords(); int b = coords[0]; int d = coords[3]; ivec2 dyRCCorner = coords.yz - pads; int dyRCorner = dyRCCorner.x; int dyCCorner = dyRCCorner.y; // Convolve dy(?, ?, d) with pos mask(:, :, d) to get dx(xR, xC, d). // ? = to be determined. : = across all values in that axis. float dotProd = 0.0; for (int wR = 0; wR< ${s}; wR += ${n}) { float dyR = float(dyRCorner + wR) / ${t}.0; if (dyR < 0.0 || dyR >= ${e.outHeight}.0 || fract(dyR) > 0.0) { continue; } int idyR = int(dyR); for (int wC = 0; wC< ${a}; wC++) { float dyC = float(dyCCorner + wC) / ${r}.0; if (dyC < 0.0 || dyC >= ${e.outWidth}.0 || fract(dyC) > 0.0) { continue; } int idyC = int(dyC); float dyValue = getDy(b, idyR, idyC, d); int maxPosValue = ${s*a-1} - int(getMaxPos(b, idyR, idyC, d)); // Get the current value, check it against the value from the // position matrix. int curPosValue = wR * ${a} + wC; float mask = float(maxPosValue == curPosValue ? 1.0 : 0.0); dotProd += dyValue * mask; } } setOutput(dotProd); } `}}class a{constructor(e){this.variableNames=["dy","maxPos"],this.outputShape=e.inShape;let t=e.strideDepth,r=e.strideHeight,n=e.strideWidth,s=e.dilationDepth,a=e.dilationHeight,o=e.dilationWidth,l=e.effectiveFilterDepth,i=e.effectiveFilterHeight,u=e.effectiveFilterWidth,p=l-1-e.padInfo.front,c=i-1-e.padInfo.top,d=u-1-e.padInfo.left;this.userCode=` const ivec3 pads = ivec3(${p}, ${c}, ${d}); void main() { ivec5 coords = getOutputCoords(); int batch = coords.x; int ch = coords.u; ivec3 dyCorner = ivec3(coords.y, coords.z, coords.w) - pads; int dyDCorner = dyCorner.x; int dyRCorner = dyCorner.y; int dyCCorner = dyCorner.z; // Convolve dy(?, ?, ?, ch) with pos mask(:, :, :, d) to get // dx(xD, xR, xC, ch). // ? = to be determined. : = across all values in that axis. float dotProd = 0.0; for (int wD = 0; wD< ${l}; wD += ${s}) { float dyD = float(dyDCorner + wD) / ${t}.0; if (dyD < 0.0 || dyD >= ${e.outDepth}.0 || fract(dyD) > 0.0) { continue; } int idyD = int(dyD); for (int wR = 0; wR< ${i}; wR += ${a}) { float dyR = float(dyRCorner + wR) / ${r}.0; if (dyR < 0.0 || dyR >= ${e.outHeight}.0 || fract(dyR) > 0.0) { continue; } int idyR = int(dyR); for (int wC = 0; wC< ${u}; wC += ${o}) { float dyC = float(dyCCorner + wC) / ${n}.0; if (dyC < 0.0 || dyC >= ${e.outWidth}.0 || fract(dyC) > 0.0) { continue; } int idyC = int(dyC); float dyValue = getDy(batch, idyD, idyR, idyC, ch); int maxPosValue = ${l*i*u-1} - int(getMaxPos(batch, idyD, idyR, idyC, ch)); // Get the current value, check it against the value from the // position matrix. int curPosValue = wD * ${i} * ${u} + wR * ${u} + wC; float mask = float(maxPosValue == curPosValue ? 1.0 : 0.0); dotProd += dyValue * mask; } } } setOutput(dotProd); } `}}},{"@parcel/transformer-js/src/esmodule-helpers.js":"9pCYc"}],kw4s4:[function(e,t,r){/** * @license * Copyright 2020 Google LLC. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. * ============================================================================= */var n=e("@parcel/transformer-js/src/esmodule-helpers.js");n.defineInteropFlag(r),n.export(r,"maxPoolGrad",()=>i),n.export(r,"maxPoolGradConfig",()=>u);var s=e("@tensorflow/tfjs-core"),a=e("../max_pool_backprop_gpu"),o=e("../pool_gpu"),l=e("../webgl_util");function i(e){let{inputs:t,backend:r,attrs:n}=e,{dy:i,input:u,output:p}=t;(0,l.assertNotComplex)([u,p],"maxPoolGrad");let{filterSize:c,strides:d,pad:f,dimRoundingMode:h}=n,m=(0,s.backend_util).computePool2DInfo(u.shape,c,d,1,f,h),g=new o.Pool2DProgram(m,"max",!0),x=r.runWebGLProgram(g,[u],u.dtype),v=new a.MaxPool2DBackpropProgram(m),y=r.runWebGLProgram(v,[i,x],u.dtype);return r.disposeIntermediateTensorInfo(x),y}let u={kernelName:s.MaxPoolGrad,backendName:"webgl",kernelFunc:i}},{"@tensorflow/tfjs-core":"2nuhV","../max_pool_backprop_gpu":"2R8Uk","../pool_gpu":"awkae","../webgl_util":"90dxa","@parcel/transformer-js/src/esmodule-helpers.js":"9pCYc"}],lVva0:[function(e,t,r){/** * @license * Copyright 2020 Google LLC. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. * ============================================================================= */var n=e("@parcel/transformer-js/src/esmodule-helpers.js");n.defineInteropFlag(r),n.export(r,"maxPoolWithArgmaxConfig",()=>o);var s=e("@tensorflow/tfjs-core"),a=e("./MaxPoolWithArgmax_impl");let o={kernelName:s.MaxPoolWithArgmax,backendName:"webgl",kernelFunc:({inputs:e,attrs:t,backend:r})=>{let{x:n}=e,{filterSize:o,strides:l,pad:i,includeBatchInIndex:u}=t;(0,s.util).assert(4===n.shape.length,()=>`Error in maxPool: input must be rank 4 but got rank ${n.shape.length}.`);let p=[1,1];(0,s.util).assert((0,s.backend_util).eitherStridesOrDilationsAreOne(l,p),()=>`Error in maxPool: Either strides or dilations must be 1. Got strides ${l} and dilations '${p}'`);let c=(0,s.backend_util).computePool2DInfo(n.shape,o,l,p,i),[d,f]=(0,a.maxPoolWithArgmaxImpl)(n,u,c,r);return[d,f]}}},{"@tensorflow/tfjs-core":"2nuhV","./MaxPoolWithArgmax_impl":"bqiOX","@parcel/transformer-js/src/esmodule-helpers.js":"9pCYc"}],bqiOX:[function(e,t,r){/** * @license * Copyright 2020 Google LLC. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. * ============================================================================= */var n=e("@parcel/transformer-js/src/esmodule-helpers.js");n.defineInteropFlag(r),n.export(r,"maxPoolWithArgmaxImpl",()=>a);var s=e("../pool_gpu");function a(e,t,r,n){let a=new s.Pool2DProgram(r,"max",!1),o=n.runWebGLProgram(a,[e],"float32");return a=new s.Pool2DProgram(r,"max",!0,!0,t),[o,n.runWebGLProgram(a,[e],"float32")]}},{"../pool_gpu":"awkae","@parcel/transformer-js/src/esmodule-helpers.js":"9pCYc"}],"39h70":[function(e,t,r){/** * @license * Copyright 2020 Google LLC. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. * ============================================================================= */var n=e("@parcel/transformer-js/src/esmodule-helpers.js");n.defineInteropFlag(r),n.export(r,"meanConfig",()=>l);var s=e("@tensorflow/tfjs-core"),a=e("./Mean_impl"),o=e("./Transpose_impl");let l={kernelName:s.Mean,backendName:"webgl",kernelFunc:({inputs:e,attrs:t,backend:r})=>{let{x:n}=e,{keepDims:l,axis:i}=t,u=n.shape.length,p=(0,s.util).parseAxisParam(i,n.shape),c=p,d=(0,s.backend_util).getAxesPermutation(c,u),f=null!=d,h=r.shouldExecuteOnCPU([n]),m=[],g=n;if(f){if(h){let e=r.texData.get(g.dataId).values,t=Array(u);for(let e=0;el);var s=e("@tensorflow/tfjs-core"),a=e("../kernel_utils/reduce"),o=e("../kernels/Reshape");function l(e,t,r,n){let l=(0,s.util).sizeFromShape(t),i=(0,s.util).sizeFromShape(e.shape),u=(0,o.reshape)({inputs:{x:e},attrs:{shape:[i/l,l]},backend:n}),p=(0,a.reduce)(u,"float32","mean",n),c=(0,o.reshape)({inputs:{x:p},attrs:{shape:r},backend:n});return n.disposeIntermediateTensorInfo(u),n.disposeIntermediateTensorInfo(p),c}},{"@tensorflow/tfjs-core":"2nuhV","../kernel_utils/reduce":"dRjVh","../kernels/Reshape":"cgfGf","@parcel/transformer-js/src/esmodule-helpers.js":"9pCYc"}],g7S8i:[function(e,t,r){/** * @license * Copyright 2020 Google LLC. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. * ============================================================================= */var n=e("@parcel/transformer-js/src/esmodule-helpers.js");n.defineInteropFlag(r),n.export(r,"min",()=>i),n.export(r,"minConfig",()=>u);var s=e("@tensorflow/tfjs-core"),a=e("../kernel_utils/reduce"),o=e("./Reshape"),l=e("./Transpose");function i(e){let t;let{inputs:r,backend:n,attrs:i}=e,{x:u}=r,{axis:p,keepDims:c}=i,d=u.shape.length,f=(0,s.util).parseAxisParam(p,u.shape),h=f,m=(0,s.backend_util).getAxesPermutation(h,d),g=u;null!=m&&(g=(0,l.transpose)({inputs:{x:u},backend:n,attrs:{perm:m}}),h=(0,s.backend_util).getInnerMostAxes(h.length,u.shape.length)),(0,s.backend_util).assertAxesAreInnerMostDims("min",h,d);let[x,v]=(0,s.backend_util).computeOutAndReduceShapes(g.shape,h),y=(0,s.util).sizeFromShape(v),b=(0,o.reshape)({inputs:{x:g},backend:n,attrs:{shape:[-1,y]}}),_=(0,a.reduce)(b,b.dtype,"min",n);if(c){let e=(0,s.backend_util).expandShapeToKeepDim(x,f);t=(0,o.reshape)({inputs:{x:_},backend:n,attrs:{shape:e}})}else t=(0,o.reshape)({inputs:{x:_},backend:n,attrs:{shape:x}});return n.disposeIntermediateTensorInfo(b),n.disposeIntermediateTensorInfo(_),null!=m&&n.disposeIntermediateTensorInfo(g),t}let u={kernelName:s.Min,backendName:"webgl",kernelFunc:i}},{"@tensorflow/tfjs-core":"2nuhV","../kernel_utils/reduce":"dRjVh","./Reshape":"cgfGf","./Transpose":"jIlsI","@parcel/transformer-js/src/esmodule-helpers.js":"9pCYc"}],eLBQM:[function(e,t,r){/** * @license * Copyright 2020 Google LLC. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. * ============================================================================= */var n=e("@parcel/transformer-js/src/esmodule-helpers.js");n.defineInteropFlag(r),n.export(r,"minimum",()=>c),n.export(r,"minimumConfig",()=>d);var s=e("@tensorflow/tfjs-core"),a=e("../binaryop_gpu"),o=e("../binaryop_packed_gpu"),l=e("../kernel_utils/kernel_funcs_utils"),i=e("../kernel_utils/shared");let u=a.CHECK_NAN_SNIPPET+` return min(a, b); `,p=` 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); `+o.CHECK_NAN_SNIPPET_PACKED+` return result; `,c=(0,l.binaryKernelFunc)({opSnippet:u,packedOpSnippet:p,cpuKernelImpl:i.minimumImplCPU}),d={kernelName:s.Minimum,backendName:"webgl",kernelFunc:c}},{"@tensorflow/tfjs-core":"2nuhV","../binaryop_gpu":"ilh7x","../binaryop_packed_gpu":"f1UiT","../kernel_utils/kernel_funcs_utils":"jMepo","../kernel_utils/shared":"01kMd","@parcel/transformer-js/src/esmodule-helpers.js":"9pCYc"}],iQZhS:[function(e,t,r){/** * @license * Copyright 2020 Google LLC. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. * ============================================================================= */var n=e("@parcel/transformer-js/src/esmodule-helpers.js");n.defineInteropFlag(r),n.export(r,"mirrorPadKernelFunc",()=>l),n.export(r,"mirrorPadConfig",()=>i);var s=e("@tensorflow/tfjs-core"),a=e("../mirror_pad_gpu"),o=e("../mirror_pad_packed_gpu");let l=({inputs:e,backend:t,attrs:r})=>{let{x:n}=e,{paddings:l,mode:i}=r,u=(0,s.env)().getBool("WEBGL_PACK_ARRAY_OPERATIONS")?new o.MirrorPadPackedProgram(n.shape,l,i):new a.MirrorPadProgram(n.shape,l,i);return t.runWebGLProgram(u,[n],n.dtype)},i={kernelName:s.MirrorPad,backendName:"webgl",kernelFunc:l}},{"@tensorflow/tfjs-core":"2nuhV","../mirror_pad_gpu":"k7J4V","../mirror_pad_packed_gpu":"gistY","@parcel/transformer-js/src/esmodule-helpers.js":"9pCYc"}],k7J4V:[function(e,t,r){/** * @license * Copyright 2020 Google LLC. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. * ============================================================================= */var n=e("@parcel/transformer-js/src/esmodule-helpers.js");n.defineInteropFlag(r),n.export(r,"MirrorPadProgram",()=>a);var s=e("./shader_compiler");class a{constructor(e,t,r){this.variableNames=["x"],this.outputShape=t.map((t,r)=>t[0]+e[r]+t[1]);let n=e.length,a=(0,s.getCoordsDataType)(n),o=t.map(e=>e[0]).join(","),l=t.map((t,r)=>t[0]+e[r]).join(","),i=["coords[0]","coords[1]","coords[2]","coords[3]"].slice(0,n),u="reflect"===r?0:1;if(1===n){this.userCode=` int start = ${o}; int end = ${l}; void main() { int outC = getOutputCoords(); if (outC< start) { outC = start * 2 - outC - ${u}; } else if(outC >= end) { outC = (end - 1) * 2 - outC + ${u}; } setOutput(getX(outC - start)); } `;return}this.userCode=` ${a} start = ${a}(${o}); ${a} end = ${a}(${l}); void main() { ${a} outC = getOutputCoords(); for (int i = 0; i< ${n}; i++) { if (outC[i] < start[i]) { outC[i] = start[i] * 2 - outC[i] - ${u}; } else if(outC[i] >= end[i]) { outC[i] = (end[i] - 1) * 2 - outC[i] + ${u}; } } ${a} coords = outC - start; setOutput(getX(${i})); } `}}},{"./shader_compiler":"3kYYB","@parcel/transformer-js/src/esmodule-helpers.js":"9pCYc"}],gistY:[function(e,t,r){/** * @license * Copyright 2020 Google LLC. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. * ============================================================================= */var n=e("@parcel/transformer-js/src/esmodule-helpers.js");n.defineInteropFlag(r),n.export(r,"MirrorPadPackedProgram",()=>o);var s=e("./packing_util"),a=e("./shader_compiler");class o{constructor(e,t,r){this.variableNames=["x"],this.packedInputs=!0,this.packedOutput=!0,this.outputShape=t.map((t,r)=>t[0]+e[r]+t[1]);let n=e.length,o=(0,a.getCoordsDataType)(n),l=t.map(e=>e[0]).join(","),i=t.map((t,r)=>t[0]+e[r]).join(","),u=(0,s.getChannels)("rc",n),p=(0,s.getChannels)("source",n),c=`${u[n-1]}< ${this.outputShape[n-1]}`,d=1===n?"source":`vec2(${p.slice(-2).join()})`,f="reflect"===r?0:1,h="";if(1===n){let e=` ${o} source = rc; if (source < start) { source = start * 2 - source - ${f}; } else if (source >= end) { source = (end - 1) * 2 - source + ${f}; } source -= start; `;h=` ${o} rc = outputLoc; ${e} result[0] = getChannel(getX(${p.join()}), ${d}); ${u[n-1]} += 1; if(${c}) { ${e} result[1] = getChannel(getX(${p.join()}), ${d}); } `}else{let e=` ${o} source = rc; ${o} lt = ${o}(lessThan(source, start)); ${o} gte = ${o}(greaterThanEqual(source, end)); ${o} orig = 1 - (lt + gte); source = orig * source + lt * (start * 2 - source - ${f}) + gte * ((end - 1) * 2 - source + ${f}); source -= start; `;h=` ${o} rc = outputLoc; ${e} result[0] = getChannel(getX(${p.join()}), ${d}); ${u[n-1]} += 1; if(${c}) { ${e} result[1] = getChannel(getX(${p.join()}), ${d}); } rc = outputLoc; ${u[n-2]} += 1; if(${u[n-2]}< ${this.outputShape[n-2]}) { ${e} result[2] = getChannel(getX(${p.join()}), ${d}); ${u[n-1]} += 1; if(${c}) { ${e} result[3] = getChannel(getX(${p.join()}), ${d}); } } `}this.userCode=` const ${o} start = ${o}(${l}); const ${o} end = ${o}(${i}); void main() { ${o} outputLoc = getOutputCoords(); vec4 result = vec4(0.); ${h} setOutput(result); } `}}},{"./packing_util":"6V5sg","./shader_compiler":"3kYYB","@parcel/transformer-js/src/esmodule-helpers.js":"9pCYc"}],"4N1d3":[function(e,t,r){/** * @license * Copyright 2020 Google LLC. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. * ============================================================================= */var n=e("@parcel/transformer-js/src/esmodule-helpers.js");n.defineInteropFlag(r),n.export(r,"mod",()=>u),n.export(r,"modConfig",()=>p);var s=e("@tensorflow/tfjs-core"),a=e("../binaryop_packed_gpu"),o=e("../kernel_utils/kernel_funcs_utils");let l=`if (b == 0.0) return NAN; return mod(a, b);`,i=` vec4 result = mod(a, b); bvec4 isNaN = equal(b, vec4(0.0)); `+a.CHECK_NAN_SNIPPET_PACKED+` return result; `,u=(0,o.binaryKernelFunc)({opSnippet:l,packedOpSnippet:i}),p={kernelName:s.Mod,backendName:"webgl",kernelFunc:u}},{"@tensorflow/tfjs-core":"2nuhV","../binaryop_packed_gpu":"f1UiT","../kernel_utils/kernel_funcs_utils":"jMepo","@parcel/transformer-js/src/esmodule-helpers.js":"9pCYc"}],fAQmI:[function(e,t,r){/** * @license * Copyright 2020 Google LLC. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. * ============================================================================= */var n=e("@parcel/transformer-js/src/esmodule-helpers.js");n.defineInteropFlag(r),n.export(r,"multinomial",()=>l),n.export(r,"multinomialConfig",()=>i);var s=e("@tensorflow/tfjs-core"),a=e("../multinomial_gpu"),o=e("./Softmax");function l(e){let{inputs:t,backend:r,attrs:n}=e,{logits:s}=t,{numSamples:l,seed:i,normalized:u}=n,p=u?s:(0,o.softmax)({inputs:{logits:s},backend:r,attrs:{dim:s.shape.length-1}}),c=p.shape[0],d=p.shape[1],f=new a.MultinomialProgram(c,d,l),h=r.runWebGLProgram(f,[p],"int32",[[i]]);return u||r.disposeIntermediateTensorInfo(p),h}let i={kernelName:s.Multinomial,backendName:"webgl",kernelFunc:l}},{"@tensorflow/tfjs-core":"2nuhV","../multinomial_gpu":"cq4YI","./Softmax":"jU6YA","@parcel/transformer-js/src/esmodule-helpers.js":"9pCYc"}],cq4YI:[function(e,t,r){/** * @license * Copyright 2017 Google LLC. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. * ============================================================================= */var n=e("@parcel/transformer-js/src/esmodule-helpers.js");n.defineInteropFlag(r),n.export(r,"MultinomialProgram",()=>s);class s{constructor(e,t,r){this.variableNames=["probs"],this.customUniforms=[{name:"seed",type:"float"}],this.outputShape=[e,r],this.userCode=` void main() { ivec2 coords = getOutputCoords(); int batch = coords[0]; float r = random(seed); float cdf = 0.0; for (int i = 0; i< ${t-1}; i++) { cdf += getProbs(batch, i); if (r < cdf) { setOutput(float(i)); return; } } // If no other event happened, last event happened. setOutput(float(${t-1})); } `}}},{"@parcel/transformer-js/src/esmodule-helpers.js":"9pCYc"}],jU6YA:[function(e,t,r){/** * @license * Copyright 2020 Google LLC. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. * ============================================================================= */var n=e("@parcel/transformer-js/src/esmodule-helpers.js");n.defineInteropFlag(r),n.export(r,"softmax",()=>c),n.export(r,"softmaxConfig",()=>d);var s=e("@tensorflow/tfjs-core"),a=e("./Exp"),o=e("./Max"),l=e("./RealDiv"),i=e("./Reshape"),u=e("./Sub"),p=e("./Sum");function c(e){let{inputs:t,backend:r,attrs:n}=e,{logits:c}=t,{dim:d}=n,f=(0,s.util).parseAxisParam([d],c.shape),h=(0,o.max)({inputs:{x:c},backend:r,attrs:{reductionIndices:f,keepDims:!1}}),m=(0,s.backend_util).expandShapeToKeepDim(h.shape,f),g=(0,i.reshape)({inputs:{x:h},backend:r,attrs:{shape:m}}),x=(0,u.sub)({inputs:{a:c,b:g},backend:r}),v=(0,a.exp)({inputs:{x:x},backend:r}),y=(0,p.sum)({inputs:{x:v},backend:r,attrs:{axis:f,keepDims:!1}}),b=(0,i.reshape)({inputs:{x:y},backend:r,attrs:{shape:m}}),_=(0,l.realDiv)({inputs:{a:v,b:b},backend:r});return r.disposeIntermediateTensorInfo(h),r.disposeIntermediateTensorInfo(g),r.disposeIntermediateTensorInfo(x),r.disposeIntermediateTensorInfo(v),r.disposeIntermediateTensorInfo(y),r.disposeIntermediateTensorInfo(b),_}let d={kernelName:s.Softmax,backendName:"webgl",kernelFunc:c}},{"@tensorflow/tfjs-core":"2nuhV","./Exp":"kSaqw","./Max":"1NJ4x","./RealDiv":"ikoQ7","./Reshape":"cgfGf","./Sub":"g9ySV","./Sum":"3Zq98","@parcel/transformer-js/src/esmodule-helpers.js":"9pCYc"}],ikoQ7:[function(e,t,r){/** * @license * Copyright 2020 Google LLC. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. * ============================================================================= */var n=e("@parcel/transformer-js/src/esmodule-helpers.js");n.defineInteropFlag(r),n.export(r,"realDiv",()=>i),n.export(r,"realDivConfig",()=>u);var s=e("@tensorflow/tfjs-core"),a=e("../kernel_utils/kernel_funcs_utils");let o=` if (a == b) { return 1.0; }; return a / b;`,l=` // vec4 one = vec4(equal(a, b)); // return one + (vec4(1.0) - one) * a / b; vec4 result = a / b; if(a.x == b.x) { result.x = 1.; } if(a.y == b.y) { result.y = 1.; } if(a.z == b.z) { result.z = 1.; } if(a.w == b.w) { result.w = 1.; } return result; `,i=(0,a.binaryKernelFunc)({opSnippet:o,packedOpSnippet:l,checkOutOfBounds:!0}),u={kernelName:s.RealDiv,backendName:"webgl",kernelFunc:i}},{"@tensorflow/tfjs-core":"2nuhV","../kernel_utils/kernel_funcs_utils":"jMepo","@parcel/transformer-js/src/esmodule-helpers.js":"9pCYc"}],g9ySV:[function(e,t,r){/** * @license * Copyright 2020 Google LLC. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. * ============================================================================= */var n=e("@parcel/transformer-js/src/esmodule-helpers.js");n.defineInteropFlag(r),n.export(r,"sub",()=>i),n.export(r,"subConfig",()=>u);var s=e("@tensorflow/tfjs-core"),a=e("../kernel_utils/kernel_funcs_utils"),o=e("../kernel_utils/shared");let l="return a - b;",i=(0,a.binaryKernelFunc)({opSnippet:l,packedOpSnippet:l,supportsComplex:!0,cpuKernelImpl:o.subImplCPU}),u={kernelName:s.Sub,backendName:"webgl",kernelFunc:i}},{"@tensorflow/tfjs-core":"2nuhV","../kernel_utils/kernel_funcs_utils":"jMepo","../kernel_utils/shared":"01kMd","@parcel/transformer-js/src/esmodule-helpers.js":"9pCYc"}],"3eYOV":[function(e,t,r){/** * @license * Copyright 2020 Google LLC. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. * ============================================================================= */var n=e("@parcel/transformer-js/src/esmodule-helpers.js");n.defineInteropFlag(r),n.export(r,"neg",()=>p),n.export(r,"negConfig",()=>c);var s=e("@tensorflow/tfjs-core"),a=e("../kernel_utils/shared"),o=e("../unaryop_gpu"),l=e("../unaryop_packed_gpu");let i=o.CHECK_NAN_SNIPPET+` return -x; `,u=` vec4 result = -x; bvec4 isNaN = isnan(x); result.r = isNaN.r ? x.r : result.r; result.g = isNaN.g ? x.g : result.g; result.b = isNaN.b ? x.b : result.b; result.a = isNaN.a ? x.a : result.a; return result; `;function p(e){let t;let{inputs:r,backend:n}=e,{x:p}=r;if(n.shouldExecuteOnCPU([p])){let e=n.texData.get(p.dataId),[t,r]=(0,a.negImplCPU)(e.values,p.shape,p.dtype);return n.makeTensorInfo(r,p.dtype,t)}return t=(0,s.env)().getBool("WEBGL_PACK_UNARY_OPERATIONS")?new l.UnaryOpPackedProgram(p.shape,u):new o.UnaryOpProgram(p.shape,i),n.runWebGLProgram(t,[p],p.dtype)}let c={kernelName:s.Neg,backendName:"webgl",kernelFunc:p}},{"@tensorflow/tfjs-core":"2nuhV","../kernel_utils/shared":"01kMd","../unaryop_gpu":"iNthQ","../unaryop_packed_gpu":"k4CIw","@parcel/transformer-js/src/esmodule-helpers.js":"9pCYc"}],"43R25":[function(e,t,r){/** * @license * Copyright 2020 Google LLC. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. * ============================================================================= */var n=e("@parcel/transformer-js/src/esmodule-helpers.js");n.defineInteropFlag(r),n.export(r,"nonMaxSuppressionV3",()=>o),n.export(r,"nonMaxSuppressionV3Config",()=>l);var s=e("@tensorflow/tfjs-core");let a=s.kernel_impls.nonMaxSuppressionV3Impl;function o(e){(0,s.backend_util).warn("tf.nonMaxSuppression() in webgl locks the UI thread. Call tf.nonMaxSuppressionAsync() instead");let{inputs:t,backend:r,attrs:n}=e,{boxes:o,scores:l}=t,{maxOutputSize:i,iouThreshold:u,scoreThreshold:p}=n,{selectedIndices:c}=a(r.readSync(o.dataId),r.readSync(l.dataId),i,u,p);return r.makeTensorInfo([c.length],"int32",new Int32Array(c))}let l={kernelName:s.NonMaxSuppressionV3,backendName:"webgl",kernelFunc:o}},{"@tensorflow/tfjs-core":"2nuhV","@parcel/transformer-js/src/esmodule-helpers.js":"9pCYc"}],"8bdxe":[function(e,t,r){/** * @license * Copyright 2020 Google LLC. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. * ============================================================================= */var n=e("@parcel/transformer-js/src/esmodule-helpers.js");n.defineInteropFlag(r),n.export(r,"nonMaxSuppressionV4",()=>o),n.export(r,"nonMaxSuppressionV4Config",()=>l);var s=e("@tensorflow/tfjs-core");let a=s.kernel_impls.nonMaxSuppressionV4Impl;function o(e){(0,s.backend_util).warn("tf.nonMaxSuppression() in webgl locks the UI thread. Call tf.nonMaxSuppressionAsync() instead");let{inputs:t,backend:r,attrs:n}=e,{boxes:o,scores:l}=t,{maxOutputSize:i,iouThreshold:u,scoreThreshold:p,padToMaxOutputSize:c}=n,{selectedIndices:d,validOutputs:f}=a(r.readSync(o.dataId),r.readSync(l.dataId),i,u,p,c);return[r.makeTensorInfo([d.length],"int32",new Int32Array(d)),r.makeTensorInfo([],"int32",new Int32Array([f]))]}let l={kernelName:s.NonMaxSuppressionV4,backendName:"webgl",kernelFunc:o}},{"@tensorflow/tfjs-core":"2nuhV","@parcel/transformer-js/src/esmodule-helpers.js":"9pCYc"}],kHowT:[function(e,t,r){/** * @license * Copyright 2020 Google LLC. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. * ============================================================================= */var n=e("@parcel/transformer-js/src/esmodule-helpers.js");n.defineInteropFlag(r),n.export(r,"nonMaxSuppressionV5",()=>o),n.export(r,"nonMaxSuppressionV5Config",()=>l);var s=e("@tensorflow/tfjs-core");let a=s.kernel_impls.nonMaxSuppressionV5Impl;function o(e){(0,s.backend_util).warn("tf.nonMaxSuppression() in webgl locks the UI thread. Call tf.nonMaxSuppressionAsync() instead");let{inputs:t,backend:r,attrs:n}=e,{boxes:o,scores:l}=t,{maxOutputSize:i,iouThreshold:u,scoreThreshold:p,softNmsSigma:c}=n,{selectedIndices:d,selectedScores:f}=a(r.readSync(o.dataId),r.readSync(l.dataId),i,u,p,c);return[r.makeTensorInfo([d.length],"int32",new Int32Array(d)),r.makeTensorInfo([f.length],"float32",new Float32Array(f))]}let l={kernelName:s.NonMaxSuppressionV5,backendName:"webgl",kernelFunc:o}},{"@tensorflow/tfjs-core":"2nuhV","@parcel/transformer-js/src/esmodule-helpers.js":"9pCYc"}],"2QYeR":[function(e,t,r){/** * @license * Copyright 2020 Google LLC. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. * ============================================================================= */var n=e("@parcel/transformer-js/src/esmodule-helpers.js");n.defineInteropFlag(r),n.export(r,"oneHot",()=>l),n.export(r,"oneHotConfig",()=>i);var s=e("@tensorflow/tfjs-core"),a=e("../onehot_gpu"),o=e("./Reshape");let l=e=>{let{inputs:t,backend:r,attrs:n}=e,{indices:l}=t,{dtype:i,depth:u,onValue:p,offValue:c}=n,d=(0,s.util).sizeFromShape(l.shape),f=new a.OneHotProgram(d,u,p,c),h=(0,o.reshape)({inputs:{x:l},backend:r,attrs:{shape:[d]}}),m=r.runWebGLProgram(f,[h],i);r.disposeIntermediateTensorInfo(h);let g=[...l.shape,u],x=(0,o.reshape)({inputs:{x:m},backend:r,attrs:{shape:g}});return r.disposeIntermediateTensorInfo(m),x},i={kernelName:s.OneHot,backendName:"webgl",kernelFunc:l}},{"@tensorflow/tfjs-core":"2nuhV","../onehot_gpu":"eBZ6K","./Reshape":"cgfGf","@parcel/transformer-js/src/esmodule-helpers.js":"9pCYc"}],eBZ6K:[function(e,t,r){/** * @license * Copyright 2017 Google LLC. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. * ============================================================================= */var n=e("@parcel/transformer-js/src/esmodule-helpers.js");n.defineInteropFlag(r),n.export(r,"OneHotProgram",()=>s);class s{constructor(e,t,r,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(${r}), float(index == coords.y))); } `}}},{"@parcel/transformer-js/src/esmodule-helpers.js":"9pCYc"}],"8Rqgk":[function(e,t,r){/** * @license * Copyright 2020 Google LLC. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. * ============================================================================= */var n=e("@parcel/transformer-js/src/esmodule-helpers.js");n.defineInteropFlag(r),n.export(r,"onesLike",()=>p),n.export(r,"onesLikeConfig",()=>c);var s=e("@tensorflow/tfjs-core"),a=e("./Complex"),o=e("./Fill"),l=e("./Imag"),i=e("./Real"),u=e("./ZerosLike");function p(e){let{inputs:t,backend:r}=e,{x:n}=t;if("string"===n.dtype)throw Error("onesLike is not supported under string dtype");if("complex64"!==n.dtype)return(0,o.fill)({attrs:{shape:n.shape,dtype:n.dtype,value:1},backend:r});{let e=(0,i.real)({inputs:{input:n},backend:r}),t=p({inputs:{x:e},backend:r}),s=(0,l.imag)({inputs:{input:n},backend:r}),o=(0,u.zerosLike)({inputs:{x:s},backend:r}),c=(0,a.complex)({inputs:{real:t,imag:o},backend:r});return r.disposeIntermediateTensorInfo(e),r.disposeIntermediateTensorInfo(t),r.disposeIntermediateTensorInfo(s),r.disposeIntermediateTensorInfo(o),c}}let c={kernelName:s.OnesLike,backendName:"webgl",kernelFunc:p}},{"@tensorflow/tfjs-core":"2nuhV","./Complex":"3zOos","./Fill":"6vZGW","./Imag":"edc2Y","./Real":"4c1DV","./ZerosLike":"1gn2S","@parcel/transformer-js/src/esmodule-helpers.js":"9pCYc"}],"1gn2S":[function(e,t,r){/** * @license * Copyright 2020 Google LLC. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. * ============================================================================= */var n=e("@parcel/transformer-js/src/esmodule-helpers.js");n.defineInteropFlag(r),n.export(r,"zerosLike",()=>u),n.export(r,"zerosLikeConfig",()=>p);var s=e("@tensorflow/tfjs-core"),a=e("./Complex"),o=e("./Fill"),l=e("./Imag"),i=e("./Real");function u(e){let{inputs:t,backend:r}=e,{x:n}=t;if("complex64"!==n.dtype)return(0,o.fill)({attrs:{shape:n.shape,dtype:n.dtype,value:"string"===n.dtype?"":0},backend:r});{let e=(0,i.real)({inputs:{input:n},backend:r}),t=u({inputs:{x:e},backend:r}),s=(0,l.imag)({inputs:{input:n},backend:r}),o=u({inputs:{x:s},backend:r}),p=(0,a.complex)({inputs:{real:t,imag:o},backend:r});return r.disposeIntermediateTensorInfo(e),r.disposeIntermediateTensorInfo(t),r.disposeIntermediateTensorInfo(s),r.disposeIntermediateTensorInfo(o),p}}let p={kernelName:s.ZerosLike,backendName:"webgl",kernelFunc:u}},{"@tensorflow/tfjs-core":"2nuhV","./Complex":"3zOos","./Fill":"6vZGW","./Imag":"edc2Y","./Real":"4c1DV","@parcel/transformer-js/src/esmodule-helpers.js":"9pCYc"}],ihnbO:[function(e,t,r){/** * @license * Copyright 2020 Google LLC. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. * ============================================================================= */var n=e("@parcel/transformer-js/src/esmodule-helpers.js");n.defineInteropFlag(r),n.export(r,"pack",()=>l),n.export(r,"packConfig",()=>i);var s=e("@tensorflow/tfjs-core"),a=e("./Concat"),o=e("./ExpandDims");function l(e){let{inputs:t,backend:r,attrs:n}=e,{axis:l}=n;if(1===t.length)return(0,o.expandDims)({inputs:{input:t[0]},backend:r,attrs:{dim:l}});let i=t[0].shape,u=t[0].dtype;t.forEach(e=>{(0,s.util).assertShapesMatch(i,e.shape,"All tensors passed to stack must have matching shapes"),(0,s.util).assert(u===e.dtype,()=>"All tensors passed to stack must have matching dtypes")});let p=[],c=t.map(e=>{let t=(0,o.expandDims)({inputs:{input:e},backend:r,attrs:{dim:l}});return p.push(t),t}),d=(0,a.concat)({inputs:c,backend:r,attrs:{axis:l}});return p.forEach(e=>r.disposeIntermediateTensorInfo(e)),d}let i={kernelName:s.Pack,backendName:"webgl",kernelFunc:l}},{"@tensorflow/tfjs-core":"2nuhV","./Concat":"lOCXc","./ExpandDims":"6l4Rf","@parcel/transformer-js/src/esmodule-helpers.js":"9pCYc"}],"62aNS":[function(e,t,r){/** * @license * Copyright 2020 Google LLC. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. * ============================================================================= */var n=e("@parcel/transformer-js/src/esmodule-helpers.js");n.defineInteropFlag(r),n.export(r,"padV2",()=>i),n.export(r,"padV2Config",()=>u);var s=e("@tensorflow/tfjs-core"),a=e("../pad_gpu"),o=e("../pad_packed_gpu"),l=e("./Fill");let i=e=>{let{inputs:t,backend:r,attrs:n}=e,{x:i}=t,{paddings:u,constantValue:p}=n;if(0===(0,s.util).sizeFromShape(i.shape)){let e=u.map((e,t)=>e[0]+i.shape[t]+e[1]);return(0,l.fill)({backend:r,attrs:{shape:e,value:p,dtype:i.dtype}})}let c=(0,s.env)().getBool("WEBGL_PACK_ARRAY_OPERATIONS")?new o.PadPackedProgram(i.shape,u,p):new a.PadProgram(i.shape,u,p),d=[[p]];return r.runWebGLProgram(c,[i],i.dtype,d)},u={kernelName:s.PadV2,backendName:"webgl",kernelFunc:i}},{"@tensorflow/tfjs-core":"2nuhV","../pad_gpu":"lDmmW","../pad_packed_gpu":"1pVsj","./Fill":"6vZGW","@parcel/transformer-js/src/esmodule-helpers.js":"9pCYc"}],lDmmW:[function(e,t,r){/** * @license * Copyright 2017 Google LLC. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. * ============================================================================= */var n=e("@parcel/transformer-js/src/esmodule-helpers.js");n.defineInteropFlag(r),n.export(r,"PadProgram",()=>a);var s=e("./shader_compiler");class a{constructor(e,t,r){this.variableNames=["x"],this.customUniforms=[{name:"value",type:"float"}],this.outputShape=t.map((t,r)=>t[0]+e[r]+t[1]);let n=e.length,a=(0,s.getCoordsDataType)(n),o=t.map(e=>e[0]).join(","),l=t.map((t,r)=>t[0]+e[r]).join(","),i=["coords[0]","coords[1]","coords[2]","coords[3]"].slice(0,n);if(1===n){this.userCode=` int start = ${o}; int end = ${l}; void main() { int outC = getOutputCoords(); if (outC< start || outC >= end) { setOutput(value); } else { setOutput(getX(outC - start)); } } `;return}this.userCode=` ${a} start = ${a}(${o}); ${a} end = ${a}(${l}); void main() { ${a} outC = getOutputCoords(); if (any(lessThan(outC, start)) || any(greaterThanEqual(outC, end))) { setOutput(value); } else { ${a} coords = outC - start; setOutput(getX(${i})); } } `}}},{"./shader_compiler":"3kYYB","@parcel/transformer-js/src/esmodule-helpers.js":"9pCYc"}],"1pVsj":[function(e,t,r){/** * @license * Copyright 2019 Google LLC. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. * ============================================================================= */var n=e("@parcel/transformer-js/src/esmodule-helpers.js");n.defineInteropFlag(r),n.export(r,"PadPackedProgram",()=>o);var s=e("./packing_util"),a=e("./shader_compiler");class o{constructor(e,t,r){this.variableNames=["x"],this.packedInputs=!0,this.packedOutput=!0,this.customUniforms=[{name:"value",type:"float"}],this.outputShape=t.map((t,r)=>t[0]+e[r]+t[1]);let n=e.length,o=(0,a.getCoordsDataType)(n),l=t.map(e=>e[0]).join(","),i=t.map((t,r)=>t[0]+e[r]).join(","),u=(0,s.getChannels)("rc",n),p=(0,s.getChannels)("source",n),c=`${u[n-1]}< ${this.outputShape[n-1]}`,d=1===n?"source":`vec2(${p.slice(-2).join()})`,f=[`${o} rc = outputLoc;`,`${u[n-1]} += 1; if(${c}) { `,1===n?"":`} rc = outputLoc; ${u[n-2]} += 1; if(${u[n-2]} < ${this.outputShape[n-2]}) {`,1===n?"":` ${u[n-1]} += 1; if(${c}) {`],h=1===n?"rc < start || rc >= end":"any(lessThan(rc, start)) || any(greaterThanEqual(rc, end))",m="";for(let e=0,t=1===n?2:4;eu),n.export(r,"powConfig",()=>p);var s=e("@tensorflow/tfjs-core"),a=e("../binaryop_packed_gpu"),o=e("../kernel_utils/kernel_funcs_utils");let l=` if(a< 0.0 && floor(b) < b){ return NAN; } if (b == 0.0) { return 1.0; } return (round(mod(b, 2.0)) != 1) ? pow(abs(a), b) : sign(a) * pow(abs(a), b); `,i=` // 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); vec4 result = multiplier * pow(abs(a), b); // Ensure that a^0 = 1, including 0^0 = 1 as this correspond to TF and JS bvec4 isExpZero = equal(b, vec4(0.0)); result.r = isExpZero.r ? 1.0 : result.r; result.g = isExpZero.g ? 1.0 : result.g; result.b = isExpZero.b ? 1.0 : result.b; result.a = isExpZero.a ? 1.0 : result.a; 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); `+a.CHECK_NAN_SNIPPET_PACKED+` return result; `,u=(0,o.binaryKernelFunc)({opSnippet:l,packedOpSnippet:i}),p={kernelName:s.Pow,backendName:"webgl",kernelFunc:u}},{"@tensorflow/tfjs-core":"2nuhV","../binaryop_packed_gpu":"f1UiT","../kernel_utils/kernel_funcs_utils":"jMepo","@parcel/transformer-js/src/esmodule-helpers.js":"9pCYc"}],"13NdY":[function(e,t,r){/** * @license * Copyright 2020 Google LLC. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. * ============================================================================= */var n=e("@parcel/transformer-js/src/esmodule-helpers.js");n.defineInteropFlag(r),n.export(r,"prod",()=>u),n.export(r,"prodConfig",()=>p);var s=e("@tensorflow/tfjs-core"),a=e("../kernel_utils/reduce"),o=e("../kernel_utils/shared"),l=e("./Reshape"),i=e("./Transpose");function u(e){let t;let{inputs:r,backend:n,attrs:u}=e,{x:p}=r,{axis:c,keepDims:d}=u,f=p.shape.length,h=[],m=(0,s.util).parseAxisParam(c,p.shape),g=m,x=(0,s.backend_util).getAxesPermutation(g,f),v=p;if(null!=x&&(v=(0,i.transpose)({inputs:{x:p},backend:n,attrs:{perm:x}}),g=(0,s.backend_util).getInnerMostAxes(g.length,f),h.push(v)),(0,s.backend_util).assertAxesAreInnerMostDims("prod",g,f),n.shouldExecuteOnCPU([v])){let e=n.texData.get(v.dataId).values,{outVals:r,outShape:s,outDtype:a}=(0,o.prodImplCPU)(v.shape,v.dtype,e,g);t=n.makeTensorInfo(s,a,r)}else{let[e,r]=(0,s.backend_util).computeOutAndReduceShapes(v.shape,g),o=(0,s.util).sizeFromShape(r),i=(0,l.reshape)({inputs:{x:v},backend:n,attrs:{shape:[-1,o]}}),u=(0,s.sumOutType)(p.dtype),c=(0,a.reduce)(i,u,"prod",n);t=(0,l.reshape)({inputs:{x:c},backend:n,attrs:{shape:e}}),h.push(i),h.push(c)}if(d){h.push(t);let e=(0,s.backend_util).expandShapeToKeepDim(t.shape,m);t=(0,l.reshape)({inputs:{x:t},backend:n,attrs:{shape:e}})}return h.forEach(e=>n.disposeIntermediateTensorInfo(e)),t}let p={kernelName:s.Prod,backendName:"webgl",kernelFunc:u}},{"@tensorflow/tfjs-core":"2nuhV","../kernel_utils/reduce":"dRjVh","../kernel_utils/shared":"01kMd","./Reshape":"cgfGf","./Transpose":"jIlsI","@parcel/transformer-js/src/esmodule-helpers.js":"9pCYc"}],"4h7q8":[function(e,t,r){/** * @license * Copyright 2022 Google LLC. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. * ============================================================================= */var n=e("@parcel/transformer-js/src/esmodule-helpers.js");n.defineInteropFlag(r),n.export(r,"raggedGather",()=>o),n.export(r,"raggedGatherConfig",()=>l);var s=e("@tensorflow/tfjs-core"),a=e("../kernel_utils/shared");function o(e){let{inputs:t,backend:r,attrs:n}=e,{paramsNestedSplits:s,paramsDenseValues:o,indices:l}=t,{outputRaggedRank:i}=n,u=s.map(e=>r.readSync(e.dataId)),p=s.map(e=>e.shape),c=r.readSync(o.dataId),d=r.readSync(l.dataId),[f,h,m]=(0,a.raggedGatherImplCPU)(u,p,c,o.shape,o.dtype,d,l.shape,i),g=f.map(e=>r.makeTensorInfo([e.length],"int32",e)),x=r.makeTensorInfo(m,o.dtype,h);return g.concat([x])}let l={kernelName:s.RaggedGather,backendName:"webgl",kernelFunc:o}},{"@tensorflow/tfjs-core":"2nuhV","../kernel_utils/shared":"01kMd","@parcel/transformer-js/src/esmodule-helpers.js":"9pCYc"}],"6SKe9":[function(e,t,r){/** * @license * Copyright 2022 Google LLC. * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. * ============================================================================= */var n=e("@parcel/transformer-js/src/esmodule-helpers.js");n.defineInteropFlag(r),n.export(r,"raggedRange",()=>o),n.export(r,"raggedRangeConfig",()=>l);var s=e("@tensorflow/tfjs-core"),a=e("../kernel_utils/shared");function o(e){let{inputs:t,backend:r}=e,{starts:n,limits:s,deltas:o}=t,l=r.readSync(n.dataId),i=r.readSync(s.dataId),u=r.readSync(o.dataId),[p,c]=(0,a.raggedRangeImplCPU)(l,n.shape,n.dtype,i,s.shape,u,o.shape);return[r.makeTensorInfo([p.length],"int32",p),r.makeTensorInfo([c.length],n.dtype,c)]}let l={kernelName:s.RaggedRange,backendName:"webgl",kernelFunc:o}},{"@tensorflow/tfjs-core":"2nuhV","../kernel_utils/shared":"01kMd","@parcel/transformer-js/src/esmodule-helpers.js":"9pCYc"}],fANTV:[function(e,t,r){/** * @license * Copyright 2022 Google LLC. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. * ============================================================================= */var n=e("@parcel/transformer-js/src/esmodule-helpers.js");n.defineInteropFlag(r),n.export(r,"raggedTensorToTensor",()=>o),n.export(r,"raggedTensorToTensorConfig",()=>l);var s=e("@tensorflow/tfjs-core"),a=e("../kernel_utils/shared");function o(e){let{inputs:t,backend:r,attrs:n}=e,{shape:s,values:o,defaultValue:l,rowPartitionTensors:i}=t,{rowPartitionTypes:u}=n,p=r.readSync(s.dataId),c=r.readSync(o.dataId),d=r.readSync(l.dataId),f=i.map(e=>r.readSync(e.dataId)),h=i.map(e=>e.shape),[m,g]=(0,a.raggedTensorToTensorImplCPU)(p,s.shape,c,o.shape,o.dtype,d,l.shape,f,h,u);return r.makeTensorInfo(m,o.dtype,g)}let l={kernelName:s.RaggedTensorToTensor,backendName:"webgl",kernelFunc:o}},{"@tensorflow/tfjs-core":"2nuhV","../kernel_utils/shared":"01kMd","@parcel/transformer-js/src/esmodule-helpers.js":"9pCYc"}],"5XFt9":[function(e,t,r){/** * @license * Copyright 2020 Google LLC. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. * ============================================================================= */var n=e("@parcel/transformer-js/src/esmodule-helpers.js");n.defineInteropFlag(r),n.export(r,"range",()=>o),n.export(r,"rangeConfig",()=>l);var s=e("@tensorflow/tfjs-core"),a=e("../kernel_utils/shared");let o=e=>{let{backend:t,attrs:r}=e,{start:n,stop:s,step:o,dtype:l}=r,i=(0,a.rangeImplCPU)(n,s,o,l);return t.makeTensorInfo([i.length],l,i)},l={kernelName:s.Range,backendName:"webgl",kernelFunc:o}},{"@tensorflow/tfjs-core":"2nuhV","../kernel_utils/shared":"01kMd","@parcel/transformer-js/src/esmodule-helpers.js":"9pCYc"}],"7ozTa":[function(e,t,r){/** * @license * Copyright 2020 Google LLC. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. * ============================================================================= */var n=e("@parcel/transformer-js/src/esmodule-helpers.js");n.defineInteropFlag(r),n.export(r,"reciprocal",()=>a),n.export(r,"reciprocalConfig",()=>o);var s=e("@tensorflow/tfjs-core");let a=(0,e("../kernel_utils/kernel_funcs_utils").unaryKernelFunc)({opSnippet:"return 1.0 / x;"}),o={kernelName:s.Reciprocal,backendName:"webgl",kernelFunc:a}},{"@tensorflow/tfjs-core":"2nuhV","../kernel_utils/kernel_funcs_utils":"jMepo","@parcel/transformer-js/src/esmodule-helpers.js":"9pCYc"}],"2q4nb":[function(e,t,r){/** * @license * Copyright 2020 Google LLC. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. * ============================================================================= */var n=e("@parcel/transformer-js/src/esmodule-helpers.js");n.defineInteropFlag(r),n.export(r,"relu",()=>i),n.export(r,"reluConfig",()=>u);var s=e("@tensorflow/tfjs-core"),a=e("../kernel_utils/kernel_funcs_utils");let o=e("../unaryop_gpu").CHECK_NAN_SNIPPET+` return (x< 0.0) ? 0.0 : x; `,l=` vec4 result = x * vec4(greaterThanEqual(x, vec4(0.0))); bvec4 isNaN = isnan(x); result.r = isNaN.r ? x.r : result.r; result.g = isNaN.g ? x.g : result.g; result.b = isNaN.b ? x.b : result.b; result.a = isNaN.a ? x.a : result.a; return result; `,i=(0,a.unaryKernelFunc)({opSnippet:o,packedOpSnippet:l}),u={kernelName:s.Relu,backendName:"webgl",kernelFunc:i}},{"@tensorflow/tfjs-core":"2nuhV","../kernel_utils/kernel_funcs_utils":"jMepo","../unaryop_gpu":"iNthQ","@parcel/transformer-js/src/esmodule-helpers.js":"9pCYc"}],eDa64:[function(e,t,r){/** * @license * Copyright 2020 Google LLC. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. * ============================================================================= */var n=e("@parcel/transformer-js/src/esmodule-helpers.js");n.defineInteropFlag(r),n.export(r,"relu6",()=>i),n.export(r,"relu6Config",()=>u);var s=e("@tensorflow/tfjs-core"),a=e("../kernel_utils/kernel_funcs_utils");let o=e("../unaryop_gpu").CHECK_NAN_SNIPPET+` return (x< 0.0) ? 0.0 : min(6.0, x); `,l=` vec4 result = min(x, vec4(6.)) * vec4(greaterThanEqual(x, vec4(0.0))); bvec4 isNaN = isnan(x); result.r = isNaN.r ? x.r : result.r; result.g = isNaN.g ? x.g : result.g; result.b = isNaN.b ? x.b : result.b; result.a = isNaN.a ? x.a : result.a; return result; `,i=(0,a.unaryKernelFunc)({opSnippet:o,packedOpSnippet:l}),u={kernelName:s.Relu6,backendName:"webgl",kernelFunc:i}},{"@tensorflow/tfjs-core":"2nuhV","../kernel_utils/kernel_funcs_utils":"jMepo","../unaryop_gpu":"iNthQ","@parcel/transformer-js/src/esmodule-helpers.js":"9pCYc"}],"4cHF7":[function(e,t,r){/** * @license * Copyright 2020 Google LLC. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. * ============================================================================= */var n=e("@parcel/transformer-js/src/esmodule-helpers.js");n.defineInteropFlag(r),n.export(r,"resizeBilinear",()=>l),n.export(r,"resizeBilinearConfig",()=>i);var s=e("@tensorflow/tfjs-core"),a=e("../resize_bilinear_gpu"),o=e("../resize_bilinear_packed_gpu");function l(e){let{inputs:t,backend:r,attrs:n}=e,{images:l}=t,{alignCorners:i,halfPixelCenters:u,size:p}=n,[c,d]=p,f=(0,s.env)().getBool("WEBGL_PACK_IMAGE_OPERATIONS")?new o.ResizeBilinearPackedProgram(l.shape,c,d,i,u):new a.ResizeBilinearProgram(l.shape,c,d,i,u);return r.runWebGLProgram(f,[l],"float32")}let i={kernelName:s.ResizeBilinear,backendName:"webgl",kernelFunc:l}},{"@tensorflow/tfjs-core":"2nuhV","../resize_bilinear_gpu":"2i3hc","../resize_bilinear_packed_gpu":"gOYpw","@parcel/transformer-js/src/esmodule-helpers.js":"9pCYc"}],"2i3hc":[function(e,t,r){/** * @license * Copyright 2017 Google LLC. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. * ============================================================================= */var n=e("@parcel/transformer-js/src/esmodule-helpers.js");n.defineInteropFlag(r),n.export(r,"ResizeBilinearProgram",()=>s);class s{constructor(e,t,r,n,s){let a;this.variableNames=["A"],this.outputShape=[];let[o,l,i,u]=e;this.outputShape=[o,t,r,u];let p=[n&&t>1?l-1:l,n&&r>1?i-1:i],c=[n&&t>1?t-1:t,n&&r>1?r-1:r];a=s?"(vec2(yRC) + vec2(0.5)) * effectiveInputOverOutputRatioRC - vec2(0.5)":"vec2(yRC) * effectiveInputOverOutputRatioRC",this.userCode=` const vec2 effectiveInputOverOutputRatioRC = vec2( ${p[0]/c[0]}, ${p[1]/c[1]}); const vec2 inputShapeRC = vec2(${l}.0, ${i}.0); void main() { ivec4 coords = getOutputCoords(); int b = coords[0]; int d = coords[3]; ivec2 yRC = coords.yz; // Fractional source index. vec2 sourceFracIndexRC = ${a}; // Compute the four integer indices. ivec2 sourceFloorRC = ivec2(max(sourceFracIndexRC, vec2(0.0))); ivec2 sourceCeilRC = ivec2( min(inputShapeRC - 1.0, ceil(sourceFracIndexRC))); float topLeft = getA(b, sourceFloorRC.x, sourceFloorRC.y, d); float bottomLeft = getA(b, sourceCeilRC.x, sourceFloorRC.y, d); float topRight = getA(b, sourceFloorRC.x, sourceCeilRC.y, d); float bottomRight = getA(b, sourceCeilRC.x, sourceCeilRC.y, d); vec2 fracRC = sourceFracIndexRC - vec2(sourceFloorRC); float top = topLeft + (topRight - topLeft) * fracRC.y; float bottom = bottomLeft + (bottomRight - bottomLeft) * fracRC.y; float newValue = top + (bottom - top) * fracRC.x; setOutput(newValue); } `}}},{"@parcel/transformer-js/src/esmodule-helpers.js":"9pCYc"}],gOYpw:[function(e,t,r){/** * @license * Copyright 2019 Google LLC. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. * ============================================================================= */var n=e("@parcel/transformer-js/src/esmodule-helpers.js");n.defineInteropFlag(r),n.export(r,"ResizeBilinearPackedProgram",()=>s);class s{constructor(e,t,r,n,s){let a;this.variableNames=["A"],this.packedInputs=!0,this.packedOutput=!0,this.outputShape=[];let[o,l,i,u]=e;this.outputShape=[o,t,r,u];let p=[n&&t>1?l-1:l,n&&r>1?i-1:i],c=[n&&t>1?t-1:t,n&&r>1?r-1:r];a=s?"(vec3(yRC) + vec3(0.5)) * effectiveInputOverOutputRatioRC - vec3(0.5)":"vec3(yRC) * effectiveInputOverOutputRatioRC",this.userCode=` const vec3 effectiveInputOverOutputRatioRC = vec3( ${p[0]/c[0]}, ${p[1]/c[1]}, ${p[1]/c[1]}); const vec3 inputShapeRC = vec3(${l}.0, ${i}.0, ${i}.0); float getAValue(int b, int r, int c, int d) { return getChannel(getA(b, r, c, d), vec2(c, d)); } void main() { ivec4 coords = getOutputCoords(); int b = coords[0]; int d = coords[3]; // Calculate values for next column in yRC.z. ivec3 yRC = coords.yzz + ivec3(0, 0, 1); // Fractional source index. vec3 sourceFracIndexRC = ${a}; // Compute the four integer indices. ivec3 sourceFloorRC = ivec3(max(sourceFracIndexRC, vec3(0.0))); ivec3 sourceCeilRC = ivec3( min(inputShapeRC - 1.0, ceil(sourceFracIndexRC))); // Should we calculate next column and row elements in 2x2 packed cell. bool hasNextCol = d< ${u-1}; bool hasNextRow = coords.z < ${r-1}; // In parallel, construct four corners for all four components in // packed 2x2 cell. vec4 topLeft = vec4( getAValue(b, sourceFloorRC.x, sourceFloorRC.y, d), hasNextCol ? getAValue(b, sourceFloorRC.x, sourceFloorRC.y, d + 1) : 0.0, hasNextRow ? getAValue(b, sourceFloorRC.x, sourceFloorRC.z, d) : 0.0, (hasNextRow && hasNextCol) ? getAValue(b, sourceFloorRC.x, sourceFloorRC.z, d + 1) : 0.0); vec4 bottomLeft = vec4( getAValue(b, sourceCeilRC.x, sourceFloorRC.y, d), hasNextCol ? getAValue(b, sourceCeilRC.x, sourceFloorRC.y, d + 1) : 0.0, hasNextRow ? getAValue(b, sourceCeilRC.x, sourceFloorRC.z, d) : 0.0, (hasNextRow && hasNextCol) ? getAValue(b, sourceCeilRC.x, sourceFloorRC.z, d + 1) : 0.0); vec4 topRight = vec4( getAValue(b, sourceFloorRC.x, sourceCeilRC.y, d), hasNextCol ? getAValue(b, sourceFloorRC.x, sourceCeilRC.y, d + 1) : 0.0, hasNextRow ? getAValue(b, sourceFloorRC.x, sourceCeilRC.z, d) : 0.0, (hasNextRow && hasNextCol) ? getAValue(b, sourceFloorRC.x, sourceCeilRC.z, d + 1) : 0.0); vec4 bottomRight = vec4( getAValue(b, sourceCeilRC.x, sourceCeilRC.y, d), hasNextCol ? getAValue(b, sourceCeilRC.x, sourceCeilRC.y, d + 1) : 0.0, hasNextRow ? getAValue(b, sourceCeilRC.x, sourceCeilRC.z, d) : 0.0, (hasNextRow && hasNextCol) ? getAValue(b, sourceCeilRC.x, sourceCeilRC.z, d + 1) : 0.0); vec3 fracRC = sourceFracIndexRC - vec3(sourceFloorRC); vec4 top = mix(topLeft, topRight, fracRC.yyzz); vec4 bottom = mix(bottomLeft, bottomRight, fracRC.yyzz); vec4 newValue = mix(top, bottom, fracRC.x); setOutput(newValue); } `}}},{"@parcel/transformer-js/src/esmodule-helpers.js":"9pCYc"}],fblDK:[function(e,t,r){/** * @license * Copyright 2020 Google LLC. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. * ============================================================================= */var n=e("@parcel/transformer-js/src/esmodule-helpers.js");n.defineInteropFlag(r),n.export(r,"resizeBilinearGrad",()=>o),n.export(r,"resizeBilinearGradConfig",()=>l);var s=e("@tensorflow/tfjs-core"),a=e("../resize_bilinear_backprop_gpu");function o(e){let{inputs:t,backend:r,attrs:n}=e,{images:s,dy:o}=t,{alignCorners:l}=n,i=new a.ResizeBilinearBackpropProgram(o.shape,s.shape,l);return r.runWebGLProgram(i,[o],o.dtype)}let l={kernelName:s.ResizeBilinearGrad,backendName:"webgl",kernelFunc:o}},{"@tensorflow/tfjs-core":"2nuhV","../resize_bilinear_backprop_gpu":"evR2Y","@parcel/transformer-js/src/esmodule-helpers.js":"9pCYc"}],evR2Y:[function(e,t,r){/** * @license * Copyright 2018 Google LLC. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. * ============================================================================= */var n=e("@parcel/transformer-js/src/esmodule-helpers.js");n.defineInteropFlag(r),n.export(r,"ResizeBilinearBackpropProgram",()=>s);class s{constructor(e,t,r){this.variableNames=["dy"],this.outputShape=[],this.outputShape=t;let[,n,s]=t,[,a,o]=e,l=[r&&a>1?n-1:n,r&&o>1?s-1:s],i=[r&&a>1?a-1:a,r&&o>1?o-1:o],u=l[0]/i[0],p=l[1]/i[1],c=1/u,d=1/p,f=2*Math.ceil(c)+2,h=2*Math.ceil(d)+2;this.userCode=` void main() { ivec4 coords = getOutputCoords(); int b = coords[0]; int d = coords[3]; int r = coords[1]; int c = coords[2]; float accumulator = 0.0; const float heightScale = float(${u}); const float widthScale = float(${p}); const float invHeightScale = float(${c}); const float invWidthScale = float(${d}); const int winHeight = int(${f}); const int winWidth = int(${h}); // Compute bounds for where in dy we will look float startRLerp = floor(float(r) * invHeightScale); int startDyR = int(startRLerp - float(winHeight / 2)); float startCLerp = floor(float(c) * invWidthScale); int startDyC = int(startCLerp - float(winWidth / 2)); // Loop over dy for (int dyROffset = 0; dyROffset< winHeight; dyROffset++) { int dyR = dyROffset + startDyR; // Guard against the window exceeding the bounds of dy if (dyR < 0 || dyR >= ${a}) { continue; } for (int dyCOffset = 0; dyCOffset< winWidth; dyCOffset++) { int dyC = dyCOffset + startDyC; // Guard against the window exceeding the bounds of dy if (dyC < 0 || dyC >= ${o}) { continue; } float dxR = float(dyR) * heightScale; int topDxRIndex = int(floor(dxR)); int bottomDxRIndex = int(min(ceil(dxR), ${n-1}.0)); float dxRLerp = dxR - float(topDxRIndex); float inverseDxRLerp = 1.0 - dxRLerp; float dxC = float(dyC) * widthScale; int leftDxCIndex = int(floor(dxC)); int rightDxCIndex = int(min(ceil(dxC), ${s-1}.0)); float dxCLerp = dxC - float(leftDxCIndex); float inverseDxCLerp = 1.0 - dxCLerp; if (r == topDxRIndex && c == leftDxCIndex) { // topLeft accumulator += getDy(b, dyR, dyC, d) * inverseDxRLerp * inverseDxCLerp; } if (r == topDxRIndex && c == rightDxCIndex) { // topRight accumulator += getDy(b, dyR, dyC, d) * inverseDxRLerp * dxCLerp; } if (r == bottomDxRIndex && c == leftDxCIndex) { // bottomLeft accumulator += getDy(b, dyR, dyC, d) * dxRLerp * inverseDxCLerp; } if (r == bottomDxRIndex && c == rightDxCIndex) { // bottomRight accumulator += getDy(b, dyR, dyC, d) * dxRLerp * dxCLerp; } } } // End loop over dy setOutput(accumulator); } `}}},{"@parcel/transformer-js/src/esmodule-helpers.js":"9pCYc"}],Qj1lv:[function(e,t,r){/** * @license * Copyright 2020 Google LLC. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. * ============================================================================= */var n=e("@parcel/transformer-js/src/esmodule-helpers.js");n.defineInteropFlag(r),n.export(r,"resizeNearestNeighbor",()=>l),n.export(r,"resizeNearestNeighborConfig",()=>i);var s=e("@tensorflow/tfjs-core"),a=e("../resize_nearest_neighbor_gpu"),o=e("../resize_nearest_neighbor_packed_gpu");function l(e){let{inputs:t,backend:r,attrs:n}=e,{images:l}=t,{alignCorners:i,halfPixelCenters:u,size:p}=n,[c,d]=p,f=(0,s.env)().getBool("WEBGL_PACK_IMAGE_OPERATIONS")?new o.ResizeNearestNeighborPackedProgram(l.shape,c,d,i,u):new a.ResizeNearestNeighborProgram(l.shape,c,d,i,u);return r.runWebGLProgram(f,[l],l.dtype)}let i={kernelName:s.ResizeNearestNeighbor,backendName:"webgl",kernelFunc:l}},{"@tensorflow/tfjs-core":"2nuhV","../resize_nearest_neighbor_gpu":"3QVg6","../resize_nearest_neighbor_packed_gpu":"5RY8Y","@parcel/transformer-js/src/esmodule-helpers.js":"9pCYc"}],"3QVg6":[function(e,t,r){/** * @license * Copyright 2018 Google LLC. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. * ============================================================================= */var n=e("@parcel/transformer-js/src/esmodule-helpers.js");n.defineInteropFlag(r),n.export(r,"ResizeNearestNeighborProgram",()=>s);class s{constructor(e,t,r,n,s){let a;this.variableNames=["A"],this.outputShape=[];let[o,l,i,u]=e;this.outputShape=[o,t,r,u];let p=[n&&t>1?l-1:l,n&&r>1?i-1:i],c=[n&&t>1?t-1:t,n&&r>1?r-1:r];a=s?"max((vec2(yRC) + vec2(0.5)) * effectiveInputOverOutputRatioRC, vec2(0.0))":"vec2(yRC) * effectiveInputOverOutputRatioRC",this.userCode=` const vec2 effectiveInputOverOutputRatioRC = vec2( ${p[0]/c[0]}, ${p[1]/c[1]}); const vec2 inputShapeRC = vec2(${l}.0, ${i}.0); void main() { ivec4 coords = getOutputCoords(); int b = coords[0]; int d = coords[3]; ivec2 yRC = coords.yz; // Fractional source index. vec2 sourceFracIndexRC = ${a}; // Compute the coordinators of nearest neighbor point. ivec2 sourceNearestRC = ivec2( min(inputShapeRC - 1.0, floor(sourceFracIndexRC + ${n?"0.5":"0.0"}))); float newValue = getA(b, sourceNearestRC.x, sourceNearestRC.y, d); setOutput(newValue); } `}}},{"@parcel/transformer-js/src/esmodule-helpers.js":"9pCYc"}],"5RY8Y":[function(e,t,r){/** * @license * Copyright 2019 Google LLC. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. * ============================================================================= */var n=e("@parcel/transformer-js/src/esmodule-helpers.js");n.defineInteropFlag(r),n.export(r,"ResizeNearestNeighborPackedProgram",()=>s);class s{constructor(e,t,r,n,s){let a;this.variableNames=["A"],this.packedInputs=!0,this.packedOutput=!0,this.outputShape=[];let[o,l,i,u]=e;this.outputShape=[o,t,r,u];let p=[n&&t>1?l-1:l,n&&r>1?i-1:i],c=[n&&t>1?t-1:t,n&&r>1?r-1:r];a=s?"max((vec3(yRC) + vec3(0.5)) * effectiveInputOverOutputRatioRC, vec3(0.0))":"vec3(yRC) * effectiveInputOverOutputRatioRC",this.userCode=` const vec3 effectiveInputOverOutputRatioRC = vec3( ${p[0]/c[0]}, ${p[1]/c[1]}, ${p[1]/c[1]}); const vec3 inputShapeRC = vec3(${l}.0, ${i}.0, ${i}.0); float getAValue(int b, int r, int c, int d) { return getChannel(getA(b, r, c, d), vec2(c, d)); } void main() { ivec4 coords = getOutputCoords(); int b = coords[0]; int d = coords[3]; // Calculate values for next column in yRC.z. ivec3 yRC = coords.yzz + ivec3(0, 0, 1); // Fractional source index. vec3 sourceFracIndexRC = ${a}; // Compute the coordinators of nearest neighbor point. ivec3 sourceNearestRC = ivec3( min(inputShapeRC - 1.0, floor(sourceFracIndexRC + ${n?"0.5":"0.0"}))); // Should we calculate next column and row elements in 2x2 packed cell. bool hasNextCol = d< ${u-1}; bool hasNextRow = coords.z < ${r-1}; vec4 newValue = vec4( getAValue(b, sourceNearestRC.x, sourceNearestRC.y, d), hasNextCol ? getAValue(b, sourceNearestRC.x, sourceNearestRC.y, d + 1) : 0.0, hasNextRow ? getAValue(b, sourceNearestRC.x, sourceNearestRC.z, d) : 0.0, (hasNextRow && hasNextCol) ? getAValue(b, sourceNearestRC.x, sourceNearestRC.z, d + 1) : 0.0); setOutput(newValue); } `}}},{"@parcel/transformer-js/src/esmodule-helpers.js":"9pCYc"}],"46F3t":[function(e,t,r){/** * @license * Copyright 2020 Google LLC. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. * ============================================================================= */var n=e("@parcel/transformer-js/src/esmodule-helpers.js");n.defineInteropFlag(r),n.export(r,"resizeNearestNeighborGrad",()=>o),n.export(r,"resizeNearestNeighborGradConfig",()=>l);var s=e("@tensorflow/tfjs-core"),a=e("../resize_nearest_neighbor_backprop_gpu");function o(e){let{inputs:t,backend:r,attrs:n}=e,{images:s,dy:o}=t,{alignCorners:l}=n,i=new a.ResizeNearestNeigborBackpropProgram(o.shape,s.shape,l);return r.runWebGLProgram(i,[o],o.dtype)}let l={kernelName:s.ResizeNearestNeighborGrad,backendName:"webgl",kernelFunc:o}},{"@tensorflow/tfjs-core":"2nuhV","../resize_nearest_neighbor_backprop_gpu":"ldOr3","@parcel/transformer-js/src/esmodule-helpers.js":"9pCYc"}],ldOr3:[function(e,t,r){/** * @license * Copyright 2018 Google LLC. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. * ============================================================================= */var n=e("@parcel/transformer-js/src/esmodule-helpers.js");n.defineInteropFlag(r),n.export(r,"ResizeNearestNeigborBackpropProgram",()=>s);class s{constructor(e,t,r){this.variableNames=["dy"],this.outputShape=[],this.outputShape=t;let[,n,s]=t,[,a,o]=e,l=[r&&a>1?n-1:n,r&&o>1?s-1:s],i=[r&&a>1?a-1:a,r&&o>1?o-1:o],u=l[0]/i[0],p=l[1]/i[1],c=1/u,d=1/p,f=2*Math.ceil(c)+2,h=2*Math.ceil(d)+2;this.userCode=` void main() { ivec4 coords = getOutputCoords(); int b = coords[0]; int d = coords[3]; int r = coords[1]; int c = coords[2]; float accumulator = 0.0; const float heightScale = float(${u}); const float widthScale = float(${p}); const float invHeightScale = float(${c}); const float invWidthScale = float(${d}); const int winHeight = int(${f}); const int winWidth = int(${h}); // Compute bounds for where in dy we will look float startRLerp = floor(float(r) * invHeightScale); int startDyR = int(floor(startRLerp - float(winHeight / 2))); float startCLerp = floor(float(c) * invWidthScale); int startDyC = int(floor(startCLerp - float(winWidth / 2))); // Loop over dy for (int dyROffset = 0; dyROffset< winHeight; dyROffset++) { int dyR = dyROffset + startDyR; // Guard against the window exceeding the bounds of dy if (dyR < 0 || dyR >= ${a}) { continue; } for (int dyCOffset = 0; dyCOffset< winWidth; dyCOffset++) { int dyC = dyCOffset + startDyC; // Guard against the window exceeding the bounds of dy if (dyC < 0 || dyC >= ${o}) { continue; } float sourceFracRow = float(${l[0]}) * (float(dyR) / float(${i[0]})); float sourceFracCol = float(${l[1]}) * (float(dyC) / float(${i[1]})); int sourceNearestRow = int(min( float(int(${n}) - 1), ${r} ? float(round(sourceFracRow)) : float(floor(sourceFracRow)))); int sourceNearestCol = int(min( float(int(${s}) - 1), ${r} ? float(round(sourceFracCol)) : float(floor(sourceFracCol)))); if (r == sourceNearestRow && c == sourceNearestCol) { accumulator += getDy(b, dyR, dyC, d); } } } // End loop over dy setOutput(accumulator); } `}}},{"@parcel/transformer-js/src/esmodule-helpers.js":"9pCYc"}],huEsM:[function(e,t,r){/** * @license * Copyright 2020 Google LLC. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. * ============================================================================= */var n=e("@parcel/transformer-js/src/esmodule-helpers.js");n.defineInteropFlag(r),n.export(r,"reverse",()=>i),n.export(r,"reverseConfig",()=>u);var s=e("@tensorflow/tfjs-core"),a=e("../reverse_gpu"),o=e("../reverse_packed_gpu"),l=e("./Identity");function i(e){let{inputs:t,backend:r,attrs:n}=e,{x:i}=t,{dims:u}=n,p=i.shape.length,c=(0,s.util).parseAxisParam(u,i.shape);if(0===p)return(0,l.identity)({inputs:{x:i},backend:r});let d=(0,s.env)().getBool("WEBGL_PACK_ARRAY_OPERATIONS")?new o.ReversePackedProgram(i.shape,c):new a.ReverseProgram(i.shape,c);return r.runWebGLProgram(d,[i],i.dtype)}let u={kernelName:s.Reverse,backendName:"webgl",kernelFunc:i}},{"@tensorflow/tfjs-core":"2nuhV","../reverse_gpu":"2SCdi","../reverse_packed_gpu":"jhYnq","./Identity":"4GZPt","@parcel/transformer-js/src/esmodule-helpers.js":"9pCYc"}],"2SCdi":[function(e,t,r){/** * @license * Copyright 2017 Google LLC. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. * ============================================================================= */var n=e("@parcel/transformer-js/src/esmodule-helpers.js");n.defineInteropFlag(r),n.export(r,"ReverseProgram",()=>a);var s=e("./shader_compiler");class a{constructor(e,t){this.variableNames=["x"];let r=e.length;if(r>4)throw Error(`WebGL backend: Reverse of rank-${r} tensor is not yet supported`);if(this.outputShape=e,1===r){this.userCode=` void main() { int coord = getOutputCoords(); setOutput(getX(${e[0]} - coord - 1)); } `;return}let n=r=>-1!==t.indexOf(r)&&1!==e[r]?`${e[r]} - coords[${r}] - 1`:`coords[${r}]`,a=e.map((e,t)=>n(t)).join(","),o=(0,s.getCoordsDataType)(r);this.userCode=` void main() { ${o} coords = getOutputCoords(); setOutput(getX(${a})); } `}}},{"./shader_compiler":"3kYYB","@parcel/transformer-js/src/esmodule-helpers.js":"9pCYc"}],jhYnq:[function(e,t,r){/** * @license * Copyright 2019 Google LLC. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. * ============================================================================= */var n=e("@parcel/transformer-js/src/esmodule-helpers.js");n.defineInteropFlag(r),n.export(r,"ReversePackedProgram",()=>o);var s=e("./packing_util"),a=e("./shader_compiler");class o{constructor(e,t){var r,n,o;this.variableNames=["x"],this.packedInputs=!0,this.packedOutput=!0;let l=e.length;if(l>4)throw Error(`WebGL backend: Reverse of rank-${l} tensor is not yet supported`);this.outputShape=e;let i=(0,s.getChannels)("rc",l),u=`${i[l-1]} + 1< ${this.outputShape[l-1]}`,p=`${i[l-2]} + 1 < ${this.outputShape[l-2]}`,c=(0,a.getCoordsDataType)(l);function d(r){let n=e.map((n,s)=>-1!==t.indexOf(s)&&1!==e[s]?`${e[s]} - ${r[s]} - 1`:`${r[s]}`),s=n.join(","),a=n.slice(-2).join(",");return`getChannel(getX(${s}), vec2(${a}))`}1===l?this.userCode=` void main(){ int rc = getOutputCoords(); vec4 result = vec4(0.); result.r = getChannel(getX(${e[0]} - rc - 1), ${e[0]} - rc - 1); if(${u}){ result.g = getChannel(getX(${e[0]} - (rc + 1) - 1), ${e[0]} - (rc + 1) - 1); } setOutput(result); } `:this.userCode=` void main() { ${c} rc = getOutputCoords(); vec4 result = vec4(0.); result.r = ${d(i.slice())}; if(${u}){ result.g = ${(r=i.slice())[l-1]="("+r[l-1]+" + 1)",d(r)}; } if(${p}) { result.b = ${(n=i.slice())[l-2]="("+n[l-2]+" + 1)",d(n)}; if(${u}) { result.a = ${(o=i.slice())[l-1]="("+o[l-1]+" + 1)",o[l-2]="("+o[l-2]+" + 1)",d(o)}; } } setOutput(result); } `}}},{"./packing_util":"6V5sg","./shader_compiler":"3kYYB","@parcel/transformer-js/src/esmodule-helpers.js":"9pCYc"}],h7iaU:[function(e,t,r){/** * @license * Copyright 2020 Google LLC. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. * ============================================================================= */var n=e("@parcel/transformer-js/src/esmodule-helpers.js");n.defineInteropFlag(r),n.export(r,"rotateWithOffsetConfig",()=>o);var s=e("@tensorflow/tfjs-core"),a=e("../rotate_gpu");let o={kernelName:s.RotateWithOffset,backendName:"webgl",kernelFunc:({inputs:e,attrs:t,backend:r})=>{let{image:n}=e,{radians:o,fillValue:l,center:i}=t,u=new a.RotateProgram(n.shape,l),[p,c]=(0,s.backend_util).getImageCenter(i,n.shape[1],n.shape[2]),d=[[p,c,Math.sin(o),Math.cos(o)]];return r.runWebGLProgram(u,[n],n.dtype,d)}}},{"@tensorflow/tfjs-core":"2nuhV","../rotate_gpu":"haPeJ","@parcel/transformer-js/src/esmodule-helpers.js":"9pCYc"}],haPeJ:[function(e,t,r){/** * @license * Copyright 2020 Google LLC. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. * ============================================================================= */var n=e("@parcel/transformer-js/src/esmodule-helpers.js");n.defineInteropFlag(r),n.export(r,"RotateProgram",()=>s);class s{constructor(e,t){this.variableNames=["Image"],this.outputShape=[],this.customUniforms=[{name:"params",type:"vec4"}];let r=e[1],n=e[2];this.outputShape=e;let s="";s="number"==typeof t?`float outputValue = ${t.toFixed(2)};`:` vec3 fill = vec3(${t.join(",")}); float outputValue = fill[coords[3]];`,this.userCode=` void main() { ivec4 coords = getOutputCoords(); int x = coords[2]; int y = coords[1]; float coordXFloat = (float(x) - params[0]) * params[3] - (float(y) - params[1]) * params[2]; float coordYFloat = (float(x) - params[0]) * params[2] + (float(y) - params[1]) * params[3]; int coordX = int(round(coordXFloat + params[0])); int coordY = int(round(coordYFloat + params[1])); ${s} if(coordX >= 0 && coordX< ${n} && coordY >= 0 && coordY< ${r}) { outputValue = getImage(coords[0], coordY, coordX, coords[3]); } setOutput(outputValue); } `}}},{"@parcel/transformer-js/src/esmodule-helpers.js":"9pCYc"}],"4L7ZM":[function(e,t,r){/** * @license * Copyright 2020 Google LLC. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. * ============================================================================= */var n=e("@parcel/transformer-js/src/esmodule-helpers.js");n.defineInteropFlag(r),n.export(r,"round",()=>l),n.export(r,"roundConfig",()=>i);var s=e("@tensorflow/tfjs-core"),a=e("../kernel_utils/kernel_funcs_utils");let o=` // OpenGL ES does not support round function. // The algorithm is based on banker's rounding. float base = floor(x); if ((x - base)< 0.5) { return floor(x); } else if ((x - base) >0.5) { return ceil(x); } else { if (mod(base, 2.0) == 0.0) { return base; } else { return base + 1.0; } } `,l=(0,a.unaryKernelFunc)({opSnippet:o}),i={kernelName:s.Round,backendName:"webgl",kernelFunc:l}},{"@tensorflow/tfjs-core":"2nuhV","../kernel_utils/kernel_funcs_utils":"jMepo","@parcel/transformer-js/src/esmodule-helpers.js":"9pCYc"}],"8EvOL":[function(e,t,r){/** * @license * Copyright 2020 Google LLC. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. * ============================================================================= */var n=e("@parcel/transformer-js/src/esmodule-helpers.js");n.defineInteropFlag(r),n.export(r,"rsqrt",()=>l),n.export(r,"rsqrtConfig",()=>i);var s=e("@tensorflow/tfjs-core"),a=e("../kernel_utils/kernel_funcs_utils"),o=e("../kernel_utils/shared");let l=(0,a.unaryKernelFunc)({opSnippet:"return inversesqrt(x);",cpuKernelImpl:o.rsqrtImplCPU}),i={kernelName:s.Rsqrt,backendName:"webgl",kernelFunc:l}},{"@tensorflow/tfjs-core":"2nuhV","../kernel_utils/kernel_funcs_utils":"jMepo","../kernel_utils/shared":"01kMd","@parcel/transformer-js/src/esmodule-helpers.js":"9pCYc"}],fEQ1p:[function(e,t,r){/** * @license * Copyright 2020 Google LLC. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. * ============================================================================= */var n=e("@parcel/transformer-js/src/esmodule-helpers.js");n.defineInteropFlag(r),n.export(r,"scatterNd",()=>i),n.export(r,"scatterNdConfig",()=>u);var s=e("@tensorflow/tfjs-core"),a=e("../scatter_gpu"),o=e("../scatter_packed_gpu"),l=e("./Reshape");function i(e){let t;let{inputs:r,backend:n,attrs:i}=e,{indices:u,updates:p}=r,{shape:c}=i,{sliceRank:d,numUpdates:f,sliceSize:h,strides:m,outputSize:g}=(0,s.backend_util).calculateShapes(p,u,c),x=[g/h,h];if(0===g)return n.makeTensorInfo(c,u.dtype);let v=(0,l.reshape)({inputs:{x:u},backend:n,attrs:{shape:[f,d]}}),y=(0,l.reshape)({inputs:{x:p},backend:n,attrs:{shape:[f,h]}}),b=n.makeTensorInfo([],"float32",new Float32Array([0]));t=(0,s.env)().getBool("WEBGL_PACK")?new o.ScatterPackedProgram(f,d,v.shape.length,y.shape.length,m,x):new a.ScatterProgram(f,d,v.shape.length,y.shape.length,m,x);let _=n.runWebGLProgram(t,[y,v,b],y.dtype),k=(0,l.reshape)({inputs:{x:_},backend:n,attrs:{shape:c}});return n.disposeIntermediateTensorInfo(v),n.disposeIntermediateTensorInfo(y),n.disposeIntermediateTensorInfo(_),n.disposeIntermediateTensorInfo(b),k}let u={kernelName:s.ScatterNd,backendName:"webgl",kernelFunc:i}},{"@tensorflow/tfjs-core":"2nuhV","../scatter_gpu":"agnlg","../scatter_packed_gpu":"ixCEH","./Reshape":"cgfGf","@parcel/transformer-js/src/esmodule-helpers.js":"9pCYc"}],agnlg:[function(e,t,r){/** * @license * Copyright 2018 Google LLC. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. * ============================================================================= */var n=e("@parcel/transformer-js/src/esmodule-helpers.js");n.defineInteropFlag(r),n.export(r,"ScatterProgram",()=>a);var s=e("./shader_compiler");class a{constructor(e,t,r,n,a,o,l=!0,i=!1){this.variableNames=["updates","indices","defaultValue"],this.outputShape=o;let u=(0,s.getCoordsDataType)(a.length),p=(0,s.getCoordsDataType)(o.length),c="";1===r?c="i":2===r&&(c="i, j");let d=`getIndices(${c})`,f="";1===n?f="i":2===n&&(f="i, coords[1]");let h=`getUpdates(${f})`,m="";i&&(m="coords[0], coords[1]");let g=`getDefaultValue(${m})`;this.userCode=` ${u} strides = ${u}(${a}); void main() { ${p} coords = getOutputCoords(); float sum = 0.0; bool found = false; for (int i = 0; i< ${e}; i++) { int flattenedIndex = 0; for (int j = 0; j < ${t}; j++) { int index = round(${d}); flattenedIndex += index * ${t>1?"strides[j]":"strides"}; } if (flattenedIndex == coords[0]) { sum += ${h}; found = true; } } setOutput(mix(${g}, sum, float(found))); } `}}},{"./shader_compiler":"3kYYB","@parcel/transformer-js/src/esmodule-helpers.js":"9pCYc"}],ixCEH:[function(e,t,r){/** * @license * Copyright 2023 Google LLC. * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. * ============================================================================= */var n=e("@parcel/transformer-js/src/esmodule-helpers.js");n.defineInteropFlag(r),n.export(r,"ScatterPackedProgram",()=>a);var s=e("./shader_compiler");class a{constructor(e,t,r,n,a,o,l=!0,i=!1){this.variableNames=["updates","indices","defaultValue"],this.packedInputs=!0,this.packedOutput=!0,this.outputShape=o;let u=(0,s.getCoordsDataType)(a.length),p=(0,s.getCoordsDataType)(o.length),c="";1===r?c="i":2===r&&(c="i, j");let d=`getIndices(${c})`,f="";1===n?f="i":2===n&&(f="i, coords[1]");let h=`getUpdates(${f})`,m="";i&&(m="coords[0], coords[1]");let g=`getDefaultValue(${m})`;this.userCode=` ${u} strides = ${u}(${a}); void main() { ${p} coords = getOutputCoords(); vec4 sum = vec4(0.); vec4 found = vec4(0.); for (int i = 0; i< ${e}; i+=2) { ivec2 flattenedIndex = ivec2(0); for (int j = 0; j < ${t}; j+=2) { ivec4 index = round(${d}); flattenedIndex += index.xz * ${t>1?"strides[j]":"strides"}; if (j + 1< ${t}) { flattenedIndex += index.yw * ${t>1?"strides[j + 1]":"strides"}; } } if (flattenedIndex[0] == coords[0] || flattenedIndex[1] == coords[0] || flattenedIndex[0] == coords[0] + 1 || flattenedIndex[1] == coords[0] + 1) { vec4 updVals = ${h}; if (flattenedIndex[0] == coords[0]) { sum.xy += updVals.xy; found.xy = vec2(1.); } else if (flattenedIndex[0] == coords[0] + 1) { sum.zw += updVals.xy; found.zw = vec2(1.); } if (flattenedIndex[1] == coords[0]) { sum.xy += updVals.zw; found.xy = vec2(1.); } else if (flattenedIndex[1] == coords[0] + 1) { sum.zw += updVals.zw; found.zw = vec2(1.); } } } setOutput(mix(${g}, sum, found)); } `}}},{"./shader_compiler":"3kYYB","@parcel/transformer-js/src/esmodule-helpers.js":"9pCYc"}],lqrgd:[function(e,t,r){/** * @license * Copyright 2022 Google LLC. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. * ============================================================================= */var n=e("@parcel/transformer-js/src/esmodule-helpers.js");n.defineInteropFlag(r),n.export(r,"searchSorted",()=>o),n.export(r,"searchSortedConfig",()=>l);var s=e("@tensorflow/tfjs-core"),a=e("../search_sorted_gpu");function o(e){let{inputs:t,backend:r,attrs:n}=e,{sortedSequence:s,values:o}=t,{side:l}=n,i=new a.SearchSortedProgram(s.shape[0],s.shape[1],o.shape[1],l),u=[[s.shape[1]]];return r.runWebGLProgram(i,[s,o],"int32",u)}let l={kernelName:s.SearchSorted,backendName:"webgl",kernelFunc:o}},{"@tensorflow/tfjs-core":"2nuhV","../search_sorted_gpu":"6lG5y","@parcel/transformer-js/src/esmodule-helpers.js":"9pCYc"}],"6lG5y":[function(e,t,r){/** * @license * Copyright 2022 Google LLC. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. * ============================================================================= */var n=e("@parcel/transformer-js/src/esmodule-helpers.js");n.defineInteropFlag(r),n.export(r,"SearchSortedProgram",()=>a);var s=e("@tensorflow/tfjs-core");class a{constructor(e,t,r,n){this.variableNames=["sortedSequence","values"],this.customUniforms=[{name:"numInputs",type:"int"}],this.outputShape=[e,r];let a=`for (int i = 0; i< ${Math.ceil(Math.log2(t+1))}; ++i) { if (left >= right) break;`,o=2===(0,s.env)().getNumber("WEBGL_VERSION")?"while (left< right) {":a;this.userCode=` int findBound(int batch, float value) { int left = 0; int right = numInputs; int mid; ${o} mid = (left + right) / 2; if (getSortedSequence(batch, mid) ${"left"===n?"<":"<="} value) { left = mid + 1; } else { right = mid; } } return right; } void main() { ivec2 coords = getOutputCoords(); int batch = coords[0]; int valueIndex = coords[1]; float value = getValues(batch, valueIndex); setOutput(float(findBound(batch, value))); } `}}},{"@tensorflow/tfjs-core":"2nuhV","@parcel/transformer-js/src/esmodule-helpers.js":"9pCYc"}],eA3E0:[function(e,t,r){/** * @license * Copyright 2020 Google LLC. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. * ============================================================================= */var n=e("@parcel/transformer-js/src/esmodule-helpers.js");n.defineInteropFlag(r),n.export(r,"select",()=>o),n.export(r,"selectConfig",()=>l);var s=e("@tensorflow/tfjs-core"),a=e("../select_gpu");function o(e){let{inputs:t,backend:r}=e,{condition:n,t:o,e:l}=t,i=new a.SelectProgram(n.shape.length,o.shape,o.shape.length);return r.runWebGLProgram(i,[n,o,l],(0,s.upcastType)(o.dtype,l.dtype))}let l={kernelName:s.Select,backendName:"webgl",kernelFunc:o}},{"@tensorflow/tfjs-core":"2nuhV","../select_gpu":"ggYE2","@parcel/transformer-js/src/esmodule-helpers.js":"9pCYc"}],ggYE2:[function(e,t,r){/** * @license * Copyright 2017 Google LLC. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. * ============================================================================= */var n=e("@parcel/transformer-js/src/esmodule-helpers.js");n.defineInteropFlag(r),n.export(r,"SelectProgram",()=>a);var s=e("./shader_compiler");class a{constructor(e,t,r){let n,a;if(this.variableNames=["c","a","b"],this.outputShape=t,r>4)throw Error(`Where for rank ${r} is not yet supported`);if(1===r)a="resRC",n="resRC";else{let r=["resRC.x","resRC.y","resRC.z","resRC.w"],s=[],o=[];for(let n=0;n= 1.0) { setOutput(getA(${a})); } else { setOutput(getB(${a})); } } `}}},{"./shader_compiler":"3kYYB","@parcel/transformer-js/src/esmodule-helpers.js":"9pCYc"}],ioaz8:[function(e,t,r){/** * @license * Copyright 2020 Google LLC. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. * ============================================================================= */var n=e("@parcel/transformer-js/src/esmodule-helpers.js");n.defineInteropFlag(r),n.export(r,"selu",()=>l),n.export(r,"seluConfig",()=>i);var s=e("@tensorflow/tfjs-core"),a=e("../kernel_utils/kernel_funcs_utils");let o=` // Stable and Attracting Fixed Point (0, 1) for Normalized Weights. // see: https://arxiv.org/abs/1706.02515 float scaleAlpha = ${s.backend_util.SELU_SCALEALPHA}; float scale = ${s.backend_util.SELU_SCALE}; return (x >= 0.0) ? scale * x : scaleAlpha * (exp(x) - 1.0); `,l=(0,a.unaryKernelFunc)({opSnippet:o}),i={kernelName:s.Selu,backendName:"webgl",kernelFunc:l}},{"@tensorflow/tfjs-core":"2nuhV","../kernel_utils/kernel_funcs_utils":"jMepo","@parcel/transformer-js/src/esmodule-helpers.js":"9pCYc"}],dmjlN:[function(e,t,r){/** * @license * Copyright 2020 Google LLC. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. * ============================================================================= */var n=e("@parcel/transformer-js/src/esmodule-helpers.js");n.defineInteropFlag(r),n.export(r,"sigmoid",()=>u),n.export(r,"sigmoidConfig",()=>p);var s=e("@tensorflow/tfjs-core"),a=e("../kernel_utils/kernel_funcs_utils"),o=e("../kernel_utils/shared");let l=a.CHECK_NAN_SNIPPET_UNARY+` return 1.0 / (1.0 + exp(-1.0 * x)); `,i=` vec4 result = 1.0 / (1.0 + exp(-1.0 * x)); bvec4 isNaN = isnan(x); result.r = isNaN.r ? x.r : result.r; result.g = isNaN.g ? x.g : result.g; result.b = isNaN.b ? x.b : result.b; result.a = isNaN.a ? x.a : result.a; return result; `,u=(0,a.unaryKernelFunc)({opSnippet:l,packedOpSnippet:i,cpuKernelImpl:o.sigmoidImplCPU}),p={kernelName:s.Sigmoid,backendName:"webgl",kernelFunc:u}},{"@tensorflow/tfjs-core":"2nuhV","../kernel_utils/kernel_funcs_utils":"jMepo","../kernel_utils/shared":"01kMd","@parcel/transformer-js/src/esmodule-helpers.js":"9pCYc"}],"7Flrc":[function(e,t,r){/** * @license * Copyright 2020 Google LLC. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. * ============================================================================= */var n=e("@parcel/transformer-js/src/esmodule-helpers.js");n.defineInteropFlag(r),n.export(r,"sign",()=>l),n.export(r,"signConfig",()=>i);var s=e("@tensorflow/tfjs-core"),a=e("../kernel_utils/kernel_funcs_utils");let o=` if (isnan(x)) { return 0.0; } return sign(x); `,l=(0,a.unaryKernelFunc)({opSnippet:o}),i={kernelName:s.Sign,backendName:"webgl",kernelFunc:l}},{"@tensorflow/tfjs-core":"2nuhV","../kernel_utils/kernel_funcs_utils":"jMepo","@parcel/transformer-js/src/esmodule-helpers.js":"9pCYc"}],a9NpT:[function(e,t,r){/** * @license * Copyright 2020 Google LLC. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. * ============================================================================= */var n=e("@parcel/transformer-js/src/esmodule-helpers.js");n.defineInteropFlag(r),n.export(r,"sin",()=>u),n.export(r,"sinConfig",()=>p);var s=e("@tensorflow/tfjs-core"),a=e("../binaryop_packed_gpu"),o=e("../kernel_utils/kernel_funcs_utils");let l=o.CHECK_NAN_SNIPPET_UNARY+` return sin(x); `,i=` vec4 result = sin(x); bvec4 isNaN = isnan(x); ${a.CHECK_NAN_SNIPPET_PACKED} return result; `,u=(0,o.unaryKernelFunc)({opSnippet:l,packedOpSnippet:i}),p={kernelName:s.Sin,backendName:"webgl",kernelFunc:u}},{"@tensorflow/tfjs-core":"2nuhV","../binaryop_packed_gpu":"f1UiT","../kernel_utils/kernel_funcs_utils":"jMepo","@parcel/transformer-js/src/esmodule-helpers.js":"9pCYc"}],"8qgS2":[function(e,t,r){/** * @license * Copyright 2020 Google LLC. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. * ============================================================================= */var n=e("@parcel/transformer-js/src/esmodule-helpers.js");n.defineInteropFlag(r),n.export(r,"sinh",()=>l),n.export(r,"sinhConfig",()=>i);var s=e("@tensorflow/tfjs-core"),a=e("../kernel_utils/kernel_funcs_utils");let o=` float e2x = exp(x); return (e2x - 1.0 / e2x) / 2.0; `,l=(0,a.unaryKernelFunc)({opSnippet:o}),i={kernelName:s.Sinh,backendName:"webgl",kernelFunc:l}},{"@tensorflow/tfjs-core":"2nuhV","../kernel_utils/kernel_funcs_utils":"jMepo","@parcel/transformer-js/src/esmodule-helpers.js":"9pCYc"}],"9krRr":[function(e,t,r){/** * @license * Copyright 2020 Google LLC. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. * ============================================================================= */var n=e("@parcel/transformer-js/src/esmodule-helpers.js");n.defineInteropFlag(r),n.export(r,"softplus",()=>l),n.export(r,"softplusConfig",()=>i);var s=e("@tensorflow/tfjs-core"),a=e("../kernel_utils/kernel_funcs_utils");let o=` float epsilon = 1.1920928955078125e-7; float threshold = log(epsilon) + 2.0; bool too_large = x > -threshold; bool too_small = x< threshold; float result; float exp_x = exp(x); if (too_large){ result = x; } else if (too_small){ result = exp_x; } else{ result = log(exp_x + 1.0); } return result; `,l=(0,a.unaryKernelFunc)({opSnippet:o}),i={kernelName:s.Softplus,backendName:"webgl",kernelFunc:l}},{"@tensorflow/tfjs-core":"2nuhV","../kernel_utils/kernel_funcs_utils":"jMepo","@parcel/transformer-js/src/esmodule-helpers.js":"9pCYc"}],"4D5QR":[function(e,t,r){/** * @license * Copyright 2020 Google LLC. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. * ============================================================================= */var n=e("@parcel/transformer-js/src/esmodule-helpers.js");n.defineInteropFlag(r),n.export(r,"spaceToBatchND",()=>i),n.export(r,"spaceToBatchNDConfig",()=>u);var s=e("@tensorflow/tfjs-core"),a=e("./PadV2"),o=e("./Reshape"),l=e("./Transpose");let i=e=>{let{inputs:t,backend:r,attrs:n}=e,{x:i}=t,{blockShape:u,paddings:p}=n;(0,s.util).assert(i.shape.length<=4,()=>"spaceToBatchND for rank > 4 with a WebGL backend not implemented yet");let c=u.reduce((e,t)=>e*t),d=[[0,0]];d.push(...p);for(let e=1+u.length;er.disposeIntermediateTensorInfo(e)),b},u={kernelName:s.SpaceToBatchND,backendName:"webgl",kernelFunc:i}},{"@tensorflow/tfjs-core":"2nuhV","./PadV2":"62aNS","./Reshape":"cgfGf","./Transpose":"jIlsI","@parcel/transformer-js/src/esmodule-helpers.js":"9pCYc"}],XBYqG:[function(e,t,r){/** * @license * Copyright 2021 Google LLC. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. * ============================================================================= */var n=e("@parcel/transformer-js/src/esmodule-helpers.js");n.defineInteropFlag(r),n.export(r,"sparseFillEmptyRows",()=>o),n.export(r,"sparseFillEmptyRowsConfig",()=>l);var s=e("@tensorflow/tfjs-core"),a=e("../kernel_utils/shared");function o(e){let{inputs:t,backend:r}=e,{indices:n,values:s,denseShape:o,defaultValue:l}=t;if(1!==o.shape.length)throw Error(`Dense shape must be a vector, saw: ${o.shape}`);if(2!==n.shape.length)throw Error(`Indices must be a matrix, saw: ${n.shape}`);if(1!==s.shape.length)throw Error(`Values must be a vector, saw: ${s.shape}`);if(0!==l.shape.length)throw Error(`Default value must be a scalar, saw: ${l.shape}`);let i=r.readSync(n.dataId),u=r.readSync(s.dataId),p=r.readSync(o.dataId),c=r.readSync(l.dataId)[0],[d,f,h,m,g]=(0,a.sparseFillEmptyRowsImplCPU)(i,n.shape,n.dtype,u,s.dtype,p,c);return[r.makeTensorInfo(f,n.dtype,d),r.makeTensorInfo([f[0]],s.dtype,h),r.makeTensorInfo([m.length],"bool",new Uint8Array(m.map(e=>Number(e)))),r.makeTensorInfo([g.length],n.dtype,new Int32Array(g))]}let l={kernelName:s.SparseFillEmptyRows,backendName:"webgl",kernelFunc:o}},{"@tensorflow/tfjs-core":"2nuhV","../kernel_utils/shared":"01kMd","@parcel/transformer-js/src/esmodule-helpers.js":"9pCYc"}],"5An6r":[function(e,t,r){/** * @license * Copyright 2021 Google LLC. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. * ============================================================================= */var n=e("@parcel/transformer-js/src/esmodule-helpers.js");n.defineInteropFlag(r),n.export(r,"sparseReshape",()=>o),n.export(r,"sparseReshapeConfig",()=>l);var s=e("@tensorflow/tfjs-core"),a=e("../kernel_utils/shared");function o(e){let{inputs:t,backend:r}=e,{inputIndices:n,inputShape:s,newShape:o}=t;if(2!==n.shape.length)throw Error(`Input indices should be a matrix but received shape ${n.shape}`);if(1!==s.shape.length)throw Error(`Input shape should be a vector but received shape ${s.shape}`);if(1!==o.shape.length)throw Error(`Target shape should be a vector but received shape ${o.shape}`);let l=Array.from(r.readSync(s.dataId)),i=r.readSync(n.dataId),u=Array.from(r.readSync(o.dataId)),[p,c,d]=(0,a.sparseReshapeImplCPU)(i,n.shape,n.dtype,l,u);return[r.makeTensorInfo(c,n.dtype,p),r.makeTensorInfo([d.length],o.dtype,new Int32Array(d))]}let l={kernelName:s.SparseReshape,backendName:"webgl",kernelFunc:o}},{"@tensorflow/tfjs-core":"2nuhV","../kernel_utils/shared":"01kMd","@parcel/transformer-js/src/esmodule-helpers.js":"9pCYc"}],fQlid:[function(e,t,r){/** * @license * Copyright 2021 Google LLC. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. * ============================================================================= */var n=e("@parcel/transformer-js/src/esmodule-helpers.js");n.defineInteropFlag(r),n.export(r,"sparseSegmentMean",()=>o),n.export(r,"sparseSegmentMeanConfig",()=>l);var s=e("@tensorflow/tfjs-core"),a=e("../kernel_utils/shared");function o(e){let{inputs:t,backend:r}=e,{data:n,indices:s,segmentIds:o}=t;if(n.shape.length<1)throw Error("Data should be at least 1 dimensional but received scalar");if(1!==s.shape.length)throw Error(`Indices should be a vector but received shape ${s.shape}`);if(1!==o.shape.length)throw Error(`Segment ids should be a vector but received shape ${o.shape}`);let l=r.readSync(n.dataId),i=r.readSync(s.dataId),u=r.readSync(o.dataId),[p,c]=(0,a.sparseSegmentReductionImplCPU)(l,n.shape,n.dtype,i,u,!0);return r.makeTensorInfo(c,n.dtype,p)}let l={kernelName:s.SparseSegmentMean,backendName:"webgl",kernelFunc:o}},{"@tensorflow/tfjs-core":"2nuhV","../kernel_utils/shared":"01kMd","@parcel/transformer-js/src/esmodule-helpers.js":"9pCYc"}],aMvEj:[function(e,t,r){/** * @license * Copyright 2021 Google LLC. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. * ============================================================================= */var n=e("@parcel/transformer-js/src/esmodule-helpers.js");n.defineInteropFlag(r),n.export(r,"sparseSegmentSum",()=>o),n.export(r,"sparseSegmentSumConfig",()=>l);var s=e("@tensorflow/tfjs-core"),a=e("../kernel_utils/shared");function o(e){let{inputs:t,backend:r}=e,{data:n,indices:s,segmentIds:o}=t;if(n.shape.length<1)throw Error("Data should be at least 1 dimensional but received scalar");if(1!==s.shape.length)throw Error(`Indices should be a vector but received shape ${s.shape}`);if(1!==o.shape.length)throw Error(`Segment ids should be a vector but received shape ${o.shape}`);let l=r.readSync(n.dataId),i=r.readSync(s.dataId),u=r.readSync(o.dataId),[p,c]=(0,a.sparseSegmentReductionImplCPU)(l,n.shape,n.dtype,i,u);return r.makeTensorInfo(c,n.dtype,p)}let l={kernelName:s.SparseSegmentSum,backendName:"webgl",kernelFunc:o}},{"@tensorflow/tfjs-core":"2nuhV","../kernel_utils/shared":"01kMd","@parcel/transformer-js/src/esmodule-helpers.js":"9pCYc"}],lqK1r:[function(e,t,r){/** * @license * Copyright 2020 Google LLC. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. * ============================================================================= */var n=e("@parcel/transformer-js/src/esmodule-helpers.js");n.defineInteropFlag(r),n.export(r,"sparseToDense",()=>i),n.export(r,"sparseToDenseConfig",()=>u);var s=e("@tensorflow/tfjs-core"),a=e("../kernel_utils/shared"),o=e("../scatter_gpu"),l=e("./Reshape");function i(e){let{inputs:t,backend:r,attrs:n}=e,{sparseIndices:i,sparseValues:u,defaultValue:p}=t,{outputShape:c}=n,{sliceRank:d,numUpdates:f,sliceSize:h,strides:m,outputSize:g}=(0,s.backend_util).calculateShapes(u,i,c);if("string"===u.dtype){let e=r.bufferSync(i),t=r.bufferSync(u),n=(0,s.util).decodeString(r.readSync(p.dataId)[0]),o=(0,a.scatterImplCPU)(e,t,c,g,h,f,d,m,n,!1);return r.makeTensorInfo(c,o.dtype,o.values)}let x=new o.ScatterProgram(f,d,i.shape.length,u.shape.length,m,[g,1],!1),v=r.runWebGLProgram(x,[u,i,p],u.dtype),y=(0,l.reshape)({inputs:{x:v},backend:r,attrs:{shape:c}});return r.disposeIntermediateTensorInfo(v),y}let u={kernelName:s.SparseToDense,backendName:"webgl",kernelFunc:i}},{"@tensorflow/tfjs-core":"2nuhV","../kernel_utils/shared":"01kMd","../scatter_gpu":"agnlg","./Reshape":"cgfGf","@parcel/transformer-js/src/esmodule-helpers.js":"9pCYc"}],"965SM":[function(e,t,r){/** * @license * Copyright 2020 Google LLC. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. * ============================================================================= */var n=e("@parcel/transformer-js/src/esmodule-helpers.js");n.defineInteropFlag(r),n.export(r,"splitV",()=>o),n.export(r,"splitVConfig",()=>l);var s=e("@tensorflow/tfjs-core"),a=e("./Slice");function o(e){let{inputs:t,backend:r,attrs:n}=e,{x:o}=t,{numOrSizeSplits:l,axis:i}=n,u=(0,s.util).parseAxisParam(i,o.shape)[0],p=(0,s.backend_util).prepareSplitSize(o,l,u),c=Array(o.shape.length).fill(0),d=o.shape.slice();return p.map(e=>{let t=[...d];t[u]=e;let n=(0,a.slice)({inputs:{x:o},backend:r,attrs:{begin:c,size:t}});return c[u]+=e,n})}let l={kernelName:s.SplitV,backendName:"webgl",kernelFunc:o}},{"@tensorflow/tfjs-core":"2nuhV","./Slice":"duMU0","@parcel/transformer-js/src/esmodule-helpers.js":"9pCYc"}],i5QWi:[function(e,t,r){/** * @license * Copyright 2020 Google LLC. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. * ============================================================================= */var n=e("@parcel/transformer-js/src/esmodule-helpers.js");n.defineInteropFlag(r),n.export(r,"sqrt",()=>i),n.export(r,"sqrtConfig",()=>u);var s=e("@tensorflow/tfjs-core"),a=e("../kernel_utils/kernel_funcs_utils"),o=e("../kernel_utils/shared");let l="return sqrt(x);",i=(0,a.unaryKernelFunc)({opSnippet:l,packedOpSnippet:l,cpuKernelImpl:o.sqrtImplCPU}),u={kernelName:s.Sqrt,backendName:"webgl",kernelFunc:i}},{"@tensorflow/tfjs-core":"2nuhV","../kernel_utils/kernel_funcs_utils":"jMepo","../kernel_utils/shared":"01kMd","@parcel/transformer-js/src/esmodule-helpers.js":"9pCYc"}],hPuFu:[function(e,t,r){/** * @license * Copyright 2019 Google LLC. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. * ============================================================================= */var n=e("@parcel/transformer-js/src/esmodule-helpers.js");n.defineInteropFlag(r),n.export(r,"square",()=>a),n.export(r,"squareConfig",()=>o);var s=e("@tensorflow/tfjs-core");let a=(0,e("../kernel_utils/kernel_funcs_utils").unaryKernelFunc)({opSnippet:"return x * x;"}),o={kernelName:s.Square,backendName:"webgl",kernelFunc:a}},{"@tensorflow/tfjs-core":"2nuhV","../kernel_utils/kernel_funcs_utils":"jMepo","@parcel/transformer-js/src/esmodule-helpers.js":"9pCYc"}],dImmu:[function(e,t,r){/** * @license * Copyright 2020 Google LLC. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. * ============================================================================= */var n=e("@parcel/transformer-js/src/esmodule-helpers.js");n.defineInteropFlag(r),n.export(r,"squaredDifference",()=>l),n.export(r,"squaredDifferenceConfig",()=>i);var s=e("@tensorflow/tfjs-core"),a=e("../kernel_utils/kernel_funcs_utils");let o="return (a - b) * (a - b);",l=(0,a.binaryKernelFunc)({opSnippet:o,packedOpSnippet:o}),i={kernelName:s.SquaredDifference,backendName:"webgl",kernelFunc:l}},{"@tensorflow/tfjs-core":"2nuhV","../kernel_utils/kernel_funcs_utils":"jMepo","@parcel/transformer-js/src/esmodule-helpers.js":"9pCYc"}],aAhYI:[function(e,t,r){/** * @license * Copyright 2023 Google LLC. * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. * ============================================================================= */var n=e("@parcel/transformer-js/src/esmodule-helpers.js");n.defineInteropFlag(r),n.export(r,"staticRegexReplace",()=>o),n.export(r,"staticRegexReplaceConfig",()=>l);var s=e("@tensorflow/tfjs-core"),a=e("../kernel_utils/shared");function o(e){let{inputs:t,backend:r,attrs:n}=e,{x:o}=t;if("string"!==o.dtype)throw Error("Input must be of datatype string");let l=r.readSync(o.dataId),i=(0,s.backend_util).fromUint8ToStringArray(l),u=(0,a.staticRegexReplaceImplCPU)(i,"string",n);return r.makeTensorInfo(o.shape,"string",u)}let l={kernelName:s.StaticRegexReplace,backendName:"webgl",kernelFunc:o}},{"@tensorflow/tfjs-core":"2nuhV","../kernel_utils/shared":"01kMd","@parcel/transformer-js/src/esmodule-helpers.js":"9pCYc"}],"5KiFV":[function(e,t,r){/** * @license * Copyright 2020 Google LLC. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. * ============================================================================= */var n=e("@parcel/transformer-js/src/esmodule-helpers.js");n.defineInteropFlag(r),n.export(r,"step",()=>o),n.export(r,"stepConfig",()=>l);var s=e("@tensorflow/tfjs-core"),a=e("../unaryop_gpu");function o({inputs:e,attrs:t,backend:r}){let{x:n}=e,s=a.CHECK_NAN_SNIPPET+` return x > 0.0 ? 1.0 : float(${t.alpha}); `,o=new a.UnaryOpProgram(n.shape,s);return r.runWebGLProgram(o,[n],n.dtype)}let l={kernelName:s.Step,backendName:"webgl",kernelFunc:o}},{"@tensorflow/tfjs-core":"2nuhV","../unaryop_gpu":"iNthQ","@parcel/transformer-js/src/esmodule-helpers.js":"9pCYc"}],"7dqVR":[function(e,t,r){/** * @license * Copyright 2020 Google LLC. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. * ============================================================================= */var n=e("@parcel/transformer-js/src/esmodule-helpers.js");n.defineInteropFlag(r),n.export(r,"stridedSlice",()=>u),n.export(r,"stridedSliceConfig",()=>p);var s=e("@tensorflow/tfjs-core"),a=e("../kernel_utils/shared"),o=e("../strided_slice_gpu"),l=e("./Reshape"),i=e("./Slice");function u(e){let t;let{inputs:r,backend:n,attrs:u}=e,{x:p}=r,{begin:c,end:d,strides:f,beginMask:h,endMask:m,ellipsisMask:g,newAxisMask:x,shrinkAxisMask:v}=u,{finalShapeSparse:y,finalShape:b,isIdentity:_,sliceDim0:k,isSimpleSlice:j,begin:I,end:C,strides:w}=(0,s.slice_util).sliceInfo(p.shape,c,d,f,h,m,g,x,v);if(_)t=(0,l.reshape)({inputs:{x:p},backend:n,attrs:{shape:b}});else if(k||j){(0,s.util).assert(p.shape.length>=1,()=>`Input must have rank at least 1, got: ${p.shape.length}`);let e=(0,s.slice_util).computeOutShape(I,C,w),r=(0,i.slice)({inputs:{x:p},backend:n,attrs:{begin:I,size:e}});t=(0,l.reshape)({inputs:{x:r},backend:n,attrs:{shape:b}}),n.disposeIntermediateTensorInfo(r)}else if(n.shouldExecuteOnCPU([p])){let e=n.readSync(p.dataId),r=(0,s.buffer)(p.shape,p.dtype,e),o=(0,a.stridedSliceImplCPU)(y,r,w,I);t=n.makeTensorInfo(b,p.dtype,o.values)}else{let e=new o.StridedSliceProgram(I,w,y);t=n.runWebGLProgram(e,[p],p.dtype)}let T=(0,l.reshape)({inputs:{x:t},backend:n,attrs:{shape:b}});return n.disposeIntermediateTensorInfo(t),T}let p={kernelName:s.StridedSlice,backendName:"webgl",kernelFunc:u}},{"@tensorflow/tfjs-core":"2nuhV","../kernel_utils/shared":"01kMd","../strided_slice_gpu":"1IG6I","./Reshape":"cgfGf","./Slice":"duMU0","@parcel/transformer-js/src/esmodule-helpers.js":"9pCYc"}],"1IG6I":[function(e,t,r){/** * @license * Copyright 2017 Google LLC. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. * ============================================================================= */var n=e("@parcel/transformer-js/src/esmodule-helpers.js");n.defineInteropFlag(r),n.export(r,"StridedSliceProgram",()=>a);var s=e("./shader_compiler");class a{constructor(e,t,r){this.variableNames=["x"],this.outputShape=r;let n=r.length,a=(0,s.getCoordsDataType)(r.length),o=(0,s.getCoordsDataType)(r.length),l="";if(1===n)l="coords * strides + begin";else{let e=0;l=r.map((t,n)=>(e++,1===r.length?`coords * strides[${n}] + begin[${n}]`:`coords[${e-1}] * strides[${n}] + begin[${n}]`)).join(",")}this.userCode=` ${a} begin = ${a}(${e}); ${a} strides = ${a}(${t}); void main() { ${o} coords = getOutputCoords(); setOutput(getX(${l})); } `}}},{"./shader_compiler":"3kYYB","@parcel/transformer-js/src/esmodule-helpers.js":"9pCYc"}],lWUSd:[function(e,t,r){/** * @license * Copyright 2021 Google LLC. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. * ============================================================================= */var n=e("@parcel/transformer-js/src/esmodule-helpers.js");n.defineInteropFlag(r),n.export(r,"stringNGrams",()=>o),n.export(r,"stringNGramsConfig",()=>l);var s=e("@tensorflow/tfjs-core"),a=e("../kernel_utils/shared");function o(e){let{inputs:t,backend:r,attrs:n}=e,{separator:s,nGramWidths:o,leftPad:l,rightPad:i,padWidth:u,preserveShortSequences:p}=n,{data:c,dataSplits:d}=t,f=r.readSync(c.dataId),h=r.readSync(d.dataId),[m,g]=(0,a.stringNGramsImplCPU)(f,h,s,o,l,i,u,p);return[r.makeTensorInfo([m.length],"string",m),r.makeTensorInfo(d.shape,"int32",g)]}let l={kernelName:s.StringNGrams,backendName:"webgl",kernelFunc:o}},{"@tensorflow/tfjs-core":"2nuhV","../kernel_utils/shared":"01kMd","@parcel/transformer-js/src/esmodule-helpers.js":"9pCYc"}],gRNB9:[function(e,t,r){/** * @license * Copyright 2021 Google LLC. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. * ============================================================================= */var n=e("@parcel/transformer-js/src/esmodule-helpers.js");n.defineInteropFlag(r),n.export(r,"stringSplit",()=>o),n.export(r,"stringSplitConfig",()=>l);var s=e("@tensorflow/tfjs-core"),a=e("../kernel_utils/shared");function o(e){let{inputs:t,backend:r,attrs:n}=e,{skipEmpty:s}=n,{input:o,delimiter:l}=t;if("string"!==o.dtype)throw Error("Input must be of datatype string");if(1!==o.shape.length)throw Error(`Input must be a vector, got shape: ${o.shape}`);if(0!==l.shape.length)throw Error(`Delimiter must be a scalar, got shape: ${l.shape}`);let i=r.readSync(o.dataId),u=r.readSync(l.dataId)[0],[p,c,d]=(0,a.stringSplitImplCPU)(i,u,s),f=c.length;return[r.makeTensorInfo([f,2],"int32",p),r.makeTensorInfo([f],"string",c),r.makeTensorInfo([2],"int32",new Int32Array(d))]}let l={kernelName:s.StringSplit,backendName:"webgl",kernelFunc:o}},{"@tensorflow/tfjs-core":"2nuhV","../kernel_utils/shared":"01kMd","@parcel/transformer-js/src/esmodule-helpers.js":"9pCYc"}],"4OZ9L":[function(e,t,r){/** * @license * Copyright 2021 Google LLC. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. * ============================================================================= */var n=e("@parcel/transformer-js/src/esmodule-helpers.js");n.defineInteropFlag(r),n.export(r,"stringToHashBucketFast",()=>o),n.export(r,"stringToHashBucketFastConfig",()=>l);var s=e("@tensorflow/tfjs-core"),a=e("../kernel_utils/shared");function o(e){let{inputs:t,backend:r,attrs:n}=e,{numBuckets:s}=n,{input:o}=t;if("string"!==o.dtype)throw Error("Input must be of datatype string");if(s<=0)throw Error("Number of buckets must be at least 1");let l=r.readSync(o.dataId),i=(0,a.stringToHashBucketFastImplCPU)(l,s);return r.makeTensorInfo(o.shape,"int32",i)}let l={kernelName:s.StringToHashBucketFast,backendName:"webgl",kernelFunc:o}},{"@tensorflow/tfjs-core":"2nuhV","../kernel_utils/shared":"01kMd","@parcel/transformer-js/src/esmodule-helpers.js":"9pCYc"}],"32aJ0":[function(e,t,r){/** * @license * Copyright 2020 Google LLC. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. * ============================================================================= */var n=e("@parcel/transformer-js/src/esmodule-helpers.js");n.defineInteropFlag(r),n.export(r,"tan",()=>a),n.export(r,"tanConfig",()=>o);var s=e("@tensorflow/tfjs-core");let a=(0,e("../kernel_utils/kernel_funcs_utils").unaryKernelFunc)({opSnippet:"return tan(x);"}),o={kernelName:s.Tan,backendName:"webgl",kernelFunc:a}},{"@tensorflow/tfjs-core":"2nuhV","../kernel_utils/kernel_funcs_utils":"jMepo","@parcel/transformer-js/src/esmodule-helpers.js":"9pCYc"}],gR8zr:[function(e,t,r){/** * @license * Copyright 2020 Google LLC. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. * ============================================================================= */var n=e("@parcel/transformer-js/src/esmodule-helpers.js");n.defineInteropFlag(r),n.export(r,"tanh",()=>l),n.export(r,"tanhConfig",()=>i);var s=e("@tensorflow/tfjs-core"),a=e("../kernel_utils/kernel_funcs_utils");let o=` float e2x = exp(-2.0 * abs(x)); return sign(x) * (1.0 - e2x) / (1.0 + e2x); `,l=(0,a.unaryKernelFunc)({opSnippet:o}),i={kernelName:s.Tanh,backendName:"webgl",kernelFunc:l}},{"@tensorflow/tfjs-core":"2nuhV","../kernel_utils/kernel_funcs_utils":"jMepo","@parcel/transformer-js/src/esmodule-helpers.js":"9pCYc"}],IUrLE:[function(e,t,r){/** * @license * Copyright 2022 Google LLC. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. * ============================================================================= */var n=e("@parcel/transformer-js/src/esmodule-helpers.js");n.defineInteropFlag(r),n.export(r,"tensorScatterUpdate",()=>l),n.export(r,"tensorScatterUpdateConfig",()=>i);var s=e("@tensorflow/tfjs-core"),a=e("../scatter_gpu"),o=e("./Reshape");function l(e){let{inputs:t,backend:r,attrs:n}=e,{tensor:l,indices:i,updates:u}=t,{}=n,{sliceRank:p,numUpdates:c,sliceSize:d,strides:f,outputSize:h}=(0,s.backend_util).calculateShapes(u,i,l.shape),m=[h/d,d];if(0===h)return r.makeTensorInfo(l.shape,i.dtype);let g=(0,o.reshape)({inputs:{x:i},backend:r,attrs:{shape:[c,p]}}),x=(0,o.reshape)({inputs:{x:u},backend:r,attrs:{shape:[c,d]}}),v=(0,o.reshape)({inputs:{x:l},backend:r,attrs:{shape:m}}),y=new a.ScatterProgram(c,p,g.shape.length,x.shape.length,f,m,!1,!0),b=r.runWebGLProgram(y,[x,g,v],v.dtype),_=(0,o.reshape)({inputs:{x:b},backend:r,attrs:{shape:l.shape}});return r.disposeIntermediateTensorInfo(g),r.disposeIntermediateTensorInfo(x),r.disposeIntermediateTensorInfo(v),r.disposeIntermediateTensorInfo(b),_}let i={kernelName:s.TensorScatterUpdate,backendName:"webgl",kernelFunc:l}},{"@tensorflow/tfjs-core":"2nuhV","../scatter_gpu":"agnlg","./Reshape":"cgfGf","@parcel/transformer-js/src/esmodule-helpers.js":"9pCYc"}],f9YW6:[function(e,t,r){/** * @license * Copyright 2020 Google LLC. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. * ============================================================================= */var n=e("@parcel/transformer-js/src/esmodule-helpers.js");n.defineInteropFlag(r),n.export(r,"tile",()=>l),n.export(r,"tileConfig",()=>i);var s=e("@tensorflow/tfjs-core"),a=e("../kernel_utils/shared"),o=e("../tile_gpu");function l(e){let{inputs:t,backend:r,attrs:n}=e,{x:l}=t,{reps:i}=n;if("string"===l.dtype||l.shape.length>5){let e=r.readSync(l.dataId),t="string"===l.dtype?e.map(e=>(0,s.util).decodeString(e)):e,n=(0,s.buffer)(l.shape,l.dtype,t),o=(0,a.tileImplCPU)(n,i);return r.makeTensorInfo(o.shape,o.dtype,o.values)}let u=new o.TileProgram(l.shape,i);return r.runWebGLProgram(u,[l],l.dtype)}let i={kernelName:s.Tile,backendName:"webgl",kernelFunc:l}},{"@tensorflow/tfjs-core":"2nuhV","../kernel_utils/shared":"01kMd","../tile_gpu":"a3DIu","@parcel/transformer-js/src/esmodule-helpers.js":"9pCYc"}],a3DIu:[function(e,t,r){/** * @license * Copyright 2017 Google LLC. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. * ============================================================================= */var n=e("@parcel/transformer-js/src/esmodule-helpers.js");n.defineInteropFlag(r),n.export(r,"TileProgram",()=>a);var s=e("./shader_compiler");class a{constructor(e,t){this.variableNames=["A"];let r=Array(e.length);for(let n=0;n5)throw Error(`Tile for rank ${t} is not yet supported`);if(1===t)return`imod(resRC, ${e[0]})`;let r=["resRC.x","resRC.y","resRC.z","resRC.w","resRC.u"],n=[];for(let t=0;tf),n.export(r,"topKConfig",()=>h);var s=e("@tensorflow/tfjs-core"),a=e("../kernel_utils/shared"),o=e("../top_k_gpu"),l=e("./Fill"),i=e("./GatherV2"),u=e("./Reshape"),p=e("./Slice");function c(e,t){null!==t&&e.disposeIntermediateTensorInfo(t)}function d(e){let t=1;for(;tx){let e=r.readSync(f.dataId),[t,n]=(0,a.topKImplCPU)(e,v,f.dtype,h,m);return[r.makeTensorInfo(t.shape,t.dtype,t.values),r.makeTensorInfo(n.shape,n.dtype,n.values)]}if(0===h)return v[v.length-1]=0,[r.makeTensorInfo(v,f.dtype,[]),r.makeTensorInfo(v,"int32",[])];if(1===y)return[f,(0,l.fill)({attrs:{shape:v,dtype:"int32",value:0},backend:r})];let b=r.texData.get(f.dataId),_=null!==b&&b.isPacked,k=_?r.unpackTensor(f):f,j=(0,s.util).sizeFromShape(v)/y,I=(0,u.reshape)({inputs:{x:k},attrs:{shape:[j,y]},backend:r});_&&c(r,k);let C=d(h),w=d(y),T=null,S=()=>null===T?[I,I]:[I,T],N=(e,t,n)=>{let s=S(),a=new o.SwapProgram(n),l=[[y],[null===T?1:0],[Number.NEGATIVE_INFINITY],[e],[t]],i=T;T=r.runWebGLProgram(a,s,"int32",l),c(r,i)};for(let e=1;e=1;r/=2)N(t,r,[j,w])}for(let e=w;e>C;e/=2){let t=S(),n=new o.MergeProgram([j,e/2]),s=[[y],[null===T?1:0],[C]],a=T;T=r.runWebGLProgram(n,t,"int32",s),c(r,a);let l=C/2,i=2*l;for(let e=l;e>=1;e/=2)N(i,e,T.shape)}let E=T;T=(0,p.slice)({inputs:{x:T},backend:r,attrs:{begin:0,size:[j,h]}}),c(r,E);let F=(0,i.gatherV2)({inputs:{x:I,indices:T},backend:r,attrs:{axis:1,batchDims:1}});c(r,I);let R=v.slice(0,-1);R.push(h),E=T,T=(0,u.reshape)({inputs:{x:T},attrs:{shape:R},backend:r}),c(r,E);let A=F;return F=(0,u.reshape)({inputs:{x:F},attrs:{shape:R},backend:r}),c(r,A),[F,T]}let h={kernelName:s.TopK,backendName:"webgl",kernelFunc:f}},{"@tensorflow/tfjs-core":"2nuhV","../kernel_utils/shared":"01kMd","../top_k_gpu":"3VoKv","./Fill":"6vZGW","./GatherV2":"4dBGm","./Reshape":"cgfGf","./Slice":"duMU0","@parcel/transformer-js/src/esmodule-helpers.js":"9pCYc"}],"3VoKv":[function(e,t,r){var n=e("@parcel/transformer-js/src/esmodule-helpers.js");n.defineInteropFlag(r),n.export(r,"SwapProgram",()=>s),n.export(r,"MergeProgram",()=>a);class s{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]; int elemIdx = coords[1]; // We compare elements pair-wise within a group of size 2 * inc. // The comparing rule for each group alternates between ascending // and descending. Within each group, we compare each pair at // positions i and i+inc. To decide whether an element at position i // is x0 or x1, we mod it by 2 * inc, if the result is smaller than // inc, it is in the first half of the group, we denote it as x0, // otherwise we denote it as x1. // For example, as shown in the Bitonic top K paper referenced above, // Figure5(a) shows that element[1] is in the // second half of the group when group size is 2, but it is in the // first half of the group when group size is 4. bool isFirstInPair = imod(elemIdx, 2 * inc)< inc; int i = isFirstInPair ? elemIdx : elemIdx - inc; int i0 = firstPass == 1 ? i : int(getIndices(batch, i)); int i1 = firstPass == 1 ? i + inc : int(getIndices(batch, i + inc)); float x0 = i0 < n ? getX(batch, i0) : negativeInf; float x1 = i1 < n ? getX(batch, i1) : negativeInf; // Denotes which direction indices are in (ascending or descending). bool reverse = imod(elemIdx, 2 * dir) >= dir; bool isGreater = x0 > x1 || (x0 == x1 && i1 > i0); if (reverse == isGreater) { // Elements in opposite order of direction int iTemp = i0; i0 = i1; i1 = iTemp; } if (isFirstInPair) { setOutput(float(i0)); } else { setOutput(float(i1)); } } `}}class a{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(); int batch = coords[0]; int elemIdx = coords[1]; // The output size is half of the previous size. // If the previous sequence is | | | | _ _ _ _ | | | | _ _ _ _ (k=4), // we only need to output the indices at positions |, the indices at // positions _ can be thrown away, see Figure5(b) After Phase 2 // (Merge phase) in the Bitonic Top K paper referenced above. // For example, the paper shows we only need to output the orange bars. // The output sequence should look like this | | | | | | | |. // Because the sequence is halved, to map the output index back // to the previous sequence to find the corresponding value, // we need to double the index. When we double the index, // we basically interpolate a position, so 2i looks like // | _ | _ | _ | _ | _ | _ | _. We move the | to the first k position // of each 2k positions by - elemIdx % k. E.g. for output at // index 4,5,6,7, we want to get the corresponding element at // original index 8,9,10,11, for output at index 8,9,10,11, // we want to get the corresponding element at original index // 16,17,18,19, so on and so forth. int i = elemIdx< k ? elemIdx : (elemIdx * 2 - imod(elemIdx, k)); int i0 = firstPass == 1 ? i : int(getIndices(batch, i)); int i1 = firstPass == 1 ? i + k : int(getIndices(batch, i + k)); float x0 = getX(batch, i0); float x1 = i1 < n ? getX(batch, i1) : x0; setOutput(x0 >= x1 ? float(i0) : float(i1)); } `}}},{"@parcel/transformer-js/src/esmodule-helpers.js":"9pCYc"}],"6eyWT":[function(e,t,r){/** * @license * Copyright 2021 Google LLC. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. * ============================================================================= */var n=e("@parcel/transformer-js/src/esmodule-helpers.js");n.defineInteropFlag(r),n.export(r,"transform",()=>o),n.export(r,"transformConfig",()=>l);var s=e("@tensorflow/tfjs-core"),a=e("../transform_gpu");function o(e){let{inputs:t,backend:r,attrs:n}=e,{image:s,transforms:o}=t,{interpolation:l,fillMode:i,fillValue:u,outputShape:p}=n,[c,d,f,h]=s.shape,[m,g]=null!=p?p:[d,f],x=new a.TransformProgram(d,f,l,i,u,[c,m,g,h]);return r.runWebGLProgram(x,[s,o],"float32")}let l={kernelName:s.Transform,backendName:"webgl",kernelFunc:o}},{"@tensorflow/tfjs-core":"2nuhV","../transform_gpu":"eSMPN","@parcel/transformer-js/src/esmodule-helpers.js":"9pCYc"}],eSMPN:[function(e,t,r){/** * @license * Copyright 2021 Google LLC. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. * ============================================================================= */var n=e("@parcel/transformer-js/src/esmodule-helpers.js");n.defineInteropFlag(r),n.export(r,"TransformProgram",()=>s);class s{constructor(e,t,r,n,s,a){let o;switch(this.variableNames=["Image","Transforms"],this.outputShape=a,n){case"constant":default:o=1;break;case"reflect":o=2;break;case"wrap":o=3;break;case"nearest":o=4}this.userCode=` float mapCoord(float outCoord, float len) { float inCoord = outCoord; if(${o} == 2) { if (inCoord< 0.0) { if (len <= 1.0) { inCoord = 0.0; } else { float sz2 = 2.0 * len; if (inCoord < sz2) { inCoord = sz2 * float(int(float(-inCoord / sz2))) + inCoord; } inCoord = inCoord < -len ? inCoord + sz2 : -inCoord - 1.0; } } else if (inCoord >len - 1.0) { if (len<= 1.0) { inCoord = 0.0; } else { float sz2 = 2.0 * len; inCoord -= sz2 * float(int(float(inCoord / sz2))); if (inCoord >= len) { inCoord = sz2 - inCoord - 1.0; } } } return clamp(inCoord, 0.0, len - 1.0); } else if (${o} == 3) { if (inCoord< 0.0) { if (len <= 1.0) { inCoord = 0.0; } else { float sz = len - 1.0; inCoord += len * (float(int(float(-inCoord / sz))) + 1.0); } } else if (inCoord >len - 1.0) { if (len<= 1.0) { inCoord = 0.0; } else { float sz = len - 1.0; inCoord -= len * float(int(float(inCoord / sz))); } } return clamp(inCoord, 0.0, len - 1.0); } else if (${o} == 4) { return clamp(outCoord, 0.0, len - 1.0); } else { return outCoord; } } float readWithFillValue(int batch, int coordY, int coordX, int channel) { float outputValue; if (0 <= coordY && coordY < ${e} && 0 <= coordX && coordX < ${t}) { outputValue = getImage(batch, coordY, coordX, channel); } else { outputValue = float(${s}); } return outputValue; } void main() { ivec4 coords = getOutputCoords(); float outputValue; int batch = coords[0]; int x = coords[2]; int y = coords[1]; int channel = coords[3]; float xf = float(x); float yf = float(y); float a1 = getTransforms(batch, 0); float a2 = getTransforms(batch, 1); float a3 = getTransforms(batch, 2); float b1 = getTransforms(batch, 3); float b2 = getTransforms(batch, 4); float b3 = getTransforms(batch, 5); float c1 = getTransforms(batch, 6); float c2 = getTransforms(batch, 7); float projection = c1 * xf + c2 * yf + 1.0; if (projection == 0.0) { outputValue = float(${s}); } else { float inX = (a1 * xf + a2 * yf + a3) / projection; float inY = (b1 * xf + b2 * yf + b3) / projection; float mapX = mapCoord(inX, float(${t})); float mapY = mapCoord(inY, float(${e})); if (${"nearest"===r?1:2} == 1) { int coordY = int(round(mapY)); int coordX = int(round(mapX)); outputValue = readWithFillValue(batch, coordY, coordX, channel); } else { float yFloor = floor(mapY); float xFloor = floor(mapX); float yCeil = yFloor + 1.0; float xCeil = xFloor + 1.0; float valueYFloor = (xCeil - mapX) * readWithFillValue(batch, int(yFloor), int(xFloor), channel) + (mapX - xFloor) * readWithFillValue(batch, int(yFloor), int(xCeil), channel); float valueYCeil = (xCeil - mapX) * readWithFillValue(batch, int(yCeil), int(xFloor), channel) + (mapX - xFloor) * readWithFillValue(batch, int(yCeil), int(xCeil), channel); outputValue = (yCeil - mapY) * valueYFloor + (mapY - yFloor) * valueYCeil; } } setOutput(outputValue); } `}}},{"@parcel/transformer-js/src/esmodule-helpers.js":"9pCYc"}],"3FbGA":[function(e,t,r){/** * @license * Copyright 2020 Google LLC. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the License); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an AS IS BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. * ============================================================================= */var n=e("@parcel/transformer-js/src/esmodule-helpers.js");n.defineInteropFlag(r),n.export(r,"unique",()=>l),n.export(r,"uniqueConfig",()=>i);var s=e("@tensorflow/tfjs-core"),a=e("../kernel_utils/shared"),o=e("../webgl_util");function l(e){let{inputs:t,attrs:r,backend:n}=e,{axis:s}=r,{x:l}=t;(0,o.assertNotComplex)(l,"unique"),console.warn("WARNING: ","UI might be locked temporarily as data is being downloaded");let i=n.readSync(l.dataId),{outputValues:u,outputShape:p,indices:c}=(0,a.uniqueImplCPU)(i,s,l.shape,l.dtype);return[n.makeTensorInfo(p,l.dtype,u),n.makeTensorInfo([c.length],"int32",c)]}let i={kernelName:s.Unique,backendName:"webgl",kernelFunc:l}},{"@tensorflow/tfjs-core":"2nuhV","../kernel_utils/shared":"01kMd","../webgl_util":"90dxa","@parcel/transformer-js/src/esmodule-helpers.js":"9pCYc"}],epp5O:[function(e,t,r){/** * @license * Copyright 2020 Google LLC. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. * ============================================================================= */var n=e("@parcel/transformer-js/src/esmodule-helpers.js");n.defineInteropFlag(r),n.export(r,"unpack",()=>l),n.export(r,"unpackConfig",()=>i);var s=e("@tensorflow/tfjs-core"),a=e("./Reshape"),o=e("./Slice");function l(e){let{inputs:t,backend:r,attrs:n}=e,{value:s}=t,{axis:l}=n;l<0&&(l+=s.shape.length);let i=s.shape.length,u=s.shape[l],p=Array(i-1),c=0;for(let e=0;er.disposeIntermediateTensorInfo(e)),m}let i={kernelName:s.Unpack,backendName:"webgl",kernelFunc:l}},{"@tensorflow/tfjs-core":"2nuhV","./Reshape":"cgfGf","./Slice":"duMU0","@parcel/transformer-js/src/esmodule-helpers.js":"9pCYc"}],hLfLI:[function(e,t,r){/** * @license * Copyright 2020 Google LLC. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. * ============================================================================= */var n=e("@parcel/transformer-js/src/esmodule-helpers.js");n.defineInteropFlag(r),n.export(r,"unsortedSegmentSum",()=>p),n.export(r,"unsortedSegmentSumConfig",()=>c);var s=e("@tensorflow/tfjs-core"),a=e("../segment_gpu"),o=e("./Range"),l=e("./Reshape"),i=e("./Tile"),u=e("./Transpose");function p(e){let{inputs:t,backend:r,attrs:n}=e,{x:p,segmentIds:c}=t,{numSegments:d}=n,f=p.shape.length,h=[],m=0,g=(0,s.backend_util).getAxesPermutation([m],f),x=p;null!=g&&(x=(0,u.transpose)({inputs:{x:p},backend:r,attrs:{perm:g}}),h.push(x),m=(0,s.backend_util).getInnerMostAxes(1,f)[0]);let v=(0,s.backend_util).segment_util.computeOutShape(x.shape,m,d),y=(0,s.util).sizeFromShape([x.shape[m]]),b=(0,l.reshape)({inputs:{x:x},backend:r,attrs:{shape:[-1,y]}});h.push(b);let _=(0,s.sumOutType)(p.dtype),k=(e,t,n,l,u)=>{let p=e.shape[0],c=e.shape[1],d=(0,s.backend_util).segment_util.segOpComputeOptimalWindowSize(c,u),f=new a.SegmentOpProgram({windowSize:d,inSize:c,batchSize:p,numSegments:u},t),m=r.compileAndRun(f,[e,n],l);if(h.push(m),m.shape[1]===u)return m;let g=(0,o.range)({backend:r,attrs:{start:0,stop:u,step:1,dtype:"float32"}}),x=(0,i.tile)({inputs:{x:g},backend:r,attrs:{reps:[c/d]}});return h.push(g),h.push(x),k(m,t,x,l,u)},j=k(b,"unsortedSegmentSum",c,_,d),I=(0,l.reshape)({inputs:{x:j},backend:r,attrs:{shape:v}}),C=I;if(null!=g){h.push(I);let e=(0,s.backend_util).getUndoAxesPermutation(g);C=(0,u.transpose)({inputs:{x:C},backend:r,attrs:{perm:e}})}return h.forEach(e=>r.disposeIntermediateTensorInfo(e)),C}let c={kernelName:s.UnsortedSegmentSum,backendName:"webgl",kernelFunc:p}},{"@tensorflow/tfjs-core":"2nuhV","../segment_gpu":"ew1tG","./Range":"5XFt9","./Reshape":"cgfGf","./Tile":"f9YW6","./Transpose":"jIlsI","@parcel/transformer-js/src/esmodule-helpers.js":"9pCYc"}],ew1tG:[function(e,t,r){/** * @license * Copyright 2018 Google LLC. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. * ============================================================================= */var n=e("@parcel/transformer-js/src/esmodule-helpers.js");n.defineInteropFlag(r),n.export(r,"SegmentOpProgram",()=>s);class s{constructor(e,t){this.variableNames=["x","segmentIds"];let r=e.windowSize,n=e.batchSize,s=e.inSize,a=e.numSegments,o=a*Math.ceil(s/r);this.outputShape=[n,o];let l=4*Math.floor(r/4),i=r%4,u=` sumValue += dot(values, segFilter); `,p="";s%r>0&&(p=` if (inIdx< 0 || inIdx >= ${s}) { return initializationValue; } `);let c="";s%r>0&&(c=` if (inIdx< 0 || inIdx >= ${s}) { return -1.0; } `),this.userCode=` const float initializationValue = 0.0; float getValue(int batch, int inIdx) { ${p} return getX(batch, inIdx); } float getSegmentIdAtIndex(int inIdx) { ${c} return getSegmentIds(inIdx); } void main() { ivec2 coords = getOutputCoords(); int batch = coords[0]; int outIdx = coords[1]; int inOffset = int(floor(float(outIdx) / float( ${a})) * float(${r})); int currentSeg = int(mod(float(outIdx), float(${a}))); float sumValue = 0.0; for (int i = 0; i< ${l}; i += 4) { int inIdx = inOffset + i; vec4 values = vec4( getValue(batch, inIdx), getValue(batch, inIdx + 1), getValue(batch, inIdx + 2), getValue(batch, inIdx + 3) ); vec4 segFilter = vec4( int(getSegmentIdAtIndex(inIdx)) == currentSeg ? 1 : 0, int(getSegmentIdAtIndex(inIdx + 1)) == currentSeg ? 1 : 0, int(getSegmentIdAtIndex(inIdx + 2)) == currentSeg ? 1 : 0, int(getSegmentIdAtIndex(inIdx + 3)) == currentSeg ? 1 : 0 ); ${u} } int inIdx = inOffset + ${l}; if (${1===i}) { vec4 values = vec4( getValue(batch, inIdx), initializationValue, initializationValue, initializationValue ); int inIdxSeg = int(getSegmentIdAtIndex(inIdx)); vec4 segFilter = vec4( int(getSegmentIdAtIndex(inIdx)) == currentSeg ? 1 : 0, 0, 0, 0 ); ${u} } else if (${2===i}) { vec4 values = vec4( getValue(batch, inIdx), getValue(batch, inIdx + 1), initializationValue, initializationValue ); vec4 segFilter = vec4( int(getSegmentIdAtIndex(inIdx)) == currentSeg ? 1 : 0, int(getSegmentIdAtIndex(inIdx + 1)) == currentSeg ? 1 : 0, 0, 0 ); ${u} } else if (${3===i}) { vec4 values = vec4( getValue(batch, inIdx), getValue(batch, inIdx + 1), getValue(batch, inIdx + 2), initializationValue ); vec4 segFilter = vec4( int(getSegmentIdAtIndex(inIdx)) == currentSeg ? 1 : 0, int(getSegmentIdAtIndex(inIdx + 1)) == currentSeg ? 1 : 0, int(getSegmentIdAtIndex(inIdx + 2)) == currentSeg ? 1 : 0, 0 ); ${u} } setOutput(sumValue); } `}}},{"@parcel/transformer-js/src/esmodule-helpers.js":"9pCYc"}],"61SaF":[function(e,t,r){/** * @license * Copyright 2020 Google LLC. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. * ============================================================================= */var n=e("@parcel/transformer-js/src/esmodule-helpers.js");n.defineInteropFlag(r);var s=e("./base");n.exportAll(s,r),e("./register_all_kernels")},{"./base":"i3fvX","./register_all_kernels":"aLaZy","@parcel/transformer-js/src/esmodule-helpers.js":"9pCYc"}],i3fvX:[function(e,t,r){/** * @license * Copyright 2020 Google LLC. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. * ============================================================================= */var n=e("@parcel/transformer-js/src/esmodule-helpers.js");n.defineInteropFlag(r),n.export(r,"MathBackendCPU",()=>a.MathBackendCPU),n.export(r,"version_cpu",()=>l.version),n.export(r,"shared",()=>o);var s=e("@tensorflow/tfjs-core"),a=e("./backend_cpu"),o=e("./shared"),l=e("./version");(0,s.registerBackend)("cpu",()=>new a.MathBackendCPU,1)},{"@tensorflow/tfjs-core":"2nuhV","./backend_cpu":"cAIJJ","./shared":"kaeD0","./version":"gZtSu","@parcel/transformer-js/src/esmodule-helpers.js":"9pCYc"}],cAIJJ:[function(e,t,r){/** * @license * Copyright 2021 Google LLC. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. * ============================================================================= */var n=e("@parcel/transformer-js/src/esmodule-helpers.js");n.defineInteropFlag(r),n.export(r,"MathBackendCPU",()=>l);var s=e("@tensorflow/tfjs-core"),a=e("./cpu_util");let o=s.kernel_impls.whereImpl;class l extends s.KernelBackend{nextDataId(){return l.nextDataId++}constructor(){super(),this.blockSize=48,this.firstUse=!0,this.data=new s.DataStorage(this,(0,s.engine)())}write(e,t,r){this.firstUse&&(this.firstUse=!1,(0,s.env)().get("IS_NODE")&&(0,s.backend_util).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:r,refCount:1}),n}makeTensorInfo(e,t,r){let n;if("string"===t&&null!=r&&r.length>0&&(0,s.util).isString(r[0])){let a=r.map(e=>(0,s.util).encodeString(e));n=this.write(a,e,t)}else n=this.write(r,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,r,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:r}=this.data.get(e);if("complex64"===t){let e=this.readSync(r.real.dataId),t=this.readSync(r.imag.dataId);return(0,s.backend_util).mergeRealAndImagArrays(e,t)}return(0,s.util).convertBackendValuesAndArrayBuffer(this.data.get(e).values,t)}bufferSync(e){let t=this.readSync(e.dataId);if("string"===e.dtype)try{let r=t.map(e=>(0,s.util).decodeString(e));return(0,s.buffer)(e.shape,e.dtype,r)}catch(e){throw Error("Failed to decode encoded string bytes into utf-8")}return(0,s.buffer)(e.shape,e.dtype,t)}makeOutput(e,t,r){return(0,s.engine)().makeTensorFromTensorInfo(this.makeTensorInfo(t,r,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:r}=this.data.get(e);null!=r&&(this.disposeData(r.real.dataId,!0),this.disposeData(r.imag.dataId,!0)),this.data.delete(e)}return!0}disposeIntermediateTensorInfo(e){this.disposeData(e.dataId)}async time(e){let t=(0,s.util).now();return e(),{kernelMs:(0,s.util).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){(0,a.assertNotComplex)([e],"where");let t=this.readSync(e.dataId);return o(e.shape,t)}dispose(){}floatPrecision(){return 32}epsilon(){return super.epsilon()}}l.nextDataId=0},{"@tensorflow/tfjs-core":"2nuhV","./cpu_util":"f1aYU","@parcel/transformer-js/src/esmodule-helpers.js":"9pCYc"}],gZtSu:[function(e,t,r){/** @license See the LICENSE file. */var n=e("@parcel/transformer-js/src/esmodule-helpers.js");n.defineInteropFlag(r),n.export(r,"version",()=>s);let s="4.21.0"},{"@parcel/transformer-js/src/esmodule-helpers.js":"9pCYc"}],aLaZy:[function(e,t,r){/** * @license * Copyright 2020 Google LLC. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. * ============================================================================= */var n=e("@tensorflow/tfjs-core"),s=e("./kernels/_FusedMatMul"),a=e("./kernels/Abs"),o=e("./kernels/Acos"),l=e("./kernels/Acosh"),i=e("./kernels/Add"),u=e("./kernels/AddN"),p=e("./kernels/All"),c=e("./kernels/Any"),d=e("./kernels/ArgMax"),f=e("./kernels/ArgMin"),h=e("./kernels/Asin"),m=e("./kernels/Asinh"),g=e("./kernels/Atan"),x=e("./kernels/Atan2"),v=e("./kernels/Atanh"),y=e("./kernels/AvgPool"),b=e("./kernels/AvgPool3D"),_=e("./kernels/AvgPool3DGrad"),k=e("./kernels/AvgPoolGrad"),j=e("./kernels/BatchMatMul"),I=e("./kernels/BatchNorm"),C=e("./kernels/BatchToSpaceND"),w=e("./kernels/Bincount"),T=e("./kernels/BitwiseAnd"),S=e("./kernels/BroadcastArgs"),N=e("./kernels/Cast"),E=e("./kernels/Ceil"),F=e("./kernels/ClipByValue"),R=e("./kernels/Complex"),A=e("./kernels/ComplexAbs"),P=e("./kernels/Concat"),D=e("./kernels/Conv2D"),$=e("./kernels/Conv2DBackpropFilter"),M=e("./kernels/Conv2DBackpropInput"),O=e("./kernels/Conv3D"),V=e("./kernels/Conv3DBackpropFilterV2"),B=e("./kernels/Conv3DBackpropInputV2"),L=e("./kernels/Cos"),G=e("./kernels/Cosh"),z=e("./kernels/CropAndResize"),U=e("./kernels/Cumprod"),Y=e("./kernels/Cumsum"),W=e("./kernels/DenseBincount"),q=e("./kernels/DepthToSpace"),K=e("./kernels/DepthwiseConv2dNative"),H=e("./kernels/DepthwiseConv2dNativeBackpropFilter"),X=e("./kernels/DepthwiseConv2dNativeBackpropInput"),Q=e("./kernels/Diag"),J=e("./kernels/Dilation2D"),Z=e("./kernels/Dilation2DBackpropFilter"),ee=e("./kernels/Dilation2DBackpropInput"),et=e("./kernels/Draw"),er=e("./kernels/Einsum"),en=e("./kernels/Elu"),es=e("./kernels/EluGrad"),ea=e("./kernels/Equal"),eo=e("./kernels/Erf"),el=e("./kernels/Exp"),ei=e("./kernels/ExpandDims"),eu=e("./kernels/Expm1"),ep=e("./kernels/FFT"),ec=e("./kernels/Fill"),ed=e("./kernels/FlipLeftRight"),ef=e("./kernels/Floor"),eh=e("./kernels/FloorDiv"),em=e("./kernels/FusedConv2D"),eg=e("./kernels/FusedDepthwiseConv2D"),ex=e("./kernels/GatherNd"),ev=e("./kernels/GatherV2"),ey=e("./kernels/Greater"),eb=e("./kernels/GreaterEqual"),e_=e("./kernels/Identity"),ek=e("./kernels/IFFT"),ej=e("./kernels/Imag"),eI=e("./kernels/IsFinite"),eC=e("./kernels/IsInf"),ew=e("./kernels/IsNaN"),eT=e("./kernels/LeakyRelu"),eS=e("./kernels/Less"),eN=e("./kernels/LessEqual"),eE=e("./kernels/LinSpace"),eF=e("./kernels/Log"),eR=e("./kernels/Log1p"),eA=e("./kernels/LogicalAnd"),eP=e("./kernels/LogicalNot"),eD=e("./kernels/LogicalOr"),e$=e("./kernels/LRN"),eM=e("./kernels/LRNGrad"),eO=e("./kernels/Max"),eV=e("./kernels/Maximum"),eB=e("./kernels/MaxPool"),eL=e("./kernels/MaxPool3D"),eG=e("./kernels/MaxPool3DGrad"),ez=e("./kernels/MaxPoolGrad"),eU=e("./kernels/MaxPoolWithArgmax"),eY=e("./kernels/Mean"),eW=e("./kernels/Min"),eq=e("./kernels/Minimum"),eK=e("./kernels/MirrorPad"),eH=e("./kernels/Mod"),eX=e("./kernels/Multinomial"),eQ=e("./kernels/Multiply"),eJ=e("./kernels/Neg"),eZ=e("./kernels/NonMaxSuppressionV3"),e0=e("./kernels/NonMaxSuppressionV4"),e1=e("./kernels/NonMaxSuppressionV5"),e2=e("./kernels/NotEqual"),e3=e("./kernels/OneHot"),e4=e("./kernels/OnesLike"),e9=e("./kernels/Pack"),e6=e("./kernels/PadV2"),e5=e("./kernels/Pow"),e8=e("./kernels/Prelu"),e7=e("./kernels/Prod"),te=e("./kernels/RaggedGather"),tt=e("./kernels/RaggedRange"),tr=e("./kernels/RaggedTensorToTensor"),tn=e("./kernels/Range"),ts=e("./kernels/Real"),ta=e("./kernels/RealDiv"),to=e("./kernels/Reciprocal"),tl=e("./kernels/Relu"),ti=e("./kernels/Relu6"),tu=e("./kernels/Reshape"),tp=e("./kernels/ResizeBilinear"),tc=e("./kernels/ResizeBilinearGrad"),td=e("./kernels/ResizeNearestNeighbor"),tf=e("./kernels/ResizeNearestNeighborGrad"),th=e("./kernels/Reverse"),tm=e("./kernels/RotateWithOffset"),tg=e("./kernels/Round"),tx=e("./kernels/Rsqrt"),tv=e("./kernels/ScatterNd"),ty=e("./kernels/SearchSorted"),tb=e("./kernels/Select"),t_=e("./kernels/Selu"),tk=e("./kernels/Sigmoid"),tj=e("./kernels/Sign"),tI=e("./kernels/Sin"),tC=e("./kernels/Sinh"),tw=e("./kernels/Slice"),tT=e("./kernels/Softmax"),tS=e("./kernels/Softplus"),tN=e("./kernels/SpaceToBatchND"),tE=e("./kernels/SparseFillEmptyRows"),tF=e("./kernels/SparseReshape"),tR=e("./kernels/SparseSegmentMean"),tA=e("./kernels/SparseSegmentSum"),tP=e("./kernels/SparseToDense"),tD=e("./kernels/SplitV"),t$=e("./kernels/Sqrt"),tM=e("./kernels/Square"),tO=e("./kernels/SquaredDifference"),tV=e("./kernels/StaticRegexReplace"),tB=e("./kernels/Step"),tL=e("./kernels/StridedSlice"),tG=e("./kernels/StringNGrams"),tz=e("./kernels/StringSplit"),tU=e("./kernels/StringToHashBucketFast"),tY=e("./kernels/Sub"),tW=e("./kernels/Sum"),tq=e("./kernels/Tan"),tK=e("./kernels/Tanh"),tH=e("./kernels/TensorScatterUpdate"),tX=e("./kernels/Tile"),tQ=e("./kernels/TopK"),tJ=e("./kernels/Transform"),tZ=e("./kernels/Transpose"),t0=e("./kernels/Unique"),t1=e("./kernels/Unpack"),t2=e("./kernels/UnsortedSegmentSum"),t3=e("./kernels/ZerosLike");for(let e of[s._fusedMatMulConfig,a.absConfig,o.acosConfig,l.acoshConfig,i.addConfig,u.addNConfig,p.allConfig,c.anyConfig,d.argMaxConfig,f.argMinConfig,h.asinConfig,m.asinhConfig,g.atanConfig,x.atan2Config,v.atanhConfig,y.avgPoolConfig,b.avgPool3DConfig,_.avgPool3DGradConfig,k.avgPoolGradConfig,j.batchMatMulConfig,I.batchNormConfig,C.batchToSpaceNDConfig,w.bincountConfig,T.bitwiseAndConfig,S.broadcastArgsConfig,N.castConfig,E.ceilConfig,F.clipByValueConfig,R.complexConfig,A.complexAbsConfig,P.concatConfig,D.conv2DConfig,$.conv2DBackpropFilterConfig,M.conv2DBackpropInputConfig,O.conv3DConfig,V.conv3DBackpropFilterV2Config,B.conv3DBackpropInputV2Config,L.cosConfig,G.coshConfig,z.cropAndResizeConfig,U.cumprodConfig,Y.cumsumConfig,W.denseBincountConfig,q.depthToSpaceConfig,K.depthwiseConv2dNativeConfig,H.depthwiseConv2dNativeBackpropFilterConfig,X.depthwiseConv2dNativeBackpropInputConfig,Q.diagConfig,J.dilation2DConfig,Z.dilation2DBackpropFilterConfig,ee.dilation2DBackpropInputConfig,et.drawConfig,er.einsumConfig,en.eluConfig,es.eluGradConfig,ea.equalConfig,eo.erfConfig,el.expConfig,ei.expandDimsConfig,eu.expm1Config,ep.fftConfig,ec.fillConfig,ed.flipLeftRightConfig,ef.floorConfig,eh.floorDivConfig,em.fusedConv2DConfig,eg.fusedDepthwiseConv2DConfig,ex.gatherNdConfig,ev.gatherV2Config,ey.greaterConfig,eb.greaterEqualConfig,e_.identityConfig,ek.ifftConfig,ej.imagConfig,eI.isFiniteConfig,eC.isInfConfig,ew.isNaNConfig,eT.leakyReluConfig,eS.lessConfig,eN.lessEqualConfig,eE.linSpaceConfig,eF.logConfig,eR.log1pConfig,eA.logicalAndConfig,eP.logicalNotConfig,eD.logicalOrConfig,e$.LRNConfig,eM.LRNGradConfig,eO.maxConfig,eV.maximumConfig,eB.maxPoolConfig,eL.maxPool3DConfig,eG.maxPool3DGradConfig,ez.maxPoolGradConfig,eU.maxPoolWithArgmaxConfig,eY.meanConfig,eW.minConfig,eq.minimumConfig,eK.mirrorPadConfig,eH.modConfig,eX.multinomialConfig,eQ.multiplyConfig,eJ.negConfig,eZ.nonMaxSuppressionV3Config,e0.nonMaxSuppressionV4Config,e1.nonMaxSuppressionV5Config,e2.notEqualConfig,e3.oneHotConfig,e4.onesLikeConfig,e9.packConfig,e6.padV2Config,e5.powConfig,e8.preluConfig,e7.prodConfig,te.raggedGatherConfig,tt.raggedRangeConfig,tr.raggedTensorToTensorConfig,tn.rangeConfig,ts.realConfig,ta.realDivConfig,to.reciprocalConfig,tl.reluConfig,ti.relu6Config,tu.reshapeConfig,tp.resizeBilinearConfig,tc.resizeBilinearGradConfig,td.resizeNearestNeighborConfig,tf.resizeNearestNeighborGradConfig,th.reverseConfig,tm.rotateWithOffsetConfig,tg.roundConfig,tx.rsqrtConfig,tv.scatterNdConfig,ty.searchSortedConfig,tb.selectConfig,t_.seluConfig,tk.sigmoidConfig,tj.signConfig,tI.sinConfig,tC.sinhConfig,tw.sliceConfig,tT.softmaxConfig,tS.softplusConfig,tN.spaceToBatchNDConfig,tE.sparseFillEmptyRowsConfig,tF.sparseReshapeConfig,tR.sparseSegmentMeanConfig,tA.sparseSegmentSumConfig,tP.sparseToDenseConfig,tD.splitVConfig,t$.sqrtConfig,tM.squareConfig,tO.squaredDifferenceConfig,tV.staticRegexReplaceConfig,tB.stepConfig,tL.stridedSliceConfig,tG.stringNGramsConfig,tz.stringSplitConfig,tU.stringToHashBucketFastConfig,tY.subConfig,tW.sumConfig,tq.tanConfig,tK.tanhConfig,tH.tensorScatterUpdateConfig,tX.tileConfig,tQ.topKConfig,tJ.transformConfig,tZ.transposeConfig,t0.uniqueConfig,t1.unpackConfig,t2.unsortedSegmentSumConfig,t3.zerosLikeConfig])(0,n.registerKernel)(e)},{"@tensorflow/tfjs-core":"2nuhV","./kernels/_FusedMatMul":"4l6uJ","./kernels/Abs":"hFqOq","./kernels/Acos":"2ny6x","./kernels/Acosh":"jrC3O","./kernels/Add":"6fWFl","./kernels/AddN":"1v8fN","./kernels/All":"6MIOr","./kernels/Any":"5y9pn","./kernels/ArgMax":"jKZLy","./kernels/ArgMin":"aGAg7","./kernels/Asin":"5u8in","./kernels/Asinh":"cG55Q","./kernels/Atan":"53b7b","./kernels/Atan2":"2k648","./kernels/Atanh":"2Y75m","./kernels/AvgPool":"bVsq2","./kernels/AvgPool3D":"4J7Gs","./kernels/AvgPool3DGrad":"98tXR","./kernels/AvgPoolGrad":"3Ej5P","./kernels/BatchMatMul":"7eeNf","./kernels/BatchNorm":"WD35y","./kernels/BatchToSpaceND":"6GDOZ","./kernels/Bincount":"U2WzW","./kernels/BitwiseAnd":"iYAYZ","./kernels/BroadcastArgs":"jrQyX","./kernels/Cast":"ep8e6","./kernels/Ceil":"5zveO","./kernels/ClipByValue":"egZ9z","./kernels/Complex":"6RuMJ","./kernels/ComplexAbs":"DuThr","./kernels/Concat":"h4dlo","./kernels/Conv2D":"b06OB","./kernels/Conv2DBackpropFilter":"9k9UH","./kernels/Conv2DBackpropInput":"6I2GX","./kernels/Conv3D":"iwIiA","./kernels/Conv3DBackpropFilterV2":"aWFBv","./kernels/Conv3DBackpropInputV2":"huxof","./kernels/Cos":"bNEfW","./kernels/Cosh":"6aYaE","./kernels/CropAndResize":"504Rj","./kernels/Cumprod":"ko27E","./kernels/Cumsum":"dxJRP","./kernels/DenseBincount":"f1J3g","./kernels/DepthToSpace":"2ikJi","./kernels/DepthwiseConv2dNative":"fKbnx","./kernels/DepthwiseConv2dNativeBackpropFilter":"bV8Mu","./kernels/DepthwiseConv2dNativeBackpropInput":"kcvDF","./kernels/Diag":"7Hc3t","./kernels/Dilation2D":"lD82Q","./kernels/Dilation2DBackpropFilter":"6i1Hx","./kernels/Dilation2DBackpropInput":"gvsQI","./kernels/Draw":"cAJH9","./kernels/Einsum":"cjihf","./kernels/Elu":"5kSYg","./kernels/EluGrad":"fN4zg","./kernels/Equal":"cApXD","./kernels/Erf":"gbqjv","./kernels/Exp":"7zaJk","./kernels/ExpandDims":"aVhKw","./kernels/Expm1":"gvpte","./kernels/FFT":"azsZX","./kernels/Fill":"8pfO7","./kernels/FlipLeftRight":"h04Zu","./kernels/Floor":"jQTXs","./kernels/FloorDiv":"40JHE","./kernels/FusedConv2D":"iD06f","./kernels/FusedDepthwiseConv2D":"7ycc0","./kernels/GatherNd":"4VTUV","./kernels/GatherV2":"eJm0s","./kernels/Greater":"fz1zC","./kernels/GreaterEqual":"blrhL","./kernels/Identity":"3hjd4","./kernels/IFFT":"1uE0o","./kernels/Imag":"9zot5","./kernels/IsFinite":"aqQMH","./kernels/IsInf":"g2EK8","./kernels/IsNaN":"h4RGv","./kernels/LeakyRelu":"7UgAl","./kernels/Less":"6Z0Og","./kernels/LessEqual":"2Wkg5","./kernels/LinSpace":"dM2R3","./kernels/Log":"7TObE","./kernels/Log1p":"hpigD","./kernels/LogicalAnd":"WRKR9","./kernels/LogicalNot":"4wBtc","./kernels/LogicalOr":"9D8dO","./kernels/LRN":"iib5B","./kernels/LRNGrad":"51yn4","./kernels/Max":"jPGdn","./kernels/Maximum":"9MgzM","./kernels/MaxPool":"lrtop","./kernels/MaxPool3D":"4r8Fk","./kernels/MaxPool3DGrad":"go6gx","./kernels/MaxPoolGrad":"03sl0","./kernels/MaxPoolWithArgmax":"38wrk","./kernels/Mean":"51tNr","./kernels/Min":"dYXE0","./kernels/Minimum":"bIhZ4","./kernels/MirrorPad":"8CRj4","./kernels/Mod":"6DvQH","./kernels/Multinomial":"53zSQ","./kernels/Multiply":"k52uJ","./kernels/Neg":"1Innr","./kernels/NonMaxSuppressionV3":"8sxFg","./kernels/NonMaxSuppressionV4":"2RfCD","./kernels/NonMaxSuppressionV5":"2rre1","./kernels/NotEqual":"8Jfov","./kernels/OneHot":"4EvPs","./kernels/OnesLike":"ammAw","./kernels/Pack":"gf163","./kernels/PadV2":"98BL8","./kernels/Pow":"3z4q1","./kernels/Prelu":"dSiXT","./kernels/Prod":"kTBVD","./kernels/RaggedGather":"1OBpL","./kernels/RaggedRange":"czVpb","./kernels/RaggedTensorToTensor":"eI5aC","./kernels/Range":"de0wV","./kernels/Real":"fn30c","./kernels/RealDiv":"7Xr44","./kernels/Reciprocal":"8xR15","./kernels/Relu":"a8Bel","./kernels/Relu6":"gDl6J","./kernels/Reshape":"dPbEE","./kernels/ResizeBilinear":"cUNUK","./kernels/ResizeBilinearGrad":"hmGRx","./kernels/ResizeNearestNeighbor":"2gdVF","./kernels/ResizeNearestNeighborGrad":"dqNrs","./kernels/Reverse":"axIGZ","./kernels/RotateWithOffset":"caMVV","./kernels/Round":"l1MIi","./kernels/Rsqrt":"59k7y","./kernels/ScatterNd":"7HK94","./kernels/SearchSorted":"1BUte","./kernels/Select":"4W3fp","./kernels/Selu":"iBoo2","./kernels/Sigmoid":"foyl4","./kernels/Sign":"79sfz","./kernels/Sin":"91XEC","./kernels/Sinh":"3XxSk","./kernels/Slice":"loZC8","./kernels/Softmax":"9tt7H","./kernels/Softplus":"9VyDT","./kernels/SpaceToBatchND":"5juQa","./kernels/SparseFillEmptyRows":"bYo4w","./kernels/SparseReshape":"cUix9","./kernels/SparseSegmentMean":"f9b7f","./kernels/SparseSegmentSum":"6hEAP","./kernels/SparseToDense":"9Ntuz","./kernels/SplitV":"3dfoP","./kernels/Sqrt":"2h5qI","./kernels/Square":"lkA36","./kernels/SquaredDifference":"h63Nj","./kernels/StaticRegexReplace":"6gC9H","./kernels/Step":"1YuwC","./kernels/StridedSlice":"6Yrik","./kernels/StringNGrams":"coUv2","./kernels/StringSplit":"fg2js","./kernels/StringToHashBucketFast":"jslcv","./kernels/Sub":"7SQVx","./kernels/Sum":"dI67n","./kernels/Tan":"70kuo","./kernels/Tanh":"3H0jA","./kernels/TensorScatterUpdate":"56hl0","./kernels/Tile":"iWTrW","./kernels/TopK":"2o4cv","./kernels/Transform":"1hC97","./kernels/Transpose":"4kskA","./kernels/Unique":"6EJ46","./kernels/Unpack":"bgyoS","./kernels/UnsortedSegmentSum":"9PpyA","./kernels/ZerosLike":"glvsx"}],"4l6uJ":[function(e,t,r){/** * @license * Copyright 2020 Google LLC. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the License); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an AS IS BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. * ============================================================================= */var n=e("@parcel/transformer-js/src/esmodule-helpers.js");n.defineInteropFlag(r),n.export(r,"_fusedMatMul",()=>i),n.export(r,"_fusedMatMulConfig",()=>u);var s=e("@tensorflow/tfjs-core"),a=e("../utils/fused_utils"),o=e("./Add"),l=e("./BatchMatMul");function i(e){let t,r,n;let{inputs:s,backend:i,attrs:u}=e,{a:p,b:c,bias:d,preluActivationWeights:f}=s,{transposeA:h,transposeB:m,activation:g,leakyreluAlpha:x}=u,v=[];for(let e of(t=(0,l.batchMatMul)({inputs:{a:p,b:c},attrs:{transposeA:h,transposeB:m},backend:i}),d&&(r=(0,o.add)({inputs:{a:t,b:d},backend:i}),v.push(t),t=r),g&&(n=(0,a.applyActivation)(i,t,g,f,x),v.push(t),t=n),v))i.disposeIntermediateTensorInfo(e);return t}let u={kernelName:s._FusedMatMul,backendName:"cpu",kernelFunc:i}},{"@tensorflow/tfjs-core":"2nuhV","../utils/fused_utils":"93hhz","./Add":"6fWFl","./BatchMatMul":"7eeNf","@parcel/transformer-js/src/esmodule-helpers.js":"9pCYc"}],"93hhz":[function(e,t,r){/** * @license * Copyright 2020 Google LLC. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. * ============================================================================= */var n=e("@parcel/transformer-js/src/esmodule-helpers.js");n.defineInteropFlag(r),n.export(r,"applyActivation",()=>c);var s=e("../kernels/Elu"),a=e("../kernels/Identity"),o=e("../kernels/LeakyRelu"),l=e("../kernels/Prelu"),i=e("../kernels/Relu"),u=e("../kernels/Relu6"),p=e("../kernels/Sigmoid");function c(e,t,r,n,c){if("linear"===r)return(0,a.identity)({inputs:{x:t},backend:e});if("relu"===r)return(0,i.relu)({inputs:{x:t},backend:e});if("elu"===r)return(0,s.elu)({inputs:{x:t},backend:e});if("relu6"===r)return(0,u.relu6)({inputs:{x:t},backend:e});if("prelu"===r)return(0,l.prelu)({inputs:{x:t,alpha:n},backend:e});if("leakyrelu"===r)return(0,o.leakyRelu)({inputs:{x:t},backend:e,attrs:{alpha:c}});if("sigmoid"===r)return(0,p.sigmoid)({inputs:{x:t},backend:e});throw Error(`Activation ${r} has not been implemented for the CPU backend.`)}},{"../kernels/Elu":"5kSYg","../kernels/Identity":"3hjd4","../kernels/LeakyRelu":"7UgAl","../kernels/Prelu":"dSiXT","../kernels/Relu":"a8Bel","../kernels/Relu6":"gDl6J","../kernels/Sigmoid":"foyl4","@parcel/transformer-js/src/esmodule-helpers.js":"9pCYc"}],"5kSYg":[function(e,t,r){/** * @license * Copyright 2020 Google LLC. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the License); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an AS IS BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. * ============================================================================= */var n=e("@parcel/transformer-js/src/esmodule-helpers.js");n.defineInteropFlag(r),n.export(r,"elu",()=>a),n.export(r,"eluConfig",()=>o);var s=e("@tensorflow/tfjs-core");let a=(0,e("../utils/unary_utils").unaryKernelFunc)(s.Elu,e=>e>=0?e:Math.exp(e)-1),o={kernelName:s.Elu,backendName:"cpu",kernelFunc:a}},{"@tensorflow/tfjs-core":"2nuhV","../utils/unary_utils":"i8gKT","@parcel/transformer-js/src/esmodule-helpers.js":"9pCYc"}],"7UgAl":[function(e,t,r){/** * @license * Copyright 2020 Google LLC. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. * ============================================================================= */var n=e("@parcel/transformer-js/src/esmodule-helpers.js");n.defineInteropFlag(r),n.export(r,"leakyRelu",()=>o),n.export(r,"leakyReluConfig",()=>l);var s=e("@tensorflow/tfjs-core"),a=e("../cpu_util");function o(e){let{inputs:t,backend:r,attrs:n}=e,{x:o}=t,{alpha:l}=n;(0,a.assertNotComplex)([o],"leakyRelu");let i=(0,s.util).sizeFromShape(o.shape),u=r.data.get(o.dataId).values,p=(0,s.util).getTypedArrayFromDType("float32",i);for(let e=0;el),n.export(r,"preluConfig",()=>i);var s=e("@tensorflow/tfjs-core"),a=e("../cpu_util");let o=(0,e("../utils/binary_impl").createSimpleBinaryKernelImpl)((e,t)=>e<0?t*e:e);function l(e){let{inputs:t,backend:r}=e,{x:n,alpha:s}=t;(0,a.assertNotComplex)([n,s],"prelu");let l=r.data.get(n.dataId).values,i=r.data.get(s.dataId).values,[u,p]=o(n.shape,s.shape,l,i,"float32");return r.makeTensorInfo(p,"float32",u)}let i={kernelName:s.Prelu,backendName:"cpu",kernelFunc:l}},{"@tensorflow/tfjs-core":"2nuhV","../cpu_util":"f1aYU","../utils/binary_impl":"8pFjz","@parcel/transformer-js/src/esmodule-helpers.js":"9pCYc"}],a8Bel:[function(e,t,r){/** * @license * Copyright 2020 Google LLC. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the License); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an AS IS BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. * ============================================================================= */var n=e("@parcel/transformer-js/src/esmodule-helpers.js");n.defineInteropFlag(r),n.export(r,"relu",()=>a),n.export(r,"reluConfig",()=>o);var s=e("@tensorflow/tfjs-core");let a=(0,e("../utils/unary_utils").unaryKernelFunc)(s.Relu,e=>Math.max(0,e)),o={kernelName:s.Relu,backendName:"cpu",kernelFunc:a}},{"@tensorflow/tfjs-core":"2nuhV","../utils/unary_utils":"i8gKT","@parcel/transformer-js/src/esmodule-helpers.js":"9pCYc"}],gDl6J:[function(e,t,r){/** * @license * Copyright 2020 Google LLC. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the License); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an AS IS BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. * ============================================================================= */var n=e("@parcel/transformer-js/src/esmodule-helpers.js");n.defineInteropFlag(r),n.export(r,"relu6",()=>a),n.export(r,"relu6Config",()=>o);var s=e("@tensorflow/tfjs-core");let a=(0,e("../utils/unary_utils").unaryKernelFunc)(s.Relu6,e=>Math.min(Math.max(0,e),6)),o={kernelName:s.Relu6,backendName:"cpu",kernelFunc:a}},{"@tensorflow/tfjs-core":"2nuhV","../utils/unary_utils":"i8gKT","@parcel/transformer-js/src/esmodule-helpers.js":"9pCYc"}],"7eeNf":[function(e,t,r){/** * @license * Copyright 2020 Google LLC. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the License); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an AS IS BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. * ============================================================================= */var n=e("@parcel/transformer-js/src/esmodule-helpers.js");n.defineInteropFlag(r),n.export(r,"batchMatMul",()=>l),n.export(r,"batchMatMulConfig",()=>i);var s=e("@tensorflow/tfjs-core"),a=e("../cpu_util"),o=e("./Reshape");function l(e){let{inputs:t,backend:r,attrs:n}=e,{a:l,b:i}=t,{transposeA:u,transposeB:p}=n;(0,a.assertNotComplex)([l,i],"matMul");let c=l.shape.length,d=i.shape.length,f=u?l.shape[c-2]:l.shape[c-1],h=p?i.shape[d-1]:i.shape[d-2],m=u?l.shape[c-1]:l.shape[c-2],g=p?i.shape[d-2]:i.shape[d-1],x=l.shape.slice(0,-2),v=i.shape.slice(0,-2),y=(0,s.util).sizeFromShape(x),b=(0,s.util).sizeFromShape(v),_=(0,s.broadcast_util).assertAndGetBroadcastShape(l.shape.slice(0,-2),i.shape.slice(0,-2)).concat([m,g]);(0,s.util).assert(f===h,()=>`Error in matMul: inner shapes (${f}) and (${h}) of Tensors with shapes ${l.shape} and ${i.shape} and transposeA=${u} and transposeB=${p} must match.`);let k=(0,o.reshape)({inputs:{x:l},backend:r,attrs:{shape:u?[y,f,m]:[y,m,f]}}),j=(0,o.reshape)({inputs:{x:i},backend:r,attrs:{shape:p?[b,g,h]:[b,h,g]}}),I=u?k.shape[1]:k.shape[2],C=u?k.shape[2]:k.shape[1],w=p?j.shape[1]:j.shape[2],T=Math.max(y,b),S=r.data.get(k.dataId).values,N=r.data.get(j.dataId).values,E=(0,s.util).computeStrides(k.shape),F=(0,s.util).computeStrides(j.shape),[R,A,P]=u?[E[0],1,E[1]]:[E[0],E[1],1],[D,$,M]=p?[1,F[1],F[0]]:[F[1],1,F[0]],O=C*w,V=(0,s.buffer)([T,C,w],k.dtype),B=V.values,L=r.blockSize;for(let e=0;ea),n.export(r,"reshapeConfig",()=>o);var s=e("@tensorflow/tfjs-core");function a(e){let{inputs:t,backend:r,attrs:n}=e,{x:a}=t,{shape:o}=n,l=(0,s.util).sizeFromShape(a.shape),i=(0,s.util).inferFromImplicitShape(o,l),u=(0,s.util).sizeFromShape(i);(0,s.util).assert(l===u,()=>`The new shape (${i}) has ${u} elements and the old shape (${a.shape}) has ${l} elements. The new shape and old shape must have the same number of elements.`),r.incRef(a.dataId);let p=r.data.get(a.dataId);if(null!=p.complexTensorInfos){let e=p.complexTensorInfos.real,t=p.complexTensorInfos.imag;e.shape=i,t.shape=i}return{dataId:a.dataId,shape:i,dtype:a.dtype}}let o={kernelName:s.Reshape,backendName:"cpu",kernelFunc:a}},{"@tensorflow/tfjs-core":"2nuhV","@parcel/transformer-js/src/esmodule-helpers.js":"9pCYc"}],"2ny6x":[function(e,t,r){/** * @license * Copyright 2020 Google LLC. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the License); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an AS IS BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. * ============================================================================= */var n=e("@parcel/transformer-js/src/esmodule-helpers.js");n.defineInteropFlag(r),n.export(r,"acos",()=>a),n.export(r,"acosConfig",()=>o);var s=e("@tensorflow/tfjs-core");let a=(0,e("../utils/unary_utils").unaryKernelFunc)(s.Acos,e=>Math.acos(e)),o={kernelName:s.Acos,backendName:"cpu",kernelFunc:a}},{"@tensorflow/tfjs-core":"2nuhV","../utils/unary_utils":"i8gKT","@parcel/transformer-js/src/esmodule-helpers.js":"9pCYc"}],jrC3O:[function(e,t,r){/** * @license * Copyright 2020 Google LLC. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the License); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an AS IS BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. * ============================================================================= */var n=e("@parcel/transformer-js/src/esmodule-helpers.js");n.defineInteropFlag(r),n.export(r,"acosh",()=>a),n.export(r,"acoshConfig",()=>o);var s=e("@tensorflow/tfjs-core");let a=(0,e("../utils/unary_utils").unaryKernelFunc)(s.Acosh,e=>Math.acosh(e)),o={kernelName:s.Acosh,backendName:"cpu",kernelFunc:a}},{"@tensorflow/tfjs-core":"2nuhV","../utils/unary_utils":"i8gKT","@parcel/transformer-js/src/esmodule-helpers.js":"9pCYc"}],"1v8fN":[function(e,t,r){/** * @license * Copyright 2020 Google LLC. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. * ============================================================================= */var n=e("@parcel/transformer-js/src/esmodule-helpers.js");n.defineInteropFlag(r),n.export(r,"addN",()=>o),n.export(r,"addNConfig",()=>l);var s=e("@tensorflow/tfjs-core"),a=e("../cpu_util");function o(e){let{inputs:t,backend:r}=e;(0,a.assertNotComplex)(t,"addN");let n=t.map(e=>r.data.get(e.dataId).values),o=(0,s.buffer)(t[0].shape,t[0].dtype),l=o.values;for(let e=0;ei),n.export(r,"allConfig",()=>u);var s=e("@tensorflow/tfjs-core"),a=e("../cpu_util"),o=e("./Reshape"),l=e("./Transpose");function i(e){let{inputs:t,backend:r,attrs:n}=e,{x:i}=t,{axis:u,keepDims:p}=n;(0,a.assertNotComplex)(i,"all");let c=(0,s.util).parseAxisParam(u,i.shape),d=c,f=(0,s.backend_util).getAxesPermutation(d,i.shape.length),h=i;null!=f&&(h=(0,l.transpose)({inputs:{x:i},backend:r,attrs:{perm:f}}),d=(0,s.backend_util).getInnerMostAxes(d.length,i.shape.length)),(0,s.backend_util).assertAxesAreInnerMostDims("all",d,h.shape.length);let[m,g]=(0,s.backend_util).computeOutAndReduceShapes(h.shape,d),x=(0,s.util).sizeFromShape(g),v=(0,s.util).makeZerosTypedArray((0,s.util).sizeFromShape(m),h.dtype),y=r.data.get(h.dataId).values;for(let e=0;ei),n.export(r,"anyConfig",()=>u);var s=e("@tensorflow/tfjs-core"),a=e("../cpu_util"),o=e("./Reshape"),l=e("./Transpose");function i(e){let{inputs:t,backend:r,attrs:n}=e,{x:i}=t,{axis:u,keepDims:p}=n;(0,a.assertNotComplex)(i,"any");let c=(0,s.util).parseAxisParam(u,i.shape),d=c,f=(0,s.backend_util).getAxesPermutation(d,i.shape.length),h=i;null!=f&&(h=(0,l.transpose)({inputs:{x:i},backend:r,attrs:{perm:f}}),d=(0,s.backend_util).getInnerMostAxes(d.length,i.shape.length)),(0,s.backend_util).assertAxesAreInnerMostDims("any",d,h.shape.length);let[m,g]=(0,s.backend_util).computeOutAndReduceShapes(h.shape,d),x=(0,s.util).sizeFromShape(g),v=(0,s.util).makeZerosTypedArray((0,s.util).sizeFromShape(m),h.dtype),y=r.data.get(h.dataId).values;for(let e=0;el),n.export(r,"argMaxConfig",()=>i);var s=e("@tensorflow/tfjs-core"),a=e("../cpu_util"),o=e("./Transpose");function l(e){let{inputs:t,backend:r,attrs:n}=e,{x:l}=t,{axis:i}=n;(0,a.assertNotComplex)(l,"argMax");let u=(0,s.util).parseAxisParam(i,l.shape),p=(0,s.backend_util).getAxesPermutation(u,l.shape.length),c=l,d=[];null!=p&&(d.push(c=(0,o.transpose)({inputs:{x:l},backend:r,attrs:{perm:p}})),u=(0,s.backend_util).getInnerMostAxes(u.length,c.shape.length)),u=[u[0]],(0,s.backend_util).assertAxesAreInnerMostDims("argMax",u,c.shape.length);let[f,h]=(0,s.backend_util).computeOutAndReduceShapes(c.shape,u),m=(0,s.util).sizeFromShape(f),g=(0,s.util).makeZerosTypedArray(m,"int32"),x=(0,s.util).sizeFromShape(h),v=r.data.get(c.dataId).values;for(let e=0;er&&(r=s,n=e)}g[e]=n}return d.forEach(e=>r.disposeIntermediateTensorInfo(e)),r.makeTensorInfo(f,"int32",g)}let i={kernelName:s.ArgMax,backendName:"cpu",kernelFunc:l}},{"@tensorflow/tfjs-core":"2nuhV","../cpu_util":"f1aYU","./Transpose":"4kskA","@parcel/transformer-js/src/esmodule-helpers.js":"9pCYc"}],aGAg7:[function(e,t,r){/** * @license * Copyright 2020 Google LLC. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. * ============================================================================= */var n=e("@parcel/transformer-js/src/esmodule-helpers.js");n.defineInteropFlag(r),n.export(r,"argMin",()=>l),n.export(r,"argMinConfig",()=>i);var s=e("@tensorflow/tfjs-core"),a=e("../cpu_util"),o=e("./Transpose");function l(e){let{inputs:t,backend:r,attrs:n}=e,{x:l}=t,{axis:i}=n;(0,a.assertNotComplex)(l,"argMin");let u=(0,s.util).parseAxisParam(i,l.shape),p=(0,s.backend_util).getAxesPermutation(u,l.shape.length),c=l,d=[];null!=p&&(d.push(c=(0,o.transpose)({inputs:{x:l},backend:r,attrs:{perm:p}})),u=(0,s.backend_util).getInnerMostAxes(u.length,c.shape.length)),u=[u[0]],(0,s.backend_util).assertAxesAreInnerMostDims("argMin",u,c.shape.length);let[f,h]=(0,s.backend_util).computeOutAndReduceShapes(c.shape,u),m=(0,s.util).sizeFromShape(f),g=(0,s.util).makeZerosTypedArray(m,"int32"),x=(0,s.util).sizeFromShape(h),v=r.data.get(c.dataId).values;for(let e=0;er.disposeIntermediateTensorInfo(e)),r.makeTensorInfo(f,"int32",g)}let i={kernelName:s.ArgMin,backendName:"cpu",kernelFunc:l}},{"@tensorflow/tfjs-core":"2nuhV","../cpu_util":"f1aYU","./Transpose":"4kskA","@parcel/transformer-js/src/esmodule-helpers.js":"9pCYc"}],"5u8in":[function(e,t,r){/** * @license * Copyright 2020 Google LLC. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the License); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an AS IS BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. * ============================================================================= */var n=e("@parcel/transformer-js/src/esmodule-helpers.js");n.defineInteropFlag(r),n.export(r,"asin",()=>a),n.export(r,"asinConfig",()=>o);var s=e("@tensorflow/tfjs-core");let a=(0,e("../utils/unary_utils").unaryKernelFunc)(s.Asin,e=>Math.asin(e)),o={kernelName:s.Asin,backendName:"cpu",kernelFunc:a}},{"@tensorflow/tfjs-core":"2nuhV","../utils/unary_utils":"i8gKT","@parcel/transformer-js/src/esmodule-helpers.js":"9pCYc"}],cG55Q:[function(e,t,r){/** * @license * Copyright 2020 Google LLC. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the License); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an AS IS BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. * ============================================================================= */var n=e("@parcel/transformer-js/src/esmodule-helpers.js");n.defineInteropFlag(r),n.export(r,"asinh",()=>a),n.export(r,"asinhConfig",()=>o);var s=e("@tensorflow/tfjs-core");let a=(0,e("../utils/unary_utils").unaryKernelFunc)(s.Asinh,e=>Math.asinh(e)),o={kernelName:s.Asinh,backendName:"cpu",kernelFunc:a}},{"@tensorflow/tfjs-core":"2nuhV","../utils/unary_utils":"i8gKT","@parcel/transformer-js/src/esmodule-helpers.js":"9pCYc"}],"53b7b":[function(e,t,r){/** * @license * Copyright 2020 Google LLC. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the License); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an AS IS BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. * ============================================================================= */var n=e("@parcel/transformer-js/src/esmodule-helpers.js");n.defineInteropFlag(r),n.export(r,"atan",()=>a),n.export(r,"atanConfig",()=>o);var s=e("@tensorflow/tfjs-core");let a=(0,e("../utils/unary_utils").unaryKernelFunc)(s.Atan,e=>Math.atan(e)),o={kernelName:s.Atan,backendName:"cpu",kernelFunc:a}},{"@tensorflow/tfjs-core":"2nuhV","../utils/unary_utils":"i8gKT","@parcel/transformer-js/src/esmodule-helpers.js":"9pCYc"}],"2k648":[function(e,t,r){/** * @license * Copyright 2020 Google LLC. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the License); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an AS IS BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. * ============================================================================= */var n=e("@parcel/transformer-js/src/esmodule-helpers.js");n.defineInteropFlag(r),n.export(r,"atan2Impl",()=>l),n.export(r,"atan2",()=>i),n.export(r,"atan2Config",()=>u);var s=e("@tensorflow/tfjs-core"),a=e("../utils/binary_impl"),o=e("../utils/binary_utils");let l=(0,a.createSimpleBinaryKernelImpl)((e,t)=>Math.atan2(e,t)),i=(0,o.binaryKernelFunc)(s.Atan2,l),u={kernelName:s.Atan2,backendName:"cpu",kernelFunc:i}},{"@tensorflow/tfjs-core":"2nuhV","../utils/binary_impl":"8pFjz","../utils/binary_utils":"8GweL","@parcel/transformer-js/src/esmodule-helpers.js":"9pCYc"}],"2Y75m":[function(e,t,r){/** * @license * Copyright 2020 Google LLC. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the License); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an AS IS BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. * ============================================================================= */var n=e("@parcel/transformer-js/src/esmodule-helpers.js");n.defineInteropFlag(r),n.export(r,"atanh",()=>a),n.export(r,"atanhConfig",()=>o);var s=e("@tensorflow/tfjs-core");let a=(0,e("../utils/unary_utils").unaryKernelFunc)(s.Atanh,e=>Math.atanh(e)),o={kernelName:s.Atanh,backendName:"cpu",kernelFunc:a}},{"@tensorflow/tfjs-core":"2nuhV","../utils/unary_utils":"i8gKT","@parcel/transformer-js/src/esmodule-helpers.js":"9pCYc"}],bVsq2:[function(e,t,r){/** * @license * Copyright 2020 Google LLC. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. * ============================================================================= */var n=e("@parcel/transformer-js/src/esmodule-helpers.js");n.defineInteropFlag(r),n.export(r,"avgPool",()=>i),n.export(r,"avgPoolConfig",()=>u);var s=e("@tensorflow/tfjs-core"),a=e("../cpu_util"),o=e("../utils/pool_utils"),l=e("./Identity");function i(e){let t;let{inputs:r,backend:n,attrs:i}=e,{x:u}=r;(0,a.assertNotComplex)(u,"avgPool");let{filterSize:p,strides:c,pad:d,dimRoundingMode:f}=i;(0,s.util).assert((0,s.backend_util).eitherStridesOrDilationsAreOne(c,1),()=>`Error in avgPool: Either strides or dilations must be 1. Got strides ${c} and dilations '1'`);let h=(0,s.backend_util).computePool2DInfo(u.shape,p,c,1,d,f);if(1===h.filterWidth&&1===h.filterHeight&&(0,s.util).arraysEqual(h.inShape,h.outShape))t=(0,l.identity)({inputs:{x:u},backend:n});else{let e=n.data.get(u.dataId).values,r=(0,s.util).computeStrides(u.shape),a=(0,o.pool)(e,u.shape,u.dtype,r,h,"avg");t=n.makeTensorInfo(h.outShape,u.dtype,a.values)}return t}let u={kernelName:s.AvgPool,backendName:"cpu",kernelFunc:i}},{"@tensorflow/tfjs-core":"2nuhV","../cpu_util":"f1aYU","../utils/pool_utils":"abWnJ","./Identity":"3hjd4","@parcel/transformer-js/src/esmodule-helpers.js":"9pCYc"}],abWnJ:[function(e,t,r){/** * @license * Copyright 2020 Google LLC. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. * ============================================================================= */var n=e("@parcel/transformer-js/src/esmodule-helpers.js");n.defineInteropFlag(r),n.export(r,"pool",()=>a),n.export(r,"maxPoolPositions",()=>o),n.export(r,"pool3d",()=>l),n.export(r,"maxPool3dPositions",()=>i);var s=e("@tensorflow/tfjs-core");function a(e,t,r,n,a,o){let l=a.strideHeight,i=a.strideWidth,u=a.dilationHeight,p=a.dilationWidth,c=a.effectiveFilterHeight,d=a.effectiveFilterWidth,f=a.padInfo.top,h=a.padInfo.left,m="max"===o?Number.NEGATIVE_INFINITY:Number.POSITIVE_INFINITY,g=(0,s.buffer)(a.outShape,r),x=g.values,v=a.outShape[1]*a.outShape[2]*a.outShape[3],y=a.outShape[2]*a.outShape[3],b=a.outShape[3];for(let t=0;tg?g=s:"avg"===o&&(v+=s,y++)}if(isNaN(g))break}x[j+r*b+t]="avg"===o?v/y:g}}}return g}function o(e,t,r,n,a=!1,l=!1){let i=(0,s.buffer)(n.outShape,"int32"),u=n.strideHeight,p=n.strideWidth,c=n.dilationHeight,d=n.dilationWidth,f=n.effectiveFilterHeight,h=n.effectiveFilterWidth,m=n.padInfo.top,g=n.padInfo.left,x=(0,s.buffer)(t,r,e);for(let e=0;eb&&(b=u,_=a?l?((e*n.inHeight+r)*n.inWidth+s)*n.inChannels+t:(r*n.inWidth+s)*n.inChannels+t:o*h+i)}}i.set(_,e,r,u,t)}}return i}function l(e,t,r,n,a,o){let l=a.strideDepth,i=a.strideHeight,u=a.strideWidth,p=a.dilationDepth,c=a.dilationHeight,d=a.dilationWidth,f=a.effectiveFilterDepth,h=a.effectiveFilterHeight,m=a.effectiveFilterWidth,g=a.padInfo.front,x=a.padInfo.top,v=a.padInfo.left,y="max"===o?Number.NEGATIVE_INFINITY:Number.POSITIVE_INFINITY,b=(0,s.buffer)(a.outShape,r),_=b.values,k=a.outShape[1]*a.outShape[2]*a.outShape[3]*a.outShape[4],j=a.outShape[2]*a.outShape[3]*a.outShape[4],I=a.outShape[3]*a.outShape[4],C=a.outShape[4];for(let t=0;tk?k=a:"avg"===o&&(j+=a,I++),isNaN(k))break}if(isNaN(k))break}if(isNaN(k))break}_[x+t]="avg"===o?j/Math.max(I,1):k}}}}return b}function i(e,t){let r=(0,s.buffer)(t.outShape,"int32"),n=t.strideDepth,a=t.strideHeight,o=t.strideWidth,l=t.dilationDepth,i=t.dilationHeight,u=t.dilationWidth,p=t.effectiveFilterDepth,c=t.effectiveFilterHeight,d=t.effectiveFilterWidth,f=t.padInfo.front,h=t.padInfo.top,m=t.padInfo.left;for(let s=0;s=I&&(I=i,C=r*c*d+a*c+l)}}}r.set(C,s,x,n,a,g)}}}return r}},{"@tensorflow/tfjs-core":"2nuhV","@parcel/transformer-js/src/esmodule-helpers.js":"9pCYc"}],"4J7Gs":[function(e,t,r){/** * @license * Copyright 2020 Google LLC. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. * ============================================================================= */var n=e("@parcel/transformer-js/src/esmodule-helpers.js");n.defineInteropFlag(r),n.export(r,"avgPool3D",()=>l),n.export(r,"avgPool3DConfig",()=>i);var s=e("@tensorflow/tfjs-core"),a=e("../cpu_util"),o=e("../utils/pool_utils");function l(e){let{inputs:t,backend:r,attrs:n}=e,{x:l}=t,{filterSize:i,strides:u,pad:p,dimRoundingMode:c,dataFormat:d}=n;(0,a.assertNotComplex)(l,"avgPool3d");let f=(0,s.backend_util).computePool3DInfo(l.shape,i,u,1,p,c,d),h=r.data.get(l.dataId).values,m=(0,o.pool3d)(h,l.shape,l.dtype,(0,s.util).computeStrides(l.shape),f,"avg");return r.makeTensorInfo(m.shape,"float32",m.values)}let i={kernelName:s.AvgPool3D,backendName:"cpu",kernelFunc:l}},{"@tensorflow/tfjs-core":"2nuhV","../cpu_util":"f1aYU","../utils/pool_utils":"abWnJ","@parcel/transformer-js/src/esmodule-helpers.js":"9pCYc"}],"98tXR":[function(e,t,r){/** * @license * Copyright 2020 Google LLC. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. * ============================================================================= */var n=e("@parcel/transformer-js/src/esmodule-helpers.js");n.defineInteropFlag(r),n.export(r,"avgPool3DGrad",()=>o),n.export(r,"avgPool3DGradConfig",()=>l);var s=e("@tensorflow/tfjs-core"),a=e("../cpu_util");function o(e){let{inputs:t,backend:r,attrs:n}=e,{dy:o,input:l}=t,{filterSize:i,strides:u,pad:p,dimRoundingMode:c}=n;(0,a.assertNotComplex)([o,l],"avgPool3DGrad");let d=(0,s.backend_util).computePool3DInfo(l.shape,i,u,1,p,c),f=d.strideDepth,h=d.strideHeight,m=d.strideWidth,g=d.filterDepth,x=d.filterHeight,v=d.filterWidth,y=d.dilationDepth,b=d.dilationHeight,_=d.dilationWidth,k=d.effectiveFilterDepth,j=d.effectiveFilterHeight,I=d.effectiveFilterWidth,C=k-1-d.padInfo.front,w=I-1-d.padInfo.left,T=j-1-d.padInfo.top,S=(0,s.buffer)(l.shape,"float32"),N=1/(g*x*v),E=r.bufferSync(o);for(let e=0;e=d.outDepth)&&Math.floor(n)===n)for(let r=0;r=d.outHeight)&&Math.floor(s)===s)for(let r=0;r=d.outWidth||Math.floor(a)!==a||(i+=E.get(e,n,s,a,t))}}}S.set(i*N,e,r,n,s,t)}return r.makeTensorInfo(S.shape,S.dtype,S.values)}let l={kernelName:s.AvgPool3DGrad,backendName:"cpu",kernelFunc:o}},{"@tensorflow/tfjs-core":"2nuhV","../cpu_util":"f1aYU","@parcel/transformer-js/src/esmodule-helpers.js":"9pCYc"}],"3Ej5P":[function(e,t,r){/** * @license * Copyright 2020 Google LLC. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. * ============================================================================= */var n=e("@parcel/transformer-js/src/esmodule-helpers.js");n.defineInteropFlag(r),n.export(r,"avgPoolGrad",()=>o),n.export(r,"avgPoolGradConfig",()=>l);var s=e("@tensorflow/tfjs-core"),a=e("../cpu_util");function o(e){let{inputs:t,backend:r,attrs:n}=e,{dy:o,input:l}=t;(0,a.assertNotComplex)([o,l],"avgPoolGrad");let{filterSize:i,strides:u,pad:p}=n,c=(0,s.backend_util).computePool2DInfo(l.shape,i,u,1,p),d=c.strideHeight,f=c.strideWidth,h=c.filterHeight,m=c.filterWidth,g=c.dilationHeight,x=c.dilationWidth,v=c.effectiveFilterHeight,y=c.effectiveFilterWidth,b=y-1-c.padInfo.left,_=v-1-c.padInfo.top,k=(0,s.buffer)(l.shape,"float32"),j=1/(h*m),I=r.data.get(o.dataId).values,C=(0,s.buffer)(o.shape,"float32",I);for(let e=0;e=c.outHeight)&&Math.floor(n)===n)for(let r=0;r=c.outWidth||Math.floor(s)!==s||(o+=C.get(e,n,s,t))}}k.set(o*j,e,r,n,t)}return r.makeTensorInfo(k.shape,k.dtype,k.values)}let l={kernelName:s.AvgPoolGrad,backendName:"cpu",kernelFunc:o}},{"@tensorflow/tfjs-core":"2nuhV","../cpu_util":"f1aYU","@parcel/transformer-js/src/esmodule-helpers.js":"9pCYc"}],WD35y:[function(e,t,r){/** * @license * Copyright 2020 Google LLC. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. * ============================================================================= */var n=e("@parcel/transformer-js/src/esmodule-helpers.js");n.defineInteropFlag(r),n.export(r,"batchNorm",()=>o),n.export(r,"batchNormConfig",()=>l);var s=e("@tensorflow/tfjs-core"),a=e("../cpu_util");function o(e){let{inputs:t,backend:r,attrs:n}=e,{x:o,scale:l,offset:i,mean:u,variance:p}=t;(0,s.util).assert(u.shape.length===p.shape.length,()=>"Batch normalization gradient requires mean and variance to have equal ranks."),(0,s.util).assert(null==i||u.shape.length===i.shape.length,()=>"Batch normalization gradient requires mean and offset to have equal ranks."),(0,s.util).assert(null==l||u.shape.length===l.shape.length,()=>"Batch normalization gradient requires mean and scale to have equal ranks."),(0,a.assertNotComplex)([o,u,p,l,i],"batchNorm");let{varianceEpsilon:c}=n;null==c&&(c=.001);let d=r.data.get(o.dataId).values,f=r.data.get(u.dataId).values,h=r.data.get(p.dataId).values,m=l?r.data.get(l.dataId).values:new Float32Array([1]),g=i?r.data.get(i.dataId).values:new Float32Array([0]),x=new Float32Array(d.length),v=g.length,y=m.length,b=h.length,_=f.length,k=0,j=0,I=0,C=0;for(let e=0;e=v&&(k=0),j>=_&&(j=0),I>=y&&(I=0),C>=b&&(C=0);return r.makeTensorInfo(o.shape,o.dtype,x)}let l={kernelName:s.FusedBatchNorm,backendName:"cpu",kernelFunc:o}},{"@tensorflow/tfjs-core":"2nuhV","../cpu_util":"f1aYU","@parcel/transformer-js/src/esmodule-helpers.js":"9pCYc"}],"6GDOZ":[function(e,t,r){/** * @license * Copyright 2020 Google LLC. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. * ============================================================================= */var n=e("@parcel/transformer-js/src/esmodule-helpers.js");n.defineInteropFlag(r),n.export(r,"batchToSpaceND",()=>u),n.export(r,"batchToSpaceNDConfig",()=>p);var s=e("@tensorflow/tfjs-core"),a=e("../cpu_util"),o=e("./Reshape"),l=e("./Slice"),i=e("./Transpose");function u(e){let{inputs:t,backend:r,attrs:n}=e,{x:u}=t,{blockShape:p,crops:c}=n;(0,a.assertNotComplex)([u],"batchToSpaceND");let d=p.reduce((e,t)=>e*t),f=(0,s.backend_util).getReshaped(u.shape,p,d),h=(0,s.backend_util).getPermuted(f.length,p.length),m=(0,s.backend_util).getReshapedPermuted(u.shape,p,d),g=(0,s.backend_util).getSliceBeginCoords(c,p.length),x=(0,s.backend_util).getSliceSize(m,c,p.length),v=(0,o.reshape)({inputs:{x:u},backend:r,attrs:{shape:f}}),y=(0,i.transpose)({inputs:{x:v},backend:r,attrs:{perm:h}}),b=(0,o.reshape)({inputs:{x:y},backend:r,attrs:{shape:m}}),_=(0,l.slice)({inputs:{x:b},backend:r,attrs:{begin:g,size:x}});return r.disposeIntermediateTensorInfo(v),r.disposeIntermediateTensorInfo(y),r.disposeIntermediateTensorInfo(b),_}let p={kernelName:s.BatchToSpaceND,backendName:"cpu",kernelFunc:u}},{"@tensorflow/tfjs-core":"2nuhV","../cpu_util":"f1aYU","./Reshape":"dPbEE","./Slice":"loZC8","./Transpose":"4kskA","@parcel/transformer-js/src/esmodule-helpers.js":"9pCYc"}],U2WzW:[function(e,t,r){/** * @license * Copyright 2020 Google LLC. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. * ============================================================================= */var n=e("@parcel/transformer-js/src/esmodule-helpers.js");n.defineInteropFlag(r),n.export(r,"bincount",()=>o),n.export(r,"bincountConfig",()=>l);var s=e("@tensorflow/tfjs-core"),a=e("./Bincount_impl");function o(e){let{inputs:t,backend:r,attrs:n}=e,{x:s,weights:o}=t,{size:l}=n,i=r.data.get(s.dataId).values,u=r.data.get(o.dataId).values,p=(0,a.bincountImpl)(i,u,o.dtype,o.shape,l);return r.makeTensorInfo([l],o.dtype,p)}let l={kernelName:s.Bincount,backendName:"cpu",kernelFunc:o}},{"@tensorflow/tfjs-core":"2nuhV","./Bincount_impl":"l6nVN","@parcel/transformer-js/src/esmodule-helpers.js":"9pCYc"}],jrQyX:[function(e,t,r){/** * @license * Copyright 2021 Google LLC. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. * ============================================================================= */var n=e("@parcel/transformer-js/src/esmodule-helpers.js");n.defineInteropFlag(r),n.export(r,"broadcastArgs",()=>a),n.export(r,"broadcastArgsConfig",()=>o);var s=e("@tensorflow/tfjs-core");function a(e){let{inputs:t,backend:r}=e,{s0:n,s1:a}=t,o=r.data.get(n.dataId).values,l=r.data.get(a.dataId).values,i=(0,s.backend_util).assertAndGetBroadcastShape(Array.from(o),Array.from(l));return r.makeTensorInfo([i.length],"int32",Int32Array.from(i))}let o={kernelName:s.BroadcastArgs,backendName:"cpu",kernelFunc:a}},{"@tensorflow/tfjs-core":"2nuhV","@parcel/transformer-js/src/esmodule-helpers.js":"9pCYc"}],egZ9z:[function(e,t,r){/** * @license * Copyright 2020 Google LLC. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the License); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an AS IS BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. * ============================================================================= */var n=e("@parcel/transformer-js/src/esmodule-helpers.js");n.defineInteropFlag(r),n.export(r,"clipByValue",()=>a),n.export(r,"clipByValueConfig",()=>o);var s=e("@tensorflow/tfjs-core");let a=(0,e("../utils/unary_utils").unaryKernelFunc)(s.ClipByValue,(e,t)=>e>t.clipValueMax?t.clipValueMax:ea),n.export(r,"complexAbsConfig",()=>o);var s=e("@tensorflow/tfjs-core");let a=e=>{let{x:t}=e.inputs,r=e.backend,n=new Float32Array((0,s.util).sizeFromShape(t.shape)),a=r.data.get(t.dataId),o=a.complexTensorInfos.real,l=a.complexTensorInfos.imag,i=r.data.get(o.dataId).values,u=r.data.get(l.dataId).values;for(let e=0;ec),n.export(r,"concatConfig",()=>d);var s=e("@tensorflow/tfjs-core"),a=e("./Complex"),o=e("./Concat_impl"),l=e("./Identity"),i=e("./Imag"),u=e("./Real"),p=e("./Reshape");function c(e){let{inputs:t,backend:r,attrs:n}=e,{axis:d}=n,f=(0,s.util).parseAxisParam(d,t[0].shape)[0],h=t.map(e=>e.shape);(0,s.backend_util).assertParamsConsistent(h,f);let m=(0,s.backend_util).computeOutShape(t.map(e=>e.shape),f);if(0===(0,s.util).sizeFromShape(m))return r.makeTensorInfo(m,t[0].dtype,[]);let g=t.filter(e=>(0,s.util).sizeFromShape(e.shape)>0);if(1===g.length)return(0,l.identity)({inputs:{x:g[0]},backend:r});if("complex64"===g[0].dtype){let e=g.map(e=>(0,u.real)({inputs:{input:e},backend:r})),t=g.map(e=>(0,i.imag)({inputs:{input:e},backend:r})),n=c({inputs:e,backend:r,attrs:{axis:f}}),s=c({inputs:t,backend:r,attrs:{axis:f}}),o=(0,a.complex)({inputs:{real:n,imag:s},backend:r});return e.forEach(e=>r.disposeIntermediateTensorInfo(e)),t.forEach(e=>r.disposeIntermediateTensorInfo(e)),r.disposeIntermediateTensorInfo(n),r.disposeIntermediateTensorInfo(s),o}let x=g.map(e=>{let t=(0,s.util).sizeFromShape(e.shape.slice(f));return(0,p.reshape)({inputs:{x:e},backend:r,attrs:{shape:[-1,t]}})}),v=x.map(e=>({vals:r.data.get(e.dataId).values,shape:e.shape}));m=(0,s.backend_util).computeOutShape(x.map(e=>e.shape),1);let y=1===x[0].shape[0],b=(0,o.concatImpl)(v,m,t[0].dtype,y),_=(0,s.backend_util).computeOutShape(g.map(e=>e.shape),f),k=r.makeTensorInfo(_,t[0].dtype,b);return x.forEach(e=>r.disposeIntermediateTensorInfo(e)),k}let d={kernelName:s.Concat,backendName:"cpu",kernelFunc:c}},{"@tensorflow/tfjs-core":"2nuhV","./Complex":"6RuMJ","./Concat_impl":"hktsy","./Identity":"3hjd4","./Imag":"9zot5","./Real":"fn30c","./Reshape":"dPbEE","@parcel/transformer-js/src/esmodule-helpers.js":"9pCYc"}],"9zot5":[function(e,t,r){/** * @license * Copyright 2020 Google LLC. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. * ============================================================================= */var n=e("@parcel/transformer-js/src/esmodule-helpers.js");function s(e){let{inputs:t,backend:r}=e,{input:n}=t,s=r.data.get(n.dataId).complexTensorInfos.imag,a=r.data.get(s.dataId).values;return r.makeTensorInfo(s.shape,s.dtype,a)}n.defineInteropFlag(r),n.export(r,"imag",()=>s),n.export(r,"imagConfig",()=>a);let a={kernelName:e("@tensorflow/tfjs-core").Imag,backendName:"cpu",kernelFunc:s}},{"@tensorflow/tfjs-core":"2nuhV","@parcel/transformer-js/src/esmodule-helpers.js":"9pCYc"}],b06OB:[function(e,t,r){/** * @license * Copyright 2020 Google LLC. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. * ============================================================================= */var n=e("@parcel/transformer-js/src/esmodule-helpers.js");n.defineInteropFlag(r),n.export(r,"conv2D",()=>o),n.export(r,"conv2DConfig",()=>l);var s=e("@tensorflow/tfjs-core"),a=e("../cpu_util");function o(e){let{inputs:t,backend:r,attrs:n}=e,{x:o,filter:l}=t,{strides:i,pad:u,dataFormat:p,dilations:c,dimRoundingMode:d}=n;(0,a.assertNotComplex)([o,l],"conv2d");let f=(0,s.backend_util).convertConv2DDataFormat(p),h=(0,s.backend_util).computeConv2DInfo(o.shape,l.shape,i,c,u,d,!1,f),m=h.filterHeight,g=h.filterWidth,x=h.dilationHeight,v=h.dilationWidth,y=h.padInfo.left,b=h.padInfo.top,_="channelsLast"===h.dataFormat,k=new s.TensorBuffer(h.outShape,o.dtype),j=(0,s.util).computeStrides(o.shape),I=(0,s.util).computeStrides(l.shape),C=j[0],w=_?j[1]:j[2],T=_?j[2]:1,S=_?1:j[1],N=k.strides[0],E=_?k.strides[1]:k.strides[2],F=_?k.strides[2]:1,R=_?1:k.strides[1],A=r.data.get(o.dataId).values,P=r.data.get(l.dataId).values,D=k.values;for(let e=0;e=h.inHeight)continue;let a=e*I[0],o=t+r*w;for(let e=0;e=h.inWidth)continue;let s=a+e*I[1],l=o+n*T,i=s;for(let e=0;eo),n.export(r,"conv2DBackpropFilterConfig",()=>l);var s=e("@tensorflow/tfjs-core"),a=e("../cpu_util");function o(e){let{inputs:t,backend:r,attrs:n}=e,{x:o,dy:l}=t,{strides:i,pad:u,dataFormat:p,dimRoundingMode:c,filterShape:d}=n;(0,a.assertNotComplex)([o,l],"conv2dBackpropFilter");let f=(0,s.backend_util).convertConv2DDataFormat(p),h=(0,s.backend_util).computeConv2DInfo(o.shape,d,i,1,u,c,!1,f),{strideHeight:m,strideWidth:g,filterHeight:x,filterWidth:v}=h,y="channelsLast"===h.dataFormat,b=new s.TensorBuffer(h.filterShape,"float32"),_=h.padInfo.left,k=h.padInfo.top,j=r.data.get(o.dataId).values,I=r.data.get(l.dataId).values,C=new s.TensorBuffer(o.shape,o.dtype,j),w=new s.TensorBuffer(l.shape,l.dtype,I);for(let e=0;eo),n.export(r,"conv2DBackpropInputConfig",()=>l);var s=e("@tensorflow/tfjs-core"),a=e("../cpu_util");function o(e){let{inputs:t,backend:r,attrs:n}=e,{dy:o,filter:l}=t,{inputShape:i,strides:u,pad:p,dataFormat:c,dimRoundingMode:d}=n;(0,a.assertNotComplex)([o,l],"conv2dBackpropInput");let f=(0,s.util).computeStrides(l.shape),h=(0,s.util).computeStrides(o.shape),m=(0,s.backend_util).convertConv2DDataFormat(c),g=(0,s.backend_util).computeConv2DInfo(i,l.shape,u,1,p,d,!1,m),x=new s.TensorBuffer(g.inShape,"float32"),v=x.values,y=r.data.get(o.dataId).values,b=r.data.get(l.dataId).values,[_,k,j]=f,{batchSize:I,filterHeight:C,filterWidth:w,inChannels:T,inHeight:S,inWidth:N,outChannels:E,outHeight:F,outWidth:R,strideHeight:A,strideWidth:P}=g;m=g.dataFormat;let D=C-1-g.padInfo.top,$=w-1-g.padInfo.left,M="channelsLast"===m,O=x.strides[0],V=M?x.strides[1]:x.strides[2],B=M?x.strides[2]:1,L=M?1:x.strides[1],G=h[0],z=M?h[1]:h[2],U=M?h[2]:1,Y=M?1:h[1];for(let e=0;eo),n.export(r,"conv3DConfig",()=>l);var s=e("@tensorflow/tfjs-core"),a=e("../cpu_util");function o(e){let{inputs:t,backend:r,attrs:n}=e,{x:o,filter:l}=t,{strides:i,pad:u,dilations:p}=n;(0,a.assertNotComplex)([o,l],"conv3d");let c=(0,s.backend_util).computeConv3DInfo(o.shape,l.shape,i,p,u),{filterDepth:d,filterHeight:f,filterWidth:h,dilationDepth:m,dilationHeight:g,dilationWidth:x,padInfo:v}=c,y=v.front,b=v.left,_=v.top,k=new s.TensorBuffer(c.outShape,o.dtype),j=r.data.get(o.dataId).values,I=r.data.get(l.dataId).values,C=k.values,w=(0,s.util).computeStrides(o.shape),T=(0,s.util).computeStrides(l.shape);for(let e=0;e=c.inDepth)continue;let a=e*T[0],o=t+r*w[1];for(let e=0;e=c.inHeight)continue;let s=a+e*T[1],l=o+n*w[2];for(let e=0;e=c.inWidth)continue;let a=s+e*T[2],o=l+t*c.inChannels,i=a;for(let e=0;eo),n.export(r,"conv3DBackpropFilterV2Config",()=>l);var s=e("@tensorflow/tfjs-core"),a=e("../cpu_util");function o(e){let{inputs:t,backend:r,attrs:n}=e,{x:o,dy:l}=t,{strides:i,pad:u,filterShape:p}=n;(0,a.assertNotComplex)([o,l],"conv3dBackpropFilterV2");let c=(0,s.util).computeStrides(o.shape),d=(0,s.util).computeStrides(l.shape),f=(0,s.backend_util).computeConv3DInfo(o.shape,p,i,1,u),h=f.strideDepth,m=f.strideHeight,g=f.strideWidth,x=f.filterDepth,v=f.filterHeight,y=f.filterWidth,b=new s.TensorBuffer(f.filterShape,"float32"),_=b.values,[k,j,I,C]=b.strides,w=r.data.get(l.dataId).values,[T,S,N,E]=d,F=r.data.get(o.dataId).values,[R,A,P,D]=c,$=f.padInfo.front,M=f.padInfo.left,O=f.padInfo.top;for(let e=0;eo),n.export(r,"conv3DBackpropInputV2Config",()=>l);var s=e("@tensorflow/tfjs-core"),a=e("../cpu_util");function o(e){let{inputs:t,backend:r,attrs:n}=e,{dy:o,filter:l}=t,{pad:i,strides:u,inputShape:p}=n;(0,a.assertNotComplex)([o],"conv3dBackpropInputV2");let c=(0,s.util).computeStrides(o.shape),d=(0,s.util).computeStrides(l.shape),f=(0,s.backend_util).computeConv3DInfo(p,l.shape,u,1,i),h=new s.TensorBuffer(f.inShape,"float32"),m=h.values,[g,x,v,y]=h.strides,b=r.data.get(o.dataId).values,[_,k,j,I]=c,C=r.data.get(l.dataId).values,[w,T,S,N]=d,{batchSize:E,filterDepth:F,filterHeight:R,filterWidth:A,inChannels:P,inDepth:D,inHeight:$,inWidth:M,outChannels:O,outDepth:V,outHeight:B,outWidth:L,strideDepth:G,strideHeight:z,strideWidth:U}=f,Y=F-1-f.padInfo.front,W=R-1-f.padInfo.top,q=A-1-f.padInfo.left;for(let e=0;ea),n.export(r,"cosConfig",()=>o);var s=e("@tensorflow/tfjs-core");let a=(0,e("../utils/unary_utils").unaryKernelFunc)(s.Cos,e=>Math.cos(e)),o={kernelName:s.Cos,backendName:"cpu",kernelFunc:a}},{"@tensorflow/tfjs-core":"2nuhV","../utils/unary_utils":"i8gKT","@parcel/transformer-js/src/esmodule-helpers.js":"9pCYc"}],"6aYaE":[function(e,t,r){/** * @license * Copyright 2020 Google LLC. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the License); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an AS IS BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. * ============================================================================= */var n=e("@parcel/transformer-js/src/esmodule-helpers.js");n.defineInteropFlag(r),n.export(r,"cosh",()=>a),n.export(r,"coshConfig",()=>o);var s=e("@tensorflow/tfjs-core");let a=(0,e("../utils/unary_utils").unaryKernelFunc)(s.Cosh,e=>Math.cosh(e)),o={kernelName:s.Cosh,backendName:"cpu",kernelFunc:a}},{"@tensorflow/tfjs-core":"2nuhV","../utils/unary_utils":"i8gKT","@parcel/transformer-js/src/esmodule-helpers.js":"9pCYc"}],"504Rj":[function(e,t,r){/** * @license * Copyright 2020 Google LLC. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. * ============================================================================= */var n=e("@parcel/transformer-js/src/esmodule-helpers.js");n.defineInteropFlag(r),n.export(r,"cropAndResize",()=>a),n.export(r,"cropAndResizeConfig",()=>o);var s=e("@tensorflow/tfjs-core");function a(e){let{inputs:t,backend:r,attrs:n}=e,{image:a,boxes:o,boxInd:l}=t,{cropSize:i,method:u,extrapolationValue:p}=n,[c,d,f,h]=a.shape,m=o.shape[0],[g,x]=i,v=(0,s.buffer)([m,g,x,h],"float32"),y=r.data.get(o.dataId).values,b=r.data.get(l.dataId).values,_=r.data.get(a.dataId).values,k=(0,s.util).computeStrides(a.shape),j=(0,s.util).computeStrides(v.shape);for(let e=0;e=c)continue;let l=g>1?(s-r)*(d-1)/(g-1):0,i=x>1?(a-n)*(f-1)/(x-1):0;for(let t=0;t1?r*(d-1)+t*l:.5*(r+s)*(d-1);if(c<0||c>d-1){for(let r=0;r1?n*(f-1)+u*i:.5*(n+a)*(f-1);if(c<0||c>f-1){for(let r=0;r1?n*(f-1)+r*i:.5*(n+a)*(f-1);if(s<0||s>f-1){for(let n=0;nl),n.export(r,"cumprodConfig",()=>i);var s=e("@tensorflow/tfjs-core"),a=e("../cpu_util"),o=e("./Transpose");function l(e){let{inputs:t,backend:r,attrs:n}=e,{x:l}=t,{axis:i,exclusive:u,reverse:p}=n;(0,a.assertNotComplex)(l,"cumprod");let c=(0,s.backend_util).getAxesPermutation([i],l.shape.length),d=l;null!=c&&(d=(0,o.transpose)({inputs:{x:l},backend:r,attrs:{perm:c}}));let f=(0,s.backend_util).getInnerMostAxes(1,l.shape.length)[0];if(f!==d.shape.length-1)throw Error(`backend.cumprod in CPU expects an inner-most axis=${d.shape.length-1} but got axis=${f}`);let h=(0,s.upcastType)(d.dtype,"int32"),m=(0,s.util).makeOnesTypedArray((0,s.util).sizeFromShape(d.shape),h),g=r.data.get(d.dataId).values,x=d.shape[d.shape.length-1],v=p?(e,t)=>e+x-t-1:(e,t)=>e+t;for(let e=0;el),n.export(r,"cumsumConfig",()=>i);var s=e("@tensorflow/tfjs-core"),a=e("../cpu_util"),o=e("./Transpose");function l(e){let{inputs:t,backend:r,attrs:n}=e,{x:l}=t,{axis:i,exclusive:u,reverse:p}=n;(0,a.assertNotComplex)(l,"cumsum");let c=(0,s.backend_util).getAxesPermutation([i],l.shape.length),d=l;null!=c&&(d=(0,o.transpose)({inputs:{x:l},backend:r,attrs:{perm:c}}));let f=(0,s.backend_util).getInnerMostAxes(1,l.shape.length)[0];if(f!==d.shape.length-1)throw Error(`backend.cumsum in CPU expects an inner-most axis=${d.shape.length-1} but got axis=${f}`);let h=(0,s.upcastType)(d.dtype,"int32"),m=(0,s.util).makeZerosTypedArray((0,s.util).sizeFromShape(d.shape),h),g=r.data.get(d.dataId).values,x=d.shape[d.shape.length-1],v=p?(e,t)=>e+x-t-1:(e,t)=>e+t;for(let e=0;eo),n.export(r,"denseBincountConfig",()=>l);var s=e("@tensorflow/tfjs-core"),a=e("./Bincount_impl");function o(e){let{inputs:t,backend:r,attrs:n}=e,{x:s,weights:o}=t,{size:l,binaryOutput:i}=n;if(1===s.shape.length){let e=r.data.get(s.dataId).values,t=r.data.get(o.dataId).values,n=(0,a.bincountImpl)(e,t,o.dtype,o.shape,l);return r.makeTensorInfo([l],o.dtype,n)}if(2===s.shape.length){let e=r.bufferSync(s),t=r.bufferSync(o),n=(0,a.bincountReduceImpl)(e,t,l,i);return r.makeTensorInfo(n.shape,o.dtype,n.values)}throw Error(`Error in denseBincount: input must be at most rank 2, but got rank${s.shape.length}.`)}let l={kernelName:s.DenseBincount,backendName:"cpu",kernelFunc:o}},{"@tensorflow/tfjs-core":"2nuhV","./Bincount_impl":"l6nVN","@parcel/transformer-js/src/esmodule-helpers.js":"9pCYc"}],"2ikJi":[function(e,t,r){/** * @license * Copyright 2020 Google LLC. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. * ============================================================================= */var n=e("@parcel/transformer-js/src/esmodule-helpers.js");n.defineInteropFlag(r),n.export(r,"depthToSpace",()=>a),n.export(r,"depthToSpaceConfig",()=>o);var s=e("@tensorflow/tfjs-core");function a(e){let{inputs:t,backend:r,attrs:n}=e,{x:a}=t,{blockSize:o,dataFormat:l}=n;(0,s.util).assert("NHWC"===l,()=>`Only NHWC dataFormat supported on CPU for depthToSpace. Got ${l}`);let i=a.shape[0],u=a.shape[1],p=a.shape[2],c=a.shape[3],d=u*o,f=p*o,h=c/(o*o),m=r.data.get(a.dataId).values,g=new Float32Array(i*d*f*h),x=0;for(let e=0;eo),n.export(r,"depthwiseConv2dNativeConfig",()=>l);var s=e("@tensorflow/tfjs-core"),a=e("../cpu_util");function o(e){let{inputs:t,backend:r,attrs:n}=e,{x:o,filter:l}=t,{strides:i,pad:u,dilations:p,dimRoundingMode:c}=n;(0,a.assertNotComplex)([o,l],"depthwiseConv2DNative");let d=(0,s.util).computeStrides(o.shape),f=(0,s.util).computeStrides(l.shape),h=p;null==h&&(h=[1,1]),(0,s.util).assert((0,s.backend_util).eitherStridesOrDilationsAreOne(i,h),()=>`Error in depthwiseConv2d: Either strides or dilations must be 1. Got strides ${i} and dilations '${h}'`);let m=(0,s.backend_util).computeConv2DInfo(o.shape,l.shape,i,h,u,c,!0),{filterHeight:g,filterWidth:x,dilationHeight:v,dilationWidth:y,padInfo:b}=m,_=b.left,k=b.top,j=m.outChannels/m.inChannels,I=new s.TensorBuffer(m.outShape,o.dtype),C=r.data.get(o.dataId).values,w=r.data.get(l.dataId).values,T=I.values;for(let e=0;e=m.inHeight)continue;let a=e*f[0],o=t+r*d[1];for(let e=0;e=m.inWidth)continue;let s=a+e*f[1],l=o+n*m.inChannels,i=t,u=s;for(let e=0;eo),n.export(r,"depthwiseConv2dNativeBackpropFilterConfig",()=>l);var s=e("@tensorflow/tfjs-core"),a=e("../cpu_util");function o(e){let{inputs:t,backend:r,attrs:n}=e,{x:o,dy:l}=t,{strides:i,dilations:u,pad:p,dimRoundingMode:c,filterShape:d}=n;(0,a.assertNotComplex)([o,l],"depthwiseConv2dNativeBackpropFilter");let f=(0,s.backend_util).computeConv2DInfo(o.shape,d,i,u,p,c,!0),{strideHeight:h,strideWidth:m,filterHeight:g,filterWidth:x}=f,v=new s.TensorBuffer(f.filterShape,"float32"),y=f.padInfo.left,b=f.padInfo.top,_=f.outChannels/f.inChannels,k=r.data.get(o.dataId).values,j=new s.TensorBuffer(o.shape,o.dtype,k),I=r.data.get(l.dataId).values,C=new s.TensorBuffer(l.shape,l.dtype,I);for(let e=0;eo),n.export(r,"depthwiseConv2dNativeBackpropInputConfig",()=>l);var s=e("@tensorflow/tfjs-core"),a=e("../cpu_util");function o(e){let{inputs:t,backend:r,attrs:n}=e,{dy:o,filter:l}=t,{strides:i,dilations:u,pad:p,dimRoundingMode:c,inputShape:d}=n;(0,a.assertNotComplex)([o,l],"depthwiseConv2DNativeBackpropInput");let f=(0,s.util).computeStrides(o.shape),h=(0,s.util).computeStrides(l.shape),m=(0,s.backend_util).computeConv2DInfo(d,l.shape,i,u,p,c,!0),g=new s.TensorBuffer(m.inShape,"float32"),x=g.values,[v,y,b]=g.strides,_=r.data.get(o.dataId).values,[k,j,I]=f,C=r.data.get(l.dataId).values,[w,T,S]=h,{batchSize:N,filterHeight:E,filterWidth:F,inChannels:R,inHeight:A,inWidth:P,outChannels:D,outHeight:$,outWidth:M,strideHeight:O,strideWidth:V}=m,B=E-1-m.padInfo.top,L=F-1-m.padInfo.left,G=D/R;for(let e=0;ea),n.export(r,"diagConfig",()=>o);var s=e("@tensorflow/tfjs-core");function a(e){let{inputs:t,backend:r}=e,{x:n}=t,a=(0,s.util).sizeFromShape(n.shape),o=r.data.get(n.dataId).values,l=(0,s.buffer)([a,a],n.dtype),i=l.values;for(let e=0;ea);var s=e("@tensorflow/tfjs-core");let a={kernelName:s.Dilation2D,backendName:"cpu",kernelFunc:({inputs:e,backend:t,attrs:r})=>{let{x:n,filter:a}=e,{strides:o,pad:l,dilations:i}=r,u=t.data.get(n.dataId).values,p=n.shape.length,c=t.data.get(a.dataId).values,d=a.shape.length,{batchSize:f,inHeight:h,inWidth:m,inChannels:g,outHeight:x,outWidth:v,padInfo:y,strideHeight:b,strideWidth:_,filterHeight:k,filterWidth:j,dilationHeight:I,dilationWidth:C,outShape:w}=(0,s.backend_util).computeDilation2DInfo(n.shape,a.shape,o,l,"NHWC",i),T=(0,s.util).sizeFromShape(w),S=w.length,N=(0,s.util).getArrayFromDType(n.dtype,T);for(let e=0;e=0&&o=0&&hf&&(f=g)}}}N[(0,s.util).locToIndex([e,t,o,i],S,(0,s.util).computeStrides(w))]=f}}}return{dataId:t.write((0,s.util).toTypedArray(N,n.dtype),w,n.dtype),shape:w,dtype:n.dtype}}}},{"@tensorflow/tfjs-core":"2nuhV","@parcel/transformer-js/src/esmodule-helpers.js":"9pCYc"}],"6i1Hx":[function(e,t,r){/** * @license * Copyright 2020 Google LLC. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. * ============================================================================= */var n=e("@parcel/transformer-js/src/esmodule-helpers.js");n.defineInteropFlag(r),n.export(r,"dilation2DBackpropFilterConfig",()=>a);var s=e("@tensorflow/tfjs-core");let a={kernelName:s.Dilation2DBackpropFilter,backendName:"cpu",kernelFunc:({inputs:e,backend:t,attrs:r})=>{let{x:n,filter:a,dy:o}=e,{strides:l,pad:i,dilations:u}=r,p=(0,s.util).toNestedArray(n.shape,t.data.get(n.dataId).values),c=(0,s.util).toNestedArray(a.shape,t.data.get(a.dataId).values),{batchSize:d,inHeight:f,inWidth:h,inChannels:m,outHeight:g,outWidth:x,padInfo:v,strideHeight:y,strideWidth:b,filterHeight:_,filterWidth:k,dilationHeight:j,dilationWidth:I,outShape:C}=(0,s.backend_util).computeDilation2DInfo(n.shape,a.shape,l,i,"NHWC",u);(0,s.util).assert(o.rank===C.length,()=>`Error in ${s.Dilation2DBackpropFilter}, dy must have the same rank as output ${C.length}, but got ${o.rank}`);let w=(0,s.util).toNestedArray(C,t.data.get(o.dataId).values),T=(0,s.util).makeZerosNestedTypedArray(a.shape,a.dtype);for(let e=0;e=0&&n=0&&uo&&(o=s,l=t,i=r)}}}T[l][i][a]+=w[e][t][n][a]}}}return{dataId:t.write((0,s.util).toTypedArray(T,n.dtype),a.shape,a.dtype),shape:a.shape,dtype:a.dtype}}}},{"@tensorflow/tfjs-core":"2nuhV","@parcel/transformer-js/src/esmodule-helpers.js":"9pCYc"}],gvsQI:[function(e,t,r){/** * @license * Copyright 2020 Google LLC. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. * ============================================================================= */var n=e("@parcel/transformer-js/src/esmodule-helpers.js");n.defineInteropFlag(r),n.export(r,"dilation2DBackpropInputConfig",()=>a);var s=e("@tensorflow/tfjs-core");let a={kernelName:s.Dilation2DBackpropInput,backendName:"cpu",kernelFunc:({inputs:e,backend:t,attrs:r})=>{let{x:n,filter:a,dy:o}=e,{strides:l,pad:i,dilations:u}=r,p=(0,s.util).toNestedArray(n.shape,t.data.get(n.dataId).values),c=(0,s.util).toNestedArray(a.shape,t.data.get(a.dataId).values),{batchSize:d,inHeight:f,inWidth:h,inChannels:m,outHeight:g,outWidth:x,padInfo:v,strideHeight:y,strideWidth:b,filterHeight:_,filterWidth:k,dilationHeight:j,dilationWidth:I,outShape:C}=(0,s.backend_util).computeDilation2DInfo(n.shape,a.shape,l,i,"NHWC",u);(0,s.util).assert(o.rank===C.length,()=>`Error in ${s.Dilation2DBackpropInput}, dy must have the same rank as output ${C.length}, but got ${o.rank}`);let w=(0,s.util).toNestedArray(C,t.data.get(o.dataId).values),T=(0,s.util).makeZerosNestedTypedArray(n.shape,n.dtype);for(let e=0;e=0&&n=0&&uo&&(o=s,l=n,i=u)}}}T[e][l][i][a]+=w[e][t][n][a]}}}return{dataId:t.write((0,s.util).toTypedArray(T,n.dtype),n.shape,n.dtype),shape:n.shape,dtype:n.dtype}}}},{"@tensorflow/tfjs-core":"2nuhV","@parcel/transformer-js/src/esmodule-helpers.js":"9pCYc"}],cAJH9:[function(e,t,r){/** * @license * Copyright 2023 Google LLC. * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. * ============================================================================= */var n=e("@parcel/transformer-js/src/esmodule-helpers.js");function s(e){let{inputs:t,backend:r,attrs:n}=e,{image:s}=t,{canvas:a,options:o}=n,{contextOptions:l,imageOptions:i}=o||{},u=(null==i?void 0:i.alpha)||1,p=(null==l?void 0:l.contextType)||"2d";if("2d"!==p)throw Error(`Context type ${l.contextType} is not supported by the CPU backend.`);let c=a.getContext(p,(null==l?void 0:l.contextAttributes)||{});if(null==c)throw Error(`Could not get the context with ${p} type.`);let[d,f]=s.shape.slice(0,2),h=2===s.shape.length?1:s.shape[2],m=r.data.get(s.dataId).values,g="float32"===s.dtype?255:1,x=new Uint8ClampedArray(f*d*4);for(let e=0;e1)throw Error(`Tensor values for a float32 Tensor must be in the range [0 - 1] but encountered ${n}.`)}else if("int32"===s.dtype&&(n<0||n>255))throw Error(`Tensor values for a int32 Tensor must be in the range [0 - 255] but encountered ${n}.`);1===h?(t[0]=n*g,t[1]=n*g,t[2]=n*g):t[r]=n*g}let r=4*e;x[r+0]=Math.round(t[0]),x[r+1]=Math.round(t[1]),x[r+2]=Math.round(t[2]),x[r+3]=Math.round(t[3])}a.width=f,a.height=d;let v=new ImageData(x,f,d);return c.putImageData(v,0,0),s}n.defineInteropFlag(r),n.export(r,"draw",()=>s),n.export(r,"drawConfig",()=>a);let a={kernelName:e("@tensorflow/tfjs-core").Draw,backendName:"cpu",kernelFunc:s}},{"@tensorflow/tfjs-core":"2nuhV","@parcel/transformer-js/src/esmodule-helpers.js":"9pCYc"}],cjihf:[function(e,t,r){/** * @license * Copyright 2021 Google LLC. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. * ============================================================================= */var n=e("@parcel/transformer-js/src/esmodule-helpers.js");n.defineInteropFlag(r),n.export(r,"einsum",()=>u),n.export(r,"einsumConfig",()=>p);var s=e("@tensorflow/tfjs-core"),a=e("./Multiply"),o=e("./Reshape"),l=e("./Sum"),i=e("./Transpose");function u(e){let{inputs:t,backend:r,attrs:n}=e,{equation:u}=n,{allDims:p,summedDims:c,idDims:d}=(0,s.backend_util).decodeEinsumEquation(u,t.length);(0,s.backend_util).checkEinsumDimSizes(p.length,d,t);let{path:f,steps:h}=(0,s.backend_util).getEinsumComputePath(c,d),m=h.length,g=null,x=p.length,v=[];for(let e=0;e=0&&(g=(0,l.sum)({inputs:{x:g},backend:r,attrs:{axis:f[e]-(p.length-x),keepDims:!1}}),v.push(g)),x--)}for(let e of v)e!==g&&r.disposeIntermediateTensorInfo(e);return g}let p={kernelName:s.Einsum,backendName:"cpu",kernelFunc:u}},{"@tensorflow/tfjs-core":"2nuhV","./Multiply":"k52uJ","./Reshape":"dPbEE","./Sum":"dI67n","./Transpose":"4kskA","@parcel/transformer-js/src/esmodule-helpers.js":"9pCYc"}],dI67n:[function(e,t,r){/** * @license * Copyright 2020 Google LLC. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. * ============================================================================= */var n=e("@parcel/transformer-js/src/esmodule-helpers.js");n.defineInteropFlag(r),n.export(r,"sum",()=>c),n.export(r,"sumConfig",()=>d);var s=e("@tensorflow/tfjs-core"),a=e("../cpu_util"),o=e("../utils/zeros_impl"),l=e("./Cast"),i=e("./Identity"),u=e("./Reshape"),p=e("./Transpose");function c(e){let t;let{inputs:r,backend:n,attrs:c}=e,{x:d}=r,{axis:f,keepDims:h}=c;(0,a.assertNotComplex)(d,"sum");let m=(t="bool"===d.dtype?(0,l.cast)({inputs:{x:d},backend:n,attrs:{dtype:"int32"}}):(0,i.identity)({inputs:{x:d},backend:n})).shape.length,g=(0,s.util).parseAxisParam(f,t.shape),x=(0,s.backend_util).getAxesPermutation(g,m),v=g,y=t;null!=x&&(y=(0,p.transpose)({inputs:{x:t},backend:n,attrs:{perm:x}}),v=(0,s.backend_util).getInnerMostAxes(v.length,m)),(0,s.backend_util).assertAxesAreInnerMostDims("sum",v,y.shape.length);let[b,_]=(0,s.backend_util).computeOutAndReduceShapes(y.shape,v),k=(0,s.backend_util).upcastType(y.dtype,"int32"),j=(0,o.zeros)(n,b,k),I=(0,s.util).sizeFromShape(_),C=n.data.get(j.dataId).values,w=n.data.get(y.dataId).values;for(let e=0;eo),n.export(r,"eluGradConfig",()=>l);var s=e("@tensorflow/tfjs-core"),a=e("../cpu_util");function o(e){let{inputs:t,backend:r}=e,{dy:n,y:o}=t;(0,a.assertNotComplex)([n,o],"eluGrad");let l=new Float32Array((0,s.util).sizeFromShape(o.shape)),i=r.data.get(o.dataId).values,u=r.data.get(n.dataId).values;for(let e=0;e=0?l[e]=u[e]:l[e]=u[e]*(t+1)}return r.makeTensorInfo(o.shape,"float32",l)}let l={kernelName:s.EluGrad,backendName:"cpu",kernelFunc:o}},{"@tensorflow/tfjs-core":"2nuhV","../cpu_util":"f1aYU","@parcel/transformer-js/src/esmodule-helpers.js":"9pCYc"}],gbqjv:[function(e,t,r){/** * @license * Copyright 2020 Google LLC. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the License); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an AS IS BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. * ============================================================================= */var n=e("@parcel/transformer-js/src/esmodule-helpers.js");n.defineInteropFlag(r),n.export(r,"erf",()=>d),n.export(r,"erfConfig",()=>f);var s=e("@tensorflow/tfjs-core"),a=e("../utils/unary_utils");let o=s.backend_util.ERF_P,l=s.backend_util.ERF_A1,i=s.backend_util.ERF_A2,u=s.backend_util.ERF_A3,p=s.backend_util.ERF_A4,c=s.backend_util.ERF_A5,d=(0,a.unaryKernelFunc)(s.Erf,e=>{let t=Math.sign(e),r=Math.abs(e),n=1/(1+o*r);return t*(1-((((c*n+p)*n+u)*n+i)*n+l)*n*Math.exp(-r*r))}),f={kernelName:s.Erf,backendName:"cpu",kernelFunc:d}},{"@tensorflow/tfjs-core":"2nuhV","../utils/unary_utils":"i8gKT","@parcel/transformer-js/src/esmodule-helpers.js":"9pCYc"}],aVhKw:[function(e,t,r){/** * @license * Copyright 2020 Google LLC. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. * ============================================================================= */var n=e("@parcel/transformer-js/src/esmodule-helpers.js");n.defineInteropFlag(r),n.export(r,"expandDims",()=>o),n.export(r,"expandDimsConfig",()=>l);var s=e("@tensorflow/tfjs-core"),a=e("./Reshape");function o(e){let{inputs:t,backend:r,attrs:n}=e,{input:o}=t,{dim:l}=n,i=o.shape.length,u=o.shape.slice(),p=l;return l<0&&((0,s.util).assert(-(i+1)<=l,()=>`Axis must be in the interval [${-(i+1)}, ${i}]`),p=i+l+1),u.splice(p,0,1),(0,a.reshape)({inputs:{x:o},backend:r,attrs:{shape:u}})}let l={kernelName:s.ExpandDims,backendName:"cpu",kernelFunc:o}},{"@tensorflow/tfjs-core":"2nuhV","./Reshape":"dPbEE","@parcel/transformer-js/src/esmodule-helpers.js":"9pCYc"}],azsZX:[function(e,t,r){/** * @license * Copyright 2020 Google LLC. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. * ============================================================================= */var n=e("@parcel/transformer-js/src/esmodule-helpers.js");n.defineInteropFlag(r),n.export(r,"fft",()=>l),n.export(r,"fftConfig",()=>i);var s=e("@tensorflow/tfjs-core"),a=e("../utils/fft_utils"),o=e("./Reshape");function l(e){let{inputs:t,backend:r}=e,{input:n}=t,l=(0,s.util).sizeFromShape(n.shape),i=n.shape[n.shape.length-1],u=(0,o.reshape)({inputs:{x:n},backend:r,attrs:{shape:[l/i,i]}}),p=(0,a.fftBatch)(u,!1,r),c=(0,o.reshape)({inputs:{x:p},backend:r,attrs:{shape:n.shape}});return r.disposeIntermediateTensorInfo(u),r.disposeIntermediateTensorInfo(p),c}let i={kernelName:s.FFT,backendName:"cpu",kernelFunc:l}},{"@tensorflow/tfjs-core":"2nuhV","../utils/fft_utils":"2lqKJ","./Reshape":"dPbEE","@parcel/transformer-js/src/esmodule-helpers.js":"9pCYc"}],"2lqKJ":[function(e,t,r){/** * @license * Copyright 2020 Google LLC. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. * ============================================================================= */var n=e("@parcel/transformer-js/src/esmodule-helpers.js");n.defineInteropFlag(r),n.export(r,"fftBatch",()=>m),n.export(r,"fftImpl",()=>g);var s=e("@tensorflow/tfjs-core"),a=e("../kernels/Add"),o=e("../kernels/Complex"),l=e("../kernels/Concat"),i=e("../kernels/Identity"),u=e("../kernels/Imag"),p=e("../kernels/Multiply"),c=e("../kernels/Real"),d=e("../kernels/RealDiv"),f=e("../kernels/Slice"),h=e("../kernels/Sub");function m(e,t,r){let n=e.shape,a=n[0],l=n[1],i=r.data.get(e.dataId),u=i.complexTensorInfos.real,p=i.complexTensorInfos.imag,c=[a,l],d=(0,s.util).sizeFromShape(c),h=(0,s.util).getTypedArrayFromDType("float32",d),m=(0,s.util).getTypedArrayFromDType("float32",d);for(let e=0;el),n.export(r,"div",()=>i),n.export(r,"realDivConfig",()=>u);var s=e("@tensorflow/tfjs-core"),a=e("../utils/binary_impl"),o=e("../utils/binary_utils");let l=(0,a.createSimpleBinaryKernelImpl)((e,t)=>e/t),i=(0,o.binaryKernelFunc)(s.RealDiv,l),u={kernelName:s.RealDiv,backendName:"cpu",kernelFunc:i}},{"@tensorflow/tfjs-core":"2nuhV","../utils/binary_impl":"8pFjz","../utils/binary_utils":"8GweL","@parcel/transformer-js/src/esmodule-helpers.js":"9pCYc"}],"8pfO7":[function(e,t,r){/** * @license * Copyright 2020 Google LLC. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. * ============================================================================= */var n=e("@parcel/transformer-js/src/esmodule-helpers.js");n.defineInteropFlag(r),n.export(r,"fill",()=>a),n.export(r,"fillConfig",()=>o);var s=e("@tensorflow/tfjs-core");function a(e){let{backend:t,attrs:r}=e,{shape:n,value:a,dtype:o}=r,l=o||(0,s.util).inferDtype(a),i=(0,s.util).getArrayFromDType(l,(0,s.util).sizeFromShape(n));return function(e,t,r){e.fill(t)}(i,a,0),t.makeTensorInfo(n,l,i)}let o={kernelName:s.Fill,backendName:"cpu",kernelFunc:a}},{"@tensorflow/tfjs-core":"2nuhV","@parcel/transformer-js/src/esmodule-helpers.js":"9pCYc"}],h04Zu:[function(e,t,r){/** * @license * Copyright 2020 Google LLC. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. * ============================================================================= */var n=e("@parcel/transformer-js/src/esmodule-helpers.js");n.defineInteropFlag(r),n.export(r,"flipLeftRightConfig",()=>a);var s=e("@tensorflow/tfjs-core");let a={kernelName:s.FlipLeftRight,backendName:"cpu",kernelFunc:({inputs:e,attrs:t,backend:r})=>{let{image:n}=e,a=(0,s.util).getTypedArrayFromDType(n.dtype,(0,s.util).sizeFromShape(n.shape)),[o,l,i,u]=n.shape,p=r.data.get(n.dataId).values;for(let e=0;e=0&&ou),n.export(r,"fusedConv2DConfig",()=>p);var s=e("@tensorflow/tfjs-core"),a=e("../utils/fused_utils"),o=e("./Add"),l=e("./Conv2D"),i=e("./Reshape");function u(e){let{inputs:t,backend:r,attrs:n}=e,{x:s,filter:u,bias:p,preluActivationWeights:c}=t,{strides:d,pad:f,dataFormat:h,dilations:m,dimRoundingMode:g,activation:x,leakyreluAlpha:v}=n,y=(0,l.conv2D)({inputs:{x:s,filter:u},backend:r,attrs:{strides:d,pad:f,dataFormat:h,dilations:m,dimRoundingMode:g}});if(p){let e=y;if("NCHW"===h&&1===p.shape.length&&1!==p.shape[0]){let e=(0,i.reshape)({inputs:{x:p},backend:r,attrs:{shape:[p.shape[0],1,1]}});y=(0,o.add)({inputs:{a:y,b:e},backend:r}),r.disposeIntermediateTensorInfo(e)}else y=(0,o.add)({inputs:{a:y,b:p},backend:r});r.disposeIntermediateTensorInfo(e)}if(x){let e=y;if("NCHW"===h&&"prelu"===x&&1===c.shape.length&&1!==c.shape[0]){let e=(0,i.reshape)({inputs:{x:c},backend:r,attrs:{shape:[c.shape[0],1,1]}});y=(0,a.applyActivation)(r,y,x,e,v),r.disposeIntermediateTensorInfo(e)}else y=(0,a.applyActivation)(r,y,x,c,v);r.disposeIntermediateTensorInfo(e)}return y}let p={kernelName:s.FusedConv2D,backendName:"cpu",kernelFunc:u}},{"@tensorflow/tfjs-core":"2nuhV","../utils/fused_utils":"93hhz","./Add":"6fWFl","./Conv2D":"b06OB","./Reshape":"dPbEE","@parcel/transformer-js/src/esmodule-helpers.js":"9pCYc"}],"7ycc0":[function(e,t,r){/** * @license * Copyright 2020 Google LLC. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. * ============================================================================= */var n=e("@parcel/transformer-js/src/esmodule-helpers.js");n.defineInteropFlag(r),n.export(r,"fusedDepthwiseConv2D",()=>i),n.export(r,"fusedDepthwiseConv2DConfig",()=>u);var s=e("@tensorflow/tfjs-core"),a=e("../utils/fused_utils"),o=e("./Add"),l=e("./DepthwiseConv2dNative");function i(e){let{inputs:t,backend:r,attrs:n}=e,{x:s,filter:i,bias:u,preluActivationWeights:p}=t,{strides:c,pad:d,dataFormat:f,dilations:h,dimRoundingMode:m,activation:g,leakyreluAlpha:x}=n,v=(0,l.depthwiseConv2dNative)({inputs:{x:s,filter:i},backend:r,attrs:{strides:c,pad:d,dataFormat:f,dilations:h,dimRoundingMode:m}});if(u){let e=v;v=(0,o.add)({inputs:{a:v,b:u},backend:r}),r.disposeIntermediateTensorInfo(e)}if(g){let e=v;v=(0,a.applyActivation)(r,v,g,p,x),r.disposeIntermediateTensorInfo(e)}return v}let u={kernelName:s.FusedDepthwiseConv2D,backendName:"cpu",kernelFunc:i}},{"@tensorflow/tfjs-core":"2nuhV","../utils/fused_utils":"93hhz","./Add":"6fWFl","./DepthwiseConv2dNative":"fKbnx","@parcel/transformer-js/src/esmodule-helpers.js":"9pCYc"}],"4VTUV":[function(e,t,r){/** * @license * Copyright 2020 Google LLC. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. * ============================================================================= */var n=e("@parcel/transformer-js/src/esmodule-helpers.js");n.defineInteropFlag(r),n.export(r,"gatherNd",()=>o),n.export(r,"gatherNdConfig",()=>l);var s=e("@tensorflow/tfjs-core"),a=e("./GatherNd_Impl");function o(e){let{inputs:t,backend:r}=e,{params:n,indices:o}=t,l=(0,s.util).sizeFromShape(n.shape),i=o.shape,u=i[i.length-1],[p,c,d,f]=(0,s.backend_util).prepareAndValidate(n,o);if(0===c)return r.makeTensorInfo(p,n.dtype,[]);let h=r.data.get(o.dataId).values,m=r.bufferSync(n),g=(0,a.gatherNdImpl)(h,m,n.dtype,c,u,d,f,n.shape,l);return r.makeTensorInfo(p,n.dtype,g.values)}let l={kernelName:s.GatherNd,backendName:"cpu",kernelFunc:o}},{"@tensorflow/tfjs-core":"2nuhV","./GatherNd_Impl":"3CatI","@parcel/transformer-js/src/esmodule-helpers.js":"9pCYc"}],eJm0s:[function(e,t,r){/** * @license * Copyright 2020 Google LLC. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. * ============================================================================= */var n=e("@parcel/transformer-js/src/esmodule-helpers.js");n.defineInteropFlag(r),n.export(r,"gatherV2",()=>i),n.export(r,"gatherV2Config",()=>u);var s=e("@tensorflow/tfjs-core"),a=e("../cpu_util"),o=e("./GatherV2_impl"),l=e("./Reshape");function i(e){let{inputs:t,backend:r,attrs:n}=e,{x:i,indices:u}=t,{axis:p,batchDims:c}=n;(0,a.assertNotComplex)([i,u],"gatherV2");let d=(0,s.util).parseAxisParam(p,i.shape)[0],f=r.data.get(u.dataId).values,h=i.shape[d];for(let e=0;e=0,()=>`GatherV2: the index value ${t} is not in [0, ${h-1}]`)}let m=c;null==c&&(m=0);let g=(0,s.util).sizeFromShape(u.shape),x=(0,s.backend_util).segment_util.collectGatherOpShapeInfo(i,u,d,m),v=(0,l.reshape)({inputs:{x:i},backend:r,attrs:{shape:[x.batchSize,x.outerSize,x.dimSize,x.sliceSize]}}),y=(0,l.reshape)({inputs:{x:u},backend:r,attrs:{shape:[x.batchSize,g/x.batchSize]}}),b=[x.batchSize,x.outerSize,g/x.batchSize,x.sliceSize],_=r.bufferSync(y),k=r.bufferSync(v),j=(0,o.gatherV2Impl)(k,_,b);return r.disposeIntermediateTensorInfo(v),r.disposeIntermediateTensorInfo(y),r.makeTensorInfo(x.outputShape,j.dtype,j.values)}let u={kernelName:s.GatherV2,backendName:"cpu",kernelFunc:i}},{"@tensorflow/tfjs-core":"2nuhV","../cpu_util":"f1aYU","./GatherV2_impl":"8ZlmI","./Reshape":"dPbEE","@parcel/transformer-js/src/esmodule-helpers.js":"9pCYc"}],"1uE0o":[function(e,t,r){/** * @license * Copyright 2020 Google LLC. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. * ============================================================================= */var n=e("@parcel/transformer-js/src/esmodule-helpers.js");n.defineInteropFlag(r),n.export(r,"ifft",()=>l),n.export(r,"ifftConfig",()=>i);var s=e("@tensorflow/tfjs-core"),a=e("../utils/fft_utils"),o=e("./Reshape");function l(e){let{inputs:t,backend:r}=e,{input:n}=t,l=(0,s.util).sizeFromShape(n.shape),i=n.shape[n.shape.length-1],u=(0,o.reshape)({inputs:{x:n},backend:r,attrs:{shape:[l/i,i]}}),p=(0,a.fftBatch)(u,!0,r),c=(0,o.reshape)({inputs:{x:p},backend:r,attrs:{shape:n.shape}});return r.disposeIntermediateTensorInfo(u),r.disposeIntermediateTensorInfo(p),c}let i={kernelName:s.IFFT,backendName:"cpu",kernelFunc:l}},{"@tensorflow/tfjs-core":"2nuhV","../utils/fft_utils":"2lqKJ","./Reshape":"dPbEE","@parcel/transformer-js/src/esmodule-helpers.js":"9pCYc"}],aqQMH:[function(e,t,r){/** * @license * Copyright 2020 Google LLC. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the License); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an AS IS BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. * ============================================================================= */var n=e("@parcel/transformer-js/src/esmodule-helpers.js");n.defineInteropFlag(r),n.export(r,"isFinite",()=>a),n.export(r,"isFiniteConfig",()=>o);var s=e("@tensorflow/tfjs-core");let a=(0,e("../utils/unary_utils").unaryKernelFunc)(s.IsFinite,e=>Number.isFinite(e)?1:0,"bool"),o={kernelName:s.IsFinite,backendName:"cpu",kernelFunc:a}},{"@tensorflow/tfjs-core":"2nuhV","../utils/unary_utils":"i8gKT","@parcel/transformer-js/src/esmodule-helpers.js":"9pCYc"}],g2EK8:[function(e,t,r){/** * @license * Copyright 2020 Google LLC. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the License); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an AS IS BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. * ============================================================================= */var n=e("@parcel/transformer-js/src/esmodule-helpers.js");n.defineInteropFlag(r),n.export(r,"isInf",()=>a),n.export(r,"isInfConfig",()=>o);var s=e("@tensorflow/tfjs-core");let a=(0,e("../utils/unary_utils").unaryKernelFunc)(s.IsInf,e=>Math.abs(e)===1/0?1:0,"bool"),o={kernelName:s.IsInf,backendName:"cpu",kernelFunc:a}},{"@tensorflow/tfjs-core":"2nuhV","../utils/unary_utils":"i8gKT","@parcel/transformer-js/src/esmodule-helpers.js":"9pCYc"}],h4RGv:[function(e,t,r){/** * @license * Copyright 2020 Google LLC. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the License); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an AS IS BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. * ============================================================================= */var n=e("@parcel/transformer-js/src/esmodule-helpers.js");n.defineInteropFlag(r),n.export(r,"isNaN",()=>a),n.export(r,"isNaNConfig",()=>o);var s=e("@tensorflow/tfjs-core");let a=(0,e("../utils/unary_utils").unaryKernelFunc)(s.IsNan,e=>Number.isNaN(e)?1:0,"bool"),o={kernelName:s.IsNan,backendName:"cpu",kernelFunc:a}},{"@tensorflow/tfjs-core":"2nuhV","../utils/unary_utils":"i8gKT","@parcel/transformer-js/src/esmodule-helpers.js":"9pCYc"}],dM2R3:[function(e,t,r){/** * @license * Copyright 2020 Google LLC. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. * ============================================================================= */var n=e("@parcel/transformer-js/src/esmodule-helpers.js");n.defineInteropFlag(r),n.export(r,"linSpace",()=>o),n.export(r,"linSpaceConfig",()=>l);var s=e("@tensorflow/tfjs-core"),a=e("./LinSpace_impl");function o(e){let{backend:t,attrs:r}=e,{start:n,stop:s,num:o}=r,l=(0,a.linSpaceImpl)(n,s,o);return t.makeTensorInfo([l.length],"float32",l)}let l={kernelName:s.LinSpace,backendName:"cpu",kernelFunc:o}},{"@tensorflow/tfjs-core":"2nuhV","./LinSpace_impl":"6p1Nu","@parcel/transformer-js/src/esmodule-helpers.js":"9pCYc"}],hpigD:[function(e,t,r){/** * @license * Copyright 2020 Google LLC. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the License); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an AS IS BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. * ============================================================================= */var n=e("@parcel/transformer-js/src/esmodule-helpers.js");n.defineInteropFlag(r),n.export(r,"log1p",()=>a),n.export(r,"log1pConfig",()=>o);var s=e("@tensorflow/tfjs-core");let a=(0,e("../utils/unary_utils").unaryKernelFunc)(s.Log1p,e=>Math.log1p(e)),o={kernelName:s.Log1p,backendName:"cpu",kernelFunc:a}},{"@tensorflow/tfjs-core":"2nuhV","../utils/unary_utils":"i8gKT","@parcel/transformer-js/src/esmodule-helpers.js":"9pCYc"}],WRKR9:[function(e,t,r){/** * @license * Copyright 2020 Google LLC. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. * ============================================================================= */var n=e("@parcel/transformer-js/src/esmodule-helpers.js");n.defineInteropFlag(r),n.export(r,"logicalAndImpl",()=>l),n.export(r,"logicalAnd",()=>i),n.export(r,"logicalAndConfig",()=>u);var s=e("@tensorflow/tfjs-core"),a=e("../utils/binary_impl"),o=e("../utils/binary_utils");let l=(0,a.createSimpleBinaryKernelImpl)((e,t)=>e&&t),i=(0,o.binaryKernelFunc)(s.LogicalAnd,l,null,"bool"),u={kernelName:s.LogicalAnd,backendName:"cpu",kernelFunc:i}},{"@tensorflow/tfjs-core":"2nuhV","../utils/binary_impl":"8pFjz","../utils/binary_utils":"8GweL","@parcel/transformer-js/src/esmodule-helpers.js":"9pCYc"}],"4wBtc":[function(e,t,r){/** * @license * Copyright 2020 Google LLC. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the License); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an AS IS BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. * ============================================================================= */var n=e("@parcel/transformer-js/src/esmodule-helpers.js");n.defineInteropFlag(r),n.export(r,"logicalNot",()=>a),n.export(r,"logicalNotConfig",()=>o);var s=e("@tensorflow/tfjs-core");let a=(0,e("../utils/unary_utils").unaryKernelFunc)(s.LogicalNot,e=>e?0:1,"bool"),o={kernelName:s.LogicalNot,backendName:"cpu",kernelFunc:a}},{"@tensorflow/tfjs-core":"2nuhV","../utils/unary_utils":"i8gKT","@parcel/transformer-js/src/esmodule-helpers.js":"9pCYc"}],"9D8dO":[function(e,t,r){/** * @license * Copyright 2020 Google LLC. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. * ============================================================================= */var n=e("@parcel/transformer-js/src/esmodule-helpers.js");n.defineInteropFlag(r),n.export(r,"logicalOrImpl",()=>l),n.export(r,"logicalOr",()=>i),n.export(r,"logicalOrConfig",()=>u);var s=e("@tensorflow/tfjs-core"),a=e("../utils/binary_impl"),o=e("../utils/binary_utils");let l=(0,a.createSimpleBinaryKernelImpl)((e,t)=>e||t),i=(0,o.binaryKernelFunc)(s.LogicalOr,l,null,"bool"),u={kernelName:s.LogicalOr,backendName:"cpu",kernelFunc:i}},{"@tensorflow/tfjs-core":"2nuhV","../utils/binary_impl":"8pFjz","../utils/binary_utils":"8GweL","@parcel/transformer-js/src/esmodule-helpers.js":"9pCYc"}],iib5B:[function(e,t,r){/** * @license * Copyright 2020 Google LLC. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. * ============================================================================= */var n=e("@parcel/transformer-js/src/esmodule-helpers.js");n.defineInteropFlag(r),n.export(r,"lRN",()=>o),n.export(r,"LRNConfig",()=>l);var s=e("@tensorflow/tfjs-core"),a=e("../cpu_util");function o(e){let{inputs:t,backend:r,attrs:n}=e,{x:o}=t,{depthRadius:l,bias:i,alpha:u,beta:p}=n;(0,a.assertNotComplex)(o,"LRN");let c=o.shape[3],d=c-1,f=r.data.get(o.dataId).values,h=(0,s.util).sizeFromShape(o.shape),m=new Float32Array(h);for(let e=0;eo),n.export(r,"LRNGradConfig",()=>l);var s=e("@tensorflow/tfjs-core"),a=e("../cpu_util");function o(e){let{inputs:t,backend:r,attrs:n}=e,{x:o,y:l,dy:i}=t,{depthRadius:u,bias:p,alpha:c,beta:d}=n;(0,a.assertNotComplex)(i,"LRNGrad");let f=(0,s.util).sizeFromShape(i.shape),h=i.shape[3],m=r.data.get(i.dataId).values,g=r.data.get(o.dataId).values,x=r.data.get(l.dataId).values,v=new Float32Array(f);for(let e=0;ei),n.export(r,"maxConfig",()=>u);var s=e("@tensorflow/tfjs-core"),a=e("../cpu_util"),o=e("./Max_impl"),l=e("./Transpose_impl");function i(e){let{inputs:t,backend:r,attrs:n}=e,{x:i}=t,{reductionIndices:u,keepDims:p}=n,c=i.shape,d=c.length,f=(0,s.util).parseAxisParam(u,c),h=f,m=(0,s.backend_util).getAxesPermutation(h,d),g=r.data.get(i.dataId).values;if(null!=m){let e=Array(d);for(let t=0;ti),n.export(r,"maxPoolConfig",()=>u);var s=e("@tensorflow/tfjs-core"),a=e("../cpu_util"),o=e("../utils/pool_utils"),l=e("./Identity");function i(e){let t;let{inputs:r,backend:n,attrs:i}=e,{x:u}=r;(0,a.assertNotComplex)(u,"maxPool");let{filterSize:p,strides:c,pad:d,dimRoundingMode:f}=i;(0,s.util).assert((0,s.backend_util).eitherStridesOrDilationsAreOne(c,1),()=>`Error in maxPool: Either strides or dilations must be 1. Got strides ${c} and dilations '1'`);let h=(0,s.backend_util).computePool2DInfo(u.shape,p,c,1,d,f);if(1===h.filterWidth&&1===h.filterHeight&&(0,s.util).arraysEqual(h.inShape,h.outShape))t=(0,l.identity)({inputs:{x:u},backend:n});else{let e=n.data.get(u.dataId).values,r=(0,s.util).computeStrides(u.shape),a=(0,o.pool)(e,u.shape,u.dtype,r,h,"max");t=n.makeTensorInfo(h.outShape,u.dtype,a.values)}return t}let u={kernelName:s.MaxPool,backendName:"cpu",kernelFunc:i}},{"@tensorflow/tfjs-core":"2nuhV","../cpu_util":"f1aYU","../utils/pool_utils":"abWnJ","./Identity":"3hjd4","@parcel/transformer-js/src/esmodule-helpers.js":"9pCYc"}],"4r8Fk":[function(e,t,r){/** * @license * Copyright 2020 Google LLC. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. * ============================================================================= */var n=e("@parcel/transformer-js/src/esmodule-helpers.js");n.defineInteropFlag(r),n.export(r,"maxPool3D",()=>l),n.export(r,"maxPool3DConfig",()=>i);var s=e("@tensorflow/tfjs-core"),a=e("../cpu_util"),o=e("../utils/pool_utils");function l(e){let{inputs:t,backend:r,attrs:n}=e,{x:l}=t,{filterSize:i,strides:u,pad:p,dimRoundingMode:c,dataFormat:d}=n;(0,a.assertNotComplex)(l,"maxPool3d");let f=(0,s.backend_util).computePool3DInfo(l.shape,i,u,1,p,c,d),h=r.data.get(l.dataId).values,m=(0,o.pool3d)(h,l.shape,l.dtype,(0,s.util).computeStrides(l.shape),f,"max");return r.makeTensorInfo(m.shape,"float32",m.values)}let i={kernelName:s.MaxPool3D,backendName:"cpu",kernelFunc:l}},{"@tensorflow/tfjs-core":"2nuhV","../cpu_util":"f1aYU","../utils/pool_utils":"abWnJ","@parcel/transformer-js/src/esmodule-helpers.js":"9pCYc"}],go6gx:[function(e,t,r){/** * @license * Copyright 2020 Google LLC. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. * ============================================================================= */var n=e("@parcel/transformer-js/src/esmodule-helpers.js");n.defineInteropFlag(r),n.export(r,"maxPool3DGrad",()=>l),n.export(r,"maxPool3DGradConfig",()=>i);var s=e("@tensorflow/tfjs-core"),a=e("../cpu_util"),o=e("../utils/pool_utils");function l(e){let{inputs:t,backend:r,attrs:n}=e,{dy:l,input:i}=t,{filterSize:u,strides:p,pad:c,dimRoundingMode:d}=n;(0,a.assertNotComplex)([l,i],"maxPool3DGrad");let f=(0,s.backend_util).computePool3DInfo(i.shape,u,p,1,c,d),h=r.bufferSync(i),m=(0,o.maxPool3dPositions)(h,f),g=f.strideDepth,x=f.strideHeight,v=f.strideWidth,y=f.dilationDepth,b=f.dilationHeight,_=f.dilationWidth,k=f.effectiveFilterDepth,j=f.effectiveFilterHeight,I=f.effectiveFilterWidth,C=k-1-f.padInfo.front,w=I-1-f.padInfo.left,T=j-1-f.padInfo.top,S=(0,s.buffer)(i.shape,"float32"),N=r.bufferSync(l);for(let e=0;e=f.outDepth)&&Math.floor(n)===n)for(let s=0;s=f.outHeight)&&Math.floor(a)===a)for(let o=0;o=f.outWidth||Math.floor(u)!==u)continue;let p=k*j*I-1-m.get(e,n,a,u,t)===r*j*I+s*I+o?1:0;0!==p&&(i+=N.get(e,n,a,u,t)*p)}}}S.set(i,e,r,n,s,t)}return r.makeTensorInfo(S.shape,S.dtype,S.values)}let i={kernelName:s.MaxPool3DGrad,backendName:"cpu",kernelFunc:l}},{"@tensorflow/tfjs-core":"2nuhV","../cpu_util":"f1aYU","../utils/pool_utils":"abWnJ","@parcel/transformer-js/src/esmodule-helpers.js":"9pCYc"}],"03sl0":[function(e,t,r){/** * @license * Copyright 2020 Google LLC. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. * ============================================================================= */var n=e("@parcel/transformer-js/src/esmodule-helpers.js");n.defineInteropFlag(r),n.export(r,"maxPoolGrad",()=>l),n.export(r,"maxPoolGradConfig",()=>i);var s=e("@tensorflow/tfjs-core"),a=e("../cpu_util"),o=e("../utils/pool_utils");function l(e){let{inputs:t,backend:r,attrs:n}=e,{dy:l,input:i,output:u}=t;(0,a.assertNotComplex)([i,u],"maxPoolGrad");let{filterSize:p,strides:c,pad:d,dimRoundingMode:f}=n,h=(0,s.backend_util).computePool2DInfo(i.shape,p,c,1,d,f),m=r.data.get(i.dataId).values,g=(0,s.buffer)(h.outShape,i.dtype,(0,o.maxPoolPositions)(m,i.shape,i.dtype,h).values),x=h.strideHeight,v=h.strideWidth,y=h.dilationHeight,b=h.dilationWidth,_=h.effectiveFilterHeight,k=h.effectiveFilterWidth,j=k-1-h.padInfo.left,I=_-1-h.padInfo.top,C=(0,s.buffer)(i.shape,"float32"),w=r.data.get(l.dataId).values,T=(0,s.buffer)(l.shape,"float32",w);for(let e=0;e=h.outHeight)&&Math.floor(n)===n)for(let s=0;s=h.outWidth||Math.floor(l)!==l)continue;let i=_*k-1-g.get(e,n,l,t)===r*k+s?1:0;0!==i&&(o+=T.get(e,n,l,t)*i)}}C.set(o,e,r,n,t)}return r.makeTensorInfo(C.shape,C.dtype,C.values)}let i={kernelName:s.MaxPoolGrad,backendName:"cpu",kernelFunc:l}},{"@tensorflow/tfjs-core":"2nuhV","../cpu_util":"f1aYU","../utils/pool_utils":"abWnJ","@parcel/transformer-js/src/esmodule-helpers.js":"9pCYc"}],"38wrk":[function(e,t,r){/** * @license * Copyright 2020 Google LLC. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. * ============================================================================= */var n=e("@parcel/transformer-js/src/esmodule-helpers.js");n.defineInteropFlag(r),n.export(r,"maxPoolWithArgmaxConfig",()=>l);var s=e("@tensorflow/tfjs-core"),a=e("../cpu_util"),o=e("./MaxPoolWithArgmax_impl");let l={kernelName:s.MaxPoolWithArgmax,backendName:"cpu",kernelFunc:({inputs:e,attrs:t,backend:r})=>{let{x:n}=e,{filterSize:l,strides:i,pad:u,includeBatchInIndex:p}=t;(0,a.assertNotComplex)(n,"MaxPoolWithArgmax");let c=r.data.get(n.dataId).values,d=(0,s.backend_util).computePool2DInfo(n.shape,l,i,[1,1],u),[f,h]=(0,o.maxPoolWithArgmaxImpl)(c,n.shape,n.dtype,p,d),m=r.write(f,d.outShape,n.dtype),g=r.write(h,d.outShape,n.dtype);return[{dataId:m,shape:d.outShape,dtype:n.dtype},{dataId:g,shape:d.outShape,dtype:"int32"}]}}},{"@tensorflow/tfjs-core":"2nuhV","../cpu_util":"f1aYU","./MaxPoolWithArgmax_impl":"8aOYg","@parcel/transformer-js/src/esmodule-helpers.js":"9pCYc"}],"8aOYg":[function(e,t,r){/** * @license * Copyright 2020 Google LLC. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. * ============================================================================= */var n=e("@parcel/transformer-js/src/esmodule-helpers.js");n.defineInteropFlag(r),n.export(r,"maxPoolWithArgmaxImpl",()=>o);var s=e("@tensorflow/tfjs-core"),a=e("../utils/pool_utils");function o(e,t,r,n,o){let l=(0,s.util).computeStrides(t),i=(0,a.pool)(e,t,r,l,o,"max"),u=(0,a.maxPoolPositions)(e,t,r,o,!0,n);return[i.values,u.values]}},{"@tensorflow/tfjs-core":"2nuhV","../utils/pool_utils":"abWnJ","@parcel/transformer-js/src/esmodule-helpers.js":"9pCYc"}],"51tNr":[function(e,t,r){/** * @license * Copyright 2020 Google LLC. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. * ============================================================================= */var n=e("@parcel/transformer-js/src/esmodule-helpers.js");n.defineInteropFlag(r),n.export(r,"mean",()=>i),n.export(r,"meanConfig",()=>u);var s=e("@tensorflow/tfjs-core"),a=e("./Cast"),o=e("./RealDiv"),l=e("./Sum");function i(e){let{inputs:t,backend:r,attrs:n}=e,{x:i}=t,{axis:u,keepDims:p}=n,c=(0,s.util).parseAxisParam(u,i.shape),d=(0,s.backend_util).computeOutAndReduceShapes(i.shape,c)[1],f=(0,s.util).sizeFromShape(d),h=[],m=r.makeTensorInfo([],"float32",new Float32Array([f]));h.push(m);let g=(0,a.cast)({inputs:{x:i},backend:r,attrs:{dtype:"float32"}});h.push(g);let x=(0,o.div)({inputs:{a:g,b:m},backend:r});h.push(x);let v=(0,l.sum)({inputs:{x:x},backend:r,attrs:{axis:u,keepDims:p}});return h.forEach(e=>r.disposeIntermediateTensorInfo(e)),v}let u={kernelName:s.Mean,backendName:"cpu",kernelFunc:i}},{"@tensorflow/tfjs-core":"2nuhV","./Cast":"ep8e6","./RealDiv":"7Xr44","./Sum":"dI67n","@parcel/transformer-js/src/esmodule-helpers.js":"9pCYc"}],dYXE0:[function(e,t,r){/** * @license * Copyright 2020 Google LLC. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. * ============================================================================= */var n=e("@parcel/transformer-js/src/esmodule-helpers.js");n.defineInteropFlag(r),n.export(r,"min",()=>i),n.export(r,"minConfig",()=>u);var s=e("@tensorflow/tfjs-core"),a=e("../cpu_util"),o=e("./Reshape"),l=e("./Transpose");function i(e){let{inputs:t,backend:r,attrs:n}=e,{x:i}=t,{axis:u,keepDims:p}=n;(0,a.assertNotComplex)(i,"min");let c=(0,s.util).parseAxisParam(u,i.shape),d=c,f=(0,s.backend_util).getAxesPermutation(d,i.shape.length),h=i;null!=f&&(h=(0,l.transpose)({inputs:{x:i},backend:r,attrs:{perm:f}}),d=(0,s.backend_util).getInnerMostAxes(d.length,i.shape.length)),(0,s.backend_util).assertAxesAreInnerMostDims("min",d,h.shape.length);let[m,g]=(0,s.backend_util).computeOutAndReduceShapes(h.shape,d),x=(0,s.util).sizeFromShape(g),v=(0,s.util).makeZerosTypedArray((0,s.util).sizeFromShape(m),h.dtype),y=r.data.get(h.dataId).values;for(let e=0;eo),n.export(r,"mirrorPadConfig",()=>l);var s=e("@tensorflow/tfjs-core"),a=e("../cpu_util");function o(e){let{inputs:t,backend:r,attrs:n}=e,{x:o}=t,{paddings:l,mode:i}=n;(0,a.assertNotComplex)(o,"mirrorPad");let u=l.map((e,t)=>e[0]+o.shape[t]+e[1]),p=l.map(e=>e[0]),c=l.map((e,t)=>e[0]+o.shape[t]),d="reflect"===i?0:1,f=r.data.get(o.dataId).values,h=o.shape.length,m=(0,s.util).computeStrides(o.shape),g=(0,s.util).sizeFromShape(u),x=u.length,v=(0,s.util).computeStrides(u),y=(0,s.util).getTypedArrayFromDType(o.dtype,g);for(let e=0;e=c[e]&&(t[e]=(c[e]-1)*2-t[e]+d);t=t.map((e,t)=>e-p[t]);let r=(0,s.util).locToIndex(t,h,m);y[e]=f[r]}return{dataId:r.write(y,u,o.dtype),shape:u,dtype:o.dtype}}let l={kernelName:s.MirrorPad,backendName:"cpu",kernelFunc:o}},{"@tensorflow/tfjs-core":"2nuhV","../cpu_util":"f1aYU","@parcel/transformer-js/src/esmodule-helpers.js":"9pCYc"}],"6DvQH":[function(e,t,r){/** * @license * Copyright 2020 Google LLC. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. * ============================================================================= */var n=e("@parcel/transformer-js/src/esmodule-helpers.js");n.defineInteropFlag(r),n.export(r,"modImpl",()=>l),n.export(r,"mod",()=>i),n.export(r,"modConfig",()=>u);var s=e("@tensorflow/tfjs-core"),a=e("../utils/binary_impl"),o=e("../utils/binary_utils");let l=(0,a.createSimpleBinaryKernelImpl)((e,t)=>{let r=e%t;return e<0&&t<0||e>=0&&t>=0?r:(r+t)%t}),i=(0,o.binaryKernelFunc)(s.Mod,l),u={kernelName:s.Mod,backendName:"cpu",kernelFunc:i}},{"@tensorflow/tfjs-core":"2nuhV","../utils/binary_impl":"8pFjz","../utils/binary_utils":"8GweL","@parcel/transformer-js/src/esmodule-helpers.js":"9pCYc"}],"53zSQ":[function(e,t,r){/** * @license * Copyright 2020 Google LLC. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. * ============================================================================= */var n=e("@parcel/transformer-js/src/esmodule-helpers.js");n.defineInteropFlag(r),n.export(r,"multinomial",()=>i),n.export(r,"multinomialConfig",()=>u);var s=e("@tensorflow/tfjs-core"),a=e("seedrandom"),o=e("../cpu_util"),l=e("./Softmax");function i(e){let{inputs:t,backend:r,attrs:n}=e,{logits:i}=t,{numSamples:u,seed:p,normalized:c}=n;(0,o.assertNotComplex)(i,"multinomial");let d=c?i:(0,l.softmax)({inputs:{logits:i},backend:r,attrs:{dim:-1}}),f=d.shape[0],h=d.shape[1],m=r.data.get(d.dataId).values,g=[f,u],x=(0,s.util).makeZerosTypedArray((0,s.util).sizeFromShape(g),"int32");for(let e=0;ec),n.export(r,"softmaxConfig",()=>d);var s=e("@tensorflow/tfjs-core"),a=e("./Exp"),o=e("./Max"),l=e("./RealDiv"),i=e("./Reshape"),u=e("./Sub"),p=e("./Sum");function c(e){let{inputs:t,backend:r,attrs:n}=e,{logits:c}=t,{dim:d}=n,f=c.shape.length,h=d;if(-1===h&&(h=f-1),h!==f-1)throw Error(`Softmax along a non-last dimension is not yet supported. Logits was rank ${f} and dim was ${h}`);let m=(0,s.util).parseAxisParam([h],c.shape),g=(0,o.max)({inputs:{x:c},backend:r,attrs:{reductionIndices:m,keepDims:!1}}),x=(0,s.backend_util).expandShapeToKeepDim(g.shape,m),v=(0,i.reshape)({inputs:{x:g},backend:r,attrs:{shape:x}}),y=(0,u.sub)({inputs:{a:c,b:v},backend:r}),b=(0,a.exp)({inputs:{x:y},backend:r}),_=(0,p.sum)({inputs:{x:b},backend:r,attrs:{axis:m,keepDims:!1}}),k=(0,i.reshape)({inputs:{x:_},backend:r,attrs:{shape:x}}),j=(0,l.div)({inputs:{a:b,b:k},backend:r});return r.disposeIntermediateTensorInfo(g),r.disposeIntermediateTensorInfo(v),r.disposeIntermediateTensorInfo(y),r.disposeIntermediateTensorInfo(b),r.disposeIntermediateTensorInfo(_),r.disposeIntermediateTensorInfo(k),j}let d={kernelName:s.Softmax,backendName:"cpu",kernelFunc:c}},{"@tensorflow/tfjs-core":"2nuhV","./Exp":"7zaJk","./Max":"jPGdn","./RealDiv":"7Xr44","./Reshape":"dPbEE","./Sub":"7SQVx","./Sum":"dI67n","@parcel/transformer-js/src/esmodule-helpers.js":"9pCYc"}],"8sxFg":[function(e,t,r){/** * @license * Copyright 2020 Google LLC. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. * ============================================================================= */var n=e("@parcel/transformer-js/src/esmodule-helpers.js");n.defineInteropFlag(r),n.export(r,"nonMaxSuppressionV3",()=>l),n.export(r,"nonMaxSuppressionV3Config",()=>i);var s=e("@tensorflow/tfjs-core"),a=e("../cpu_util");let o=s.kernel_impls.nonMaxSuppressionV3Impl;function l(e){let{inputs:t,backend:r,attrs:n}=e,{boxes:s,scores:l}=t,{maxOutputSize:i,iouThreshold:u,scoreThreshold:p}=n;(0,a.assertNotComplex)(s,"NonMaxSuppression");let{selectedIndices:c}=o(r.data.get(s.dataId).values,r.data.get(l.dataId).values,i,u,p);return r.makeTensorInfo([c.length],"int32",new Int32Array(c))}let i={kernelName:s.NonMaxSuppressionV3,backendName:"cpu",kernelFunc:l}},{"@tensorflow/tfjs-core":"2nuhV","../cpu_util":"f1aYU","@parcel/transformer-js/src/esmodule-helpers.js":"9pCYc"}],"2RfCD":[function(e,t,r){/** * @license * Copyright 2020 Google LLC. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. * ============================================================================= */var n=e("@parcel/transformer-js/src/esmodule-helpers.js");n.defineInteropFlag(r),n.export(r,"nonMaxSuppressionV4",()=>l),n.export(r,"nonMaxSuppressionV4Config",()=>i);var s=e("@tensorflow/tfjs-core"),a=e("../cpu_util");let o=s.kernel_impls.nonMaxSuppressionV4Impl;function l(e){let{inputs:t,backend:r,attrs:n}=e,{boxes:s,scores:l}=t,{maxOutputSize:i,iouThreshold:u,scoreThreshold:p,padToMaxOutputSize:c}=n;(0,a.assertNotComplex)(s,"NonMaxSuppressionPadded");let{selectedIndices:d,validOutputs:f}=o(r.data.get(s.dataId).values,r.data.get(l.dataId).values,i,u,p,c);return[r.makeTensorInfo([d.length],"int32",new Int32Array(d)),r.makeTensorInfo([],"int32",new Int32Array([f]))]}let i={kernelName:s.NonMaxSuppressionV4,backendName:"cpu",kernelFunc:l}},{"@tensorflow/tfjs-core":"2nuhV","../cpu_util":"f1aYU","@parcel/transformer-js/src/esmodule-helpers.js":"9pCYc"}],"2rre1":[function(e,t,r){/** * @license * Copyright 2019 Google LLC. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. * ============================================================================= */var n=e("@parcel/transformer-js/src/esmodule-helpers.js");n.defineInteropFlag(r),n.export(r,"nonMaxSuppressionV5",()=>l),n.export(r,"nonMaxSuppressionV5Config",()=>i);var s=e("@tensorflow/tfjs-core"),a=e("../cpu_util");let o=s.kernel_impls.nonMaxSuppressionV5Impl;function l(e){let{inputs:t,backend:r,attrs:n}=e,{boxes:s,scores:l}=t,{maxOutputSize:i,iouThreshold:u,scoreThreshold:p,softNmsSigma:c}=n;(0,a.assertNotComplex)(s,"NonMaxSuppressionWithScore");let{selectedIndices:d,selectedScores:f}=o(r.data.get(s.dataId).values,r.data.get(l.dataId).values,i,u,p,c);return[r.makeTensorInfo([d.length],"int32",new Int32Array(d)),r.makeTensorInfo([f.length],"float32",new Float32Array(f))]}let i={kernelName:s.NonMaxSuppressionV5,backendName:"cpu",kernelFunc:l}},{"@tensorflow/tfjs-core":"2nuhV","../cpu_util":"f1aYU","@parcel/transformer-js/src/esmodule-helpers.js":"9pCYc"}],"4EvPs":[function(e,t,r){/** * @license * Copyright 2020 Google LLC. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. * ============================================================================= */var n=e("@parcel/transformer-js/src/esmodule-helpers.js");n.defineInteropFlag(r),n.export(r,"oneHot",()=>o),n.export(r,"oneHotConfig",()=>l);var s=e("@tensorflow/tfjs-core"),a=e("../cpu_util");function o(e){let{inputs:t,backend:r,attrs:n}=e,{indices:o}=t,{dtype:l,depth:i,onValue:u,offValue:p}=n;(0,a.assertNotComplex)(o,"oneHot");let c=(0,s.util).sizeFromShape(o.shape),d=new Float32Array(c*i);d.fill(p);let f=r.data.get(o.dataId).values;for(let e=0;e=0&&f[e]p),n.export(r,"onesLikeConfig",()=>c);var s=e("@tensorflow/tfjs-core"),a=e("./Complex"),o=e("./Fill"),l=e("./Imag"),i=e("./Real"),u=e("./ZerosLike");function p(e){let{inputs:t,backend:r}=e,{x:n}=t;if("string"===n.dtype)throw Error("onesLike is not supported for string tensors");if("complex64"!==n.dtype)return(0,o.fill)({backend:r,attrs:{shape:n.shape,value:1,dtype:n.dtype}});{let e=(0,i.real)({inputs:{input:n},backend:r}),t=p({inputs:{x:e},backend:r}),s=(0,l.imag)({inputs:{input:n},backend:r}),o=(0,u.zerosLike)({inputs:{x:s},backend:r}),c=(0,a.complex)({inputs:{real:t,imag:o},backend:r});return r.disposeIntermediateTensorInfo(e),r.disposeIntermediateTensorInfo(t),r.disposeIntermediateTensorInfo(s),r.disposeIntermediateTensorInfo(o),c}}let c={kernelName:s.OnesLike,backendName:"cpu",kernelFunc:p}},{"@tensorflow/tfjs-core":"2nuhV","./Complex":"6RuMJ","./Fill":"8pfO7","./Imag":"9zot5","./Real":"fn30c","./ZerosLike":"glvsx","@parcel/transformer-js/src/esmodule-helpers.js":"9pCYc"}],glvsx:[function(e,t,r){/** * @license * Copyright 2020 Google LLC. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. * ============================================================================= */var n=e("@parcel/transformer-js/src/esmodule-helpers.js");n.defineInteropFlag(r),n.export(r,"zerosLike",()=>u),n.export(r,"zerosLikeConfig",()=>p);var s=e("@tensorflow/tfjs-core"),a=e("./Complex"),o=e("./Fill"),l=e("./Imag"),i=e("./Real");function u(e){let{inputs:t,backend:r}=e,{x:n}=t;if("string"===n.dtype)throw Error("zerosLike is not supported for string tensors");if("complex64"!==n.dtype)return(0,o.fill)({backend:r,attrs:{shape:n.shape,value:0,dtype:n.dtype}});{let e=(0,i.real)({inputs:{input:n},backend:r}),t=u({inputs:{x:e},backend:r}),s=(0,l.imag)({inputs:{input:n},backend:r}),o=u({inputs:{x:s},backend:r}),p=(0,a.complex)({inputs:{real:t,imag:o},backend:r});return r.disposeIntermediateTensorInfo(e),r.disposeIntermediateTensorInfo(t),r.disposeIntermediateTensorInfo(s),r.disposeIntermediateTensorInfo(o),p}}let p={kernelName:s.ZerosLike,backendName:"cpu",kernelFunc:u}},{"@tensorflow/tfjs-core":"2nuhV","./Complex":"6RuMJ","./Fill":"8pfO7","./Imag":"9zot5","./Real":"fn30c","@parcel/transformer-js/src/esmodule-helpers.js":"9pCYc"}],gf163:[function(e,t,r){/** * @license * Copyright 2020 Google LLC. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. * ============================================================================= */var n=e("@parcel/transformer-js/src/esmodule-helpers.js");n.defineInteropFlag(r),n.export(r,"pack",()=>l),n.export(r,"packConfig",()=>i);var s=e("@tensorflow/tfjs-core"),a=e("./Concat"),o=e("./ExpandDims");function l(e){let{inputs:t,backend:r,attrs:n}=e,{axis:l}=n;if(1===t.length)return(0,o.expandDims)({inputs:{input:t[0]},backend:r,attrs:{dim:l}});let i=t[0].shape,u=t[0].dtype;t.forEach(e=>{(0,s.util).assertShapesMatch(i,e.shape,"All tensors passed to stack must have matching shapes"),(0,s.util).assert(u===e.dtype,()=>"All tensors passed to stack must have matching dtypes")});let p=[],c=t.map(e=>{let t=(0,o.expandDims)({inputs:{input:e},backend:r,attrs:{dim:l}});return p.push(t),t}),d=(0,a.concat)({inputs:c,backend:r,attrs:{axis:l}});return p.forEach(e=>r.disposeIntermediateTensorInfo(e)),d}let i={kernelName:s.Pack,backendName:"cpu",kernelFunc:l}},{"@tensorflow/tfjs-core":"2nuhV","./Concat":"h4dlo","./ExpandDims":"aVhKw","@parcel/transformer-js/src/esmodule-helpers.js":"9pCYc"}],"98BL8":[function(e,t,r){/** * @license * Copyright 2020 Google LLC. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. * ============================================================================= */var n=e("@parcel/transformer-js/src/esmodule-helpers.js");n.defineInteropFlag(r),n.export(r,"padV2",()=>o),n.export(r,"padV2Config",()=>l);var s=e("@tensorflow/tfjs-core"),a=e("../cpu_util");function o(e){let{inputs:t,backend:r,attrs:n}=e,{x:o}=t,{paddings:l,constantValue:i}=n;(0,a.assertNotComplex)(o,"pad");let u=l.map((e,t)=>e[0]+o.shape[t]+e[1]),p=l.map(e=>e[0]),c=r.data.get(o.dataId).values,d=(0,s.util).sizeFromShape(o.shape),f=o.shape.length,h=(0,s.util).computeStrides(o.shape),m=(0,s.util).sizeFromShape(u),g=u.length,x=(0,s.util).computeStrides(u),v=(0,s.util).getTypedArrayFromDType(o.dtype,m);0!==i&&v.fill(i);for(let e=0;ee+p[t]);v[(0,s.util).locToIndex(t,g,x)]=c[e]}return{dataId:r.write(v,u,o.dtype),shape:u,dtype:o.dtype}}let l={kernelName:s.PadV2,backendName:"cpu",kernelFunc:o}},{"@tensorflow/tfjs-core":"2nuhV","../cpu_util":"f1aYU","@parcel/transformer-js/src/esmodule-helpers.js":"9pCYc"}],"3z4q1":[function(e,t,r){/** * @license * Copyright 2020 Google LLC. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. * ============================================================================= */var n=e("@parcel/transformer-js/src/esmodule-helpers.js");n.defineInteropFlag(r),n.export(r,"powImpl",()=>l),n.export(r,"pow",()=>i),n.export(r,"powConfig",()=>u);var s=e("@tensorflow/tfjs-core"),a=e("../utils/binary_impl"),o=e("../utils/binary_utils");let l=(0,a.createSimpleBinaryKernelImpl)((e,t)=>Math.pow(e,t)),i=(0,o.binaryKernelFunc)(s.Pow,l),u={kernelName:s.Pow,backendName:"cpu",kernelFunc:i}},{"@tensorflow/tfjs-core":"2nuhV","../utils/binary_impl":"8pFjz","../utils/binary_utils":"8GweL","@parcel/transformer-js/src/esmodule-helpers.js":"9pCYc"}],"1OBpL":[function(e,t,r){/** * @license * Copyright 2022 Google LLC. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. * ============================================================================= */var n=e("@parcel/transformer-js/src/esmodule-helpers.js");n.defineInteropFlag(r),n.export(r,"raggedGather",()=>o),n.export(r,"raggedGatherConfig",()=>l);var s=e("@tensorflow/tfjs-core"),a=e("./RaggedGather_impl");function o(e){let{inputs:t,backend:r,attrs:n}=e,{paramsNestedSplits:s,paramsDenseValues:o,indices:l}=t,{outputRaggedRank:i}=n,u=s.map(e=>r.data.get(e.dataId).values),p=s.map(e=>e.shape),c=r.data.get(o.dataId).values,d=r.data.get(l.dataId).values,[f,h,m]=(0,a.raggedGatherImpl)(u,p,c,o.shape,o.dtype,d,l.shape,i),g=f.map(e=>r.makeTensorInfo([e.length],"int32",e)),x=r.makeTensorInfo(m,o.dtype,h);return g.concat([x])}let l={kernelName:s.RaggedGather,backendName:"cpu",kernelFunc:o}},{"@tensorflow/tfjs-core":"2nuhV","./RaggedGather_impl":"fcLqF","@parcel/transformer-js/src/esmodule-helpers.js":"9pCYc"}],czVpb:[function(e,t,r){/** * @license * Copyright 2022 Google LLC. * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. * ============================================================================= */var n=e("@parcel/transformer-js/src/esmodule-helpers.js");n.defineInteropFlag(r),n.export(r,"raggedRange",()=>o),n.export(r,"raggedRangeConfig",()=>l);var s=e("@tensorflow/tfjs-core"),a=e("./RaggedRange_impl");function o(e){let{inputs:t,backend:r}=e,{starts:n,limits:s,deltas:o}=t,l=r.data.get(n.dataId).values,i=r.data.get(s.dataId).values,u=r.data.get(o.dataId).values,[p,c]=(0,a.raggedRangeImpl)(l,n.shape,n.dtype,i,s.shape,u,o.shape);return[r.makeTensorInfo([p.length],"int32",p),r.makeTensorInfo([c.length],n.dtype,c)]}let l={kernelName:s.RaggedRange,backendName:"cpu",kernelFunc:o}},{"@tensorflow/tfjs-core":"2nuhV","./RaggedRange_impl":"iG5nk","@parcel/transformer-js/src/esmodule-helpers.js":"9pCYc"}],eI5aC:[function(e,t,r){/** * @license * Copyright 2022 Google LLC. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. * ============================================================================= */var n=e("@parcel/transformer-js/src/esmodule-helpers.js");n.defineInteropFlag(r),n.export(r,"raggedTensorToTensor",()=>o),n.export(r,"raggedTensorToTensorConfig",()=>l);var s=e("@tensorflow/tfjs-core"),a=e("./RaggedTensorToTensor_impl");function o(e){let{inputs:t,backend:r,attrs:n}=e,{shape:s,values:o,defaultValue:l,rowPartitionTensors:i}=t,{rowPartitionTypes:u}=n,p=r.data.get(s.dataId).values,c=r.data.get(o.dataId).values,d=r.data.get(l.dataId).values,f=i.map(e=>r.data.get(e.dataId).values),h=i.map(e=>e.shape),[m,g]=(0,a.raggedTensorToTensorImpl)(p,s.shape,c,o.shape,o.dtype,d,l.shape,f,h,u);return r.makeTensorInfo(m,o.dtype,g)}let l={kernelName:s.RaggedTensorToTensor,backendName:"cpu",kernelFunc:o}},{"@tensorflow/tfjs-core":"2nuhV","./RaggedTensorToTensor_impl":"ljPoB","@parcel/transformer-js/src/esmodule-helpers.js":"9pCYc"}],de0wV:[function(e,t,r){/** * @license * Copyright 2020 Google LLC. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. * ============================================================================= */var n=e("@parcel/transformer-js/src/esmodule-helpers.js");n.defineInteropFlag(r),n.export(r,"range",()=>o),n.export(r,"rangeConfig",()=>l);var s=e("@tensorflow/tfjs-core"),a=e("./Range_impl");function o(e){let{backend:t,attrs:r}=e,{start:n,stop:s,dtype:o,step:l}=r,i=(0,a.rangeImpl)(n,s,l,o);return t.makeTensorInfo([i.length],o,i)}let l={kernelName:s.Range,backendName:"cpu",kernelFunc:o}},{"@tensorflow/tfjs-core":"2nuhV","./Range_impl":"ktDJX","@parcel/transformer-js/src/esmodule-helpers.js":"9pCYc"}],"8xR15":[function(e,t,r){/** * @license * Copyright 2020 Google LLC. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the License); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an AS IS BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. * ============================================================================= */var n=e("@parcel/transformer-js/src/esmodule-helpers.js");n.defineInteropFlag(r),n.export(r,"reciprocal",()=>a),n.export(r,"reciprocalConfig",()=>o);var s=e("@tensorflow/tfjs-core");let a=(0,e("../utils/unary_utils").unaryKernelFunc)(s.Reciprocal,e=>1/e),o={kernelName:s.Reciprocal,backendName:"cpu",kernelFunc:a}},{"@tensorflow/tfjs-core":"2nuhV","../utils/unary_utils":"i8gKT","@parcel/transformer-js/src/esmodule-helpers.js":"9pCYc"}],cUNUK:[function(e,t,r){/** * @license * Copyright 2020 Google LLC. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. * ============================================================================= */var n=e("@parcel/transformer-js/src/esmodule-helpers.js");n.defineInteropFlag(r),n.export(r,"resizeBilinear",()=>o),n.export(r,"resizeBilinearConfig",()=>l);var s=e("@tensorflow/tfjs-core"),a=e("../cpu_util");function o(e){let{inputs:t,backend:r,attrs:n}=e,{images:o}=t,{alignCorners:l,halfPixelCenters:i,size:u}=n;(0,a.assertNotComplex)(o,"resizeBilinear");let p=(0,s.util).computeStrides(o.shape),[c,d]=u,[f,h,m,g]=o.shape,x=r.data.get(o.dataId).values,v=new Float32Array((0,s.util).sizeFromShape([f,c,d,g])),y=[l&&c>1?h-1:h,l&&d>1?m-1:m],b=[l&&c>1?c-1:c,l&&d>1?d-1:d],_=0,k=y[0]/b[0],j=y[1]/b[1];for(let e=0;eo),n.export(r,"resizeBilinearGradConfig",()=>l);var s=e("@tensorflow/tfjs-core"),a=e("../cpu_util");function o(e){let{inputs:t,backend:r,attrs:n}=e,{images:o,dy:l}=t,{alignCorners:i}=n;(0,a.assertNotComplex)([l,o],"resizeBilinearGrad");let u=(0,s.util).computeStrides(o.shape),[p,c,d,f]=o.shape,[,h,m]=l.shape,g=new Float32Array(p*c*d*f),x=[i&&h>1?c-1:c,i&&m>1?d-1:d],v=[i&&h>1?h-1:h,i&&m>1?m-1:m],y=x[0]/v[0],b=x[1]/v[1],_=r.data.get(l.dataId).values,k=0;for(let e=0;eo),n.export(r,"resizeNearestNeighborConfig",()=>l);var s=e("@tensorflow/tfjs-core"),a=e("../cpu_util");function o(e){let{inputs:t,backend:r,attrs:n}=e,{images:o}=t,{alignCorners:l,halfPixelCenters:i,size:u}=n;(0,a.assertNotComplex)(o,"resizeNearestNeighbor");let p=(0,s.util).computeStrides(o.shape),[c,d]=u,[f,h,m,g]=o.shape,x=r.data.get(o.dataId).values,v=new Float32Array(f*c*d*g),y=[l&&c>1?h-1:h,l&&d>1?m-1:m],b=[l&&c>1?c-1:c,l&&d>1?d-1:d],_=y[0]/b[0],k=y[1]/b[1],j=0;for(let e=0;eo),n.export(r,"resizeNearestNeighborGradConfig",()=>l);var s=e("@tensorflow/tfjs-core"),a=e("../cpu_util");function o(e){let{inputs:t,backend:r,attrs:n}=e,{images:o,dy:l}=t,{alignCorners:i}=n;(0,a.assertNotComplex)([l,o],"resizeNearestNeighborGrad");let u=(0,s.util).computeStrides(o.shape),p=(0,s.util).computeStrides(l.shape),[c,d,f,h]=o.shape,[,m,g]=l.shape,x=new Float32Array(c*d*f*h),v=r.data.get(l.dataId).values,y=[i&&m>1?d-1:d,i&&g>1?f-1:f],b=[i&&m>1?m-1:m,i&&g>1?g-1:g],_=y[0]/b[0],k=y[1]/b[1],j=1/_,I=1/k,C=2*Math.ceil(j)+2,w=2*Math.ceil(I)+2;for(let e=0;e=m)continue;let c=t+u*p[1],h=u*_;if(e===Math.min(d-1,i?Math.round(h):Math.floor(h)))for(let e=0;e=g)continue;let n=c+t*p[2],a=t*k;s===Math.min(f-1,i?Math.round(a):Math.floor(a))&&(l+=v[n+r])}}x[a+r]=l}}}}return r.makeTensorInfo(o.shape,o.dtype,x)}let l={kernelName:s.ResizeNearestNeighborGrad,backendName:"cpu",kernelFunc:o}},{"@tensorflow/tfjs-core":"2nuhV","../cpu_util":"f1aYU","@parcel/transformer-js/src/esmodule-helpers.js":"9pCYc"}],axIGZ:[function(e,t,r){/** * @license * Copyright 2020 Google LLC. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. * ============================================================================= */var n=e("@parcel/transformer-js/src/esmodule-helpers.js");n.defineInteropFlag(r),n.export(r,"reverse",()=>l),n.export(r,"reverseConfig",()=>i);var s=e("@tensorflow/tfjs-core"),a=e("../cpu_util"),o=e("./Identity");function l(e){let{inputs:t,backend:r,attrs:n}=e,{x:l}=t,{dims:i}=n;(0,a.assertNotComplex)(l,"reverse");let u=l.shape.length,p=(0,s.util).parseAxisParam(i,l.shape);if(0===u)return(0,o.identity)({inputs:{x:l},backend:r});let c=new s.TensorBuffer(l.shape,l.dtype),d=r.bufferSync(l);for(let e=0;er[e]=l.shape[e]-1-r[e]),c.set(d.get(...r),...t)}return r.makeTensorInfo(c.shape,c.dtype,c.values)}let i={kernelName:s.Reverse,backendName:"cpu",kernelFunc:l}},{"@tensorflow/tfjs-core":"2nuhV","../cpu_util":"f1aYU","./Identity":"3hjd4","@parcel/transformer-js/src/esmodule-helpers.js":"9pCYc"}],caMVV:[function(e,t,r){/** * @license * Copyright 2020 Google LLC. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. * ============================================================================= */var n=e("@parcel/transformer-js/src/esmodule-helpers.js");n.defineInteropFlag(r),n.export(r,"rotateWithOffsetConfig",()=>a);var s=e("@tensorflow/tfjs-core");let a={kernelName:s.RotateWithOffset,backendName:"cpu",kernelFunc:({inputs:e,attrs:t,backend:r})=>{let{image:n}=e,{radians:a,fillValue:o,center:l}=t,i=(0,s.util).getTypedArrayFromDType(n.dtype,(0,s.util).sizeFromShape(n.shape)),[u,p,c,d]=n.shape,[f,h]=(0,s.backend_util).getImageCenter(l,p,c),m=Math.sin(a),g=Math.cos(a),x=r.data.get(n.dataId).values;for(let e=0;e=0&&b=0&&_a),n.export(r,"roundConfig",()=>o);var s=e("@tensorflow/tfjs-core");let a=(0,e("../utils/unary_utils").unaryKernelFunc)(s.Round,e=>{let t=Math.floor(e);return e-t<.5?Math.floor(e):e-t>.5?Math.ceil(e):t%2==0?t:t+1}),o={kernelName:s.Round,backendName:"cpu",kernelFunc:a}},{"@tensorflow/tfjs-core":"2nuhV","../utils/unary_utils":"i8gKT","@parcel/transformer-js/src/esmodule-helpers.js":"9pCYc"}],"7HK94":[function(e,t,r){/** * @license * Copyright 2020 Google LLC. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. * ============================================================================= */var n=e("@parcel/transformer-js/src/esmodule-helpers.js");n.defineInteropFlag(r),n.export(r,"scatterNd",()=>o),n.export(r,"scatterNdConfig",()=>l);var s=e("@tensorflow/tfjs-core"),a=e("./Scatter_impl");function o(e){let{inputs:t,backend:r,attrs:n}=e,{indices:o,updates:l}=t,{shape:i}=n,{sliceRank:u,numUpdates:p,sliceSize:c,strides:d,outputSize:f}=(0,s.backend_util).calculateShapes(l,o,i),h=r.bufferSync(o),m=r.bufferSync(l),g=(0,a.scatterImpl)(h,m,i,f,c,p,u,d,0,!0);return r.makeTensorInfo(i,g.dtype,g.values)}let l={kernelName:s.ScatterNd,backendName:"cpu",kernelFunc:o}},{"@tensorflow/tfjs-core":"2nuhV","./Scatter_impl":"f9QJS","@parcel/transformer-js/src/esmodule-helpers.js":"9pCYc"}],"1BUte":[function(e,t,r){/** * @license * Copyright 2022 Google LLC. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. * ============================================================================= */var n=e("@parcel/transformer-js/src/esmodule-helpers.js");n.defineInteropFlag(r),n.export(r,"searchSorted",()=>o),n.export(r,"searchSortedConfig",()=>l);var s=e("@tensorflow/tfjs-core"),a=e("./SearchSorted_impl");function o(e){let{inputs:t,backend:r,attrs:n}=e,{sortedSequence:s,values:o}=t,{side:l}=n,i=r.data.get(s.dataId).values,u=r.data.get(o.dataId).values,p=(0,a.searchSortedImpl)(i,u,s.shape[0],s.shape[1],o.shape[1],l);return r.makeTensorInfo(o.shape,"int32",p)}let l={kernelName:s.SearchSorted,backendName:"cpu",kernelFunc:o}},{"@tensorflow/tfjs-core":"2nuhV","./SearchSorted_impl":"ddgxo","@parcel/transformer-js/src/esmodule-helpers.js":"9pCYc"}],ddgxo:[function(e,t,r){/** * @license * Copyright 2022 Google LLC. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. * ============================================================================= */var n=e("@parcel/transformer-js/src/esmodule-helpers.js");n.defineInteropFlag(r),n.export(r,"searchSortedImpl",()=>a);var s=e("@tensorflow/tfjs-core");function a(e,t,r,n,a,o){let l=(0,s.util).getArrayFromDType("int32",r*a);for(let s=0;so),n.export(r,"selectConfig",()=>l);var s=e("@tensorflow/tfjs-core"),a=e("../cpu_util");function o(e){let{inputs:t,backend:r}=e,{condition:n,t:o,e:l}=t;(0,a.assertNotComplex)([n,o,l],"select");let i=n.shape.length,u=r.data.get(n.dataId).values,p=r.data.get(o.dataId).values,c=r.data.get(l.dataId).values,d=(0,s.upcastType)(o.dtype,l.dtype),f=(0,s.util).makeZerosTypedArray((0,s.util).sizeFromShape(o.shape),d),h=0,m=0===i||i>1||1===o.shape.length?1:(0,s.util).sizeFromShape(o.shape.slice(1));for(let e=0;ei),n.export(r,"seluConfig",()=>u);var s=e("@tensorflow/tfjs-core"),a=e("../utils/unary_utils");let o=s.backend_util.SELU_SCALEALPHA,l=s.backend_util.SELU_SCALE,i=(0,a.unaryKernelFunc)(s.Selu,e=>e>=0?l*e:o*(Math.exp(e)-1)),u={kernelName:s.Selu,backendName:"cpu",kernelFunc:i}},{"@tensorflow/tfjs-core":"2nuhV","../utils/unary_utils":"i8gKT","@parcel/transformer-js/src/esmodule-helpers.js":"9pCYc"}],"79sfz":[function(e,t,r){/** * @license * Copyright 2020 Google LLC. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the License); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an AS IS BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. * ============================================================================= */var n=e("@parcel/transformer-js/src/esmodule-helpers.js");n.defineInteropFlag(r),n.export(r,"sign",()=>a),n.export(r,"signConfig",()=>o);var s=e("@tensorflow/tfjs-core");let a=(0,e("../utils/unary_utils").unaryKernelFunc)(s.Sign,e=>e<0?-1:e>0?1:0),o={kernelName:s.Sign,backendName:"cpu",kernelFunc:a}},{"@tensorflow/tfjs-core":"2nuhV","../utils/unary_utils":"i8gKT","@parcel/transformer-js/src/esmodule-helpers.js":"9pCYc"}],"91XEC":[function(e,t,r){/** * @license * Copyright 2020 Google LLC. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the License); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an AS IS BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. * ============================================================================= */var n=e("@parcel/transformer-js/src/esmodule-helpers.js");n.defineInteropFlag(r),n.export(r,"sin",()=>a),n.export(r,"sinConfig",()=>o);var s=e("@tensorflow/tfjs-core");let a=(0,e("../utils/unary_utils").unaryKernelFunc)(s.Sin,e=>Math.sin(e)),o={kernelName:s.Sin,backendName:"cpu",kernelFunc:a}},{"@tensorflow/tfjs-core":"2nuhV","../utils/unary_utils":"i8gKT","@parcel/transformer-js/src/esmodule-helpers.js":"9pCYc"}],"3XxSk":[function(e,t,r){/** * @license * Copyright 2020 Google LLC. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the License); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an AS IS BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. * ============================================================================= */var n=e("@parcel/transformer-js/src/esmodule-helpers.js");n.defineInteropFlag(r),n.export(r,"sinh",()=>a),n.export(r,"sinhConfig",()=>o);var s=e("@tensorflow/tfjs-core");let a=(0,e("../utils/unary_utils").unaryKernelFunc)(s.Sinh,e=>Math.sinh(e)),o={kernelName:s.Sinh,backendName:"cpu",kernelFunc:a}},{"@tensorflow/tfjs-core":"2nuhV","../utils/unary_utils":"i8gKT","@parcel/transformer-js/src/esmodule-helpers.js":"9pCYc"}],"9VyDT":[function(e,t,r){/** * @license * Copyright 2020 Google LLC. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the License); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an AS IS BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. * ============================================================================= */var n=e("@parcel/transformer-js/src/esmodule-helpers.js");n.defineInteropFlag(r),n.export(r,"softplus",()=>l),n.export(r,"softplusConfig",()=>i);var s=e("@tensorflow/tfjs-core"),a=e("../utils/unary_utils");let o=Math.log(11920928955078125e-23)+2,l=(0,a.unaryKernelFunc)(s.Softplus,e=>{let t=Math.exp(e);return e-o?e:Math.log(1+t)}),i={kernelName:s.Softplus,backendName:"cpu",kernelFunc:l}},{"@tensorflow/tfjs-core":"2nuhV","../utils/unary_utils":"i8gKT","@parcel/transformer-js/src/esmodule-helpers.js":"9pCYc"}],"5juQa":[function(e,t,r){/** * @license * Copyright 2020 Google LLC. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. * ============================================================================= */var n=e("@parcel/transformer-js/src/esmodule-helpers.js");n.defineInteropFlag(r),n.export(r,"spaceToBatchND",()=>u),n.export(r,"spaceToBatchNDConfig",()=>p);var s=e("@tensorflow/tfjs-core"),a=e("../cpu_util"),o=e("./PadV2"),l=e("./Reshape"),i=e("./Transpose");function u(e){let{inputs:t,backend:r,attrs:n}=e,{x:u}=t,{blockShape:p,paddings:c}=n;(0,a.assertNotComplex)([u],"spaceToBatchND");let d=(0,s.util).sizeFromShape(p),f=[[0,0]];f.push(...c);for(let e=1+p.length;eo),n.export(r,"sparseFillEmptyRowsConfig",()=>l);var s=e("@tensorflow/tfjs-core"),a=e("./SparseFillEmptyRows_impl");function o(e){let{inputs:t,backend:r}=e,{indices:n,values:s,denseShape:o,defaultValue:l}=t;if(1!==o.shape.length)throw Error(`Dense shape must be a vector, saw: ${o.shape}`);if(2!==n.shape.length)throw Error(`Indices must be a matrix, saw: ${n.shape}`);if(1!==s.shape.length)throw Error(`Values must be a vector, saw: ${s.shape}`);if(0!==l.shape.length)throw Error(`Default value must be a scalar, saw: ${l.shape}`);let i=r.data.get(n.dataId).values,u=r.data.get(s.dataId).values,p=r.data.get(o.dataId).values,c=r.data.get(l.dataId).values[0],[d,f,h,m,g]=(0,a.sparseFillEmptyRowsImpl)(i,n.shape,n.dtype,u,s.dtype,p,c);return[r.makeTensorInfo(f,n.dtype,d),r.makeTensorInfo([f[0]],s.dtype,h),r.makeTensorInfo([m.length],"bool",new Uint8Array(m.map(e=>Number(e)))),r.makeTensorInfo([g.length],n.dtype,new Int32Array(g))]}let l={kernelName:s.SparseFillEmptyRows,backendName:"cpu",kernelFunc:o}},{"@tensorflow/tfjs-core":"2nuhV","./SparseFillEmptyRows_impl":"lHwnD","@parcel/transformer-js/src/esmodule-helpers.js":"9pCYc"}],cUix9:[function(e,t,r){/** * @license * Copyright 2021 Google LLC. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. * ============================================================================= */var n=e("@parcel/transformer-js/src/esmodule-helpers.js");n.defineInteropFlag(r),n.export(r,"sparseReshape",()=>o),n.export(r,"sparseReshapeConfig",()=>l);var s=e("@tensorflow/tfjs-core"),a=e("./SparseReshape_impl");function o(e){let{inputs:t,backend:r}=e,{inputIndices:n,inputShape:s,newShape:o}=t;if(2!==n.shape.length)throw Error(`Input indices should be a matrix but received shape ${n.shape}`);if(1!==s.shape.length)throw Error(`Input shape should be a vector but received shape ${s.shape}`);if(1!==o.shape.length)throw Error(`Target shape should be a vector but received shape ${o.shape}`);let l=Array.from(r.data.get(s.dataId).values),i=r.data.get(n.dataId).values,u=Array.from(r.data.get(o.dataId).values),[p,c,d]=(0,a.sparseReshapeImpl)(i,n.shape,n.dtype,l,u);return[r.makeTensorInfo(c,n.dtype,p),r.makeTensorInfo([d.length],o.dtype,new Int32Array(d))]}let l={kernelName:s.SparseReshape,backendName:"cpu",kernelFunc:o}},{"@tensorflow/tfjs-core":"2nuhV","./SparseReshape_impl":"1QTPX","@parcel/transformer-js/src/esmodule-helpers.js":"9pCYc"}],f9b7f:[function(e,t,r){/** * @license * Copyright 2021 Google LLC. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. * ============================================================================= */var n=e("@parcel/transformer-js/src/esmodule-helpers.js");n.defineInteropFlag(r),n.export(r,"sparseSegmentMean",()=>o),n.export(r,"sparseSegmentMeanConfig",()=>l);var s=e("@tensorflow/tfjs-core"),a=e("./SparseSegmentReduction_impl");function o(e){let{inputs:t,backend:r}=e,{data:n,indices:s,segmentIds:o}=t;if(n.shape.length<1)throw Error("Data should be at least 1 dimensional but received scalar");if(1!==s.shape.length)throw Error(`Indices should be a vector but received shape ${s.shape}`);if(1!==o.shape.length)throw Error(`Segment ids should be a vector but received shape ${o.shape}`);if(s.shape[0]!==o.shape[0])throw Error("segmentIds and indices should have same size.");let l=r.data.get(n.dataId).values,i=r.data.get(s.dataId).values,u=r.data.get(o.dataId).values,[p,c]=(0,a.sparseSegmentReductionImpl)(l,n.shape,n.dtype,i,u,!0);return r.makeTensorInfo(c,n.dtype,p)}let l={kernelName:s.SparseSegmentMean,backendName:"cpu",kernelFunc:o}},{"@tensorflow/tfjs-core":"2nuhV","./SparseSegmentReduction_impl":"8zLRT","@parcel/transformer-js/src/esmodule-helpers.js":"9pCYc"}],"6hEAP":[function(e,t,r){/** * @license * Copyright 2021 Google LLC. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. * ============================================================================= */var n=e("@parcel/transformer-js/src/esmodule-helpers.js");n.defineInteropFlag(r),n.export(r,"sparseSegmentSum",()=>o),n.export(r,"sparseSegmentSumConfig",()=>l);var s=e("@tensorflow/tfjs-core"),a=e("./SparseSegmentReduction_impl");function o(e){let{inputs:t,backend:r}=e,{data:n,indices:s,segmentIds:o}=t;if(n.shape.length<1)throw Error("Data should be at least 1 dimensional but received scalar");if(1!==s.shape.length)throw Error(`Indices should be a vector but received shape ${s.shape}`);if(1!==o.shape.length)throw Error(`Segment ids should be a vector but received shape ${o.shape}`);if(s.shape[0]!==o.shape[0])throw Error("segmentIds and indices should have same size.");let l=r.data.get(n.dataId).values,i=r.data.get(s.dataId).values,u=r.data.get(o.dataId).values,[p,c]=(0,a.sparseSegmentReductionImpl)(l,n.shape,n.dtype,i,u);return r.makeTensorInfo(c,n.dtype,p)}let l={kernelName:s.SparseSegmentSum,backendName:"cpu",kernelFunc:o}},{"@tensorflow/tfjs-core":"2nuhV","./SparseSegmentReduction_impl":"8zLRT","@parcel/transformer-js/src/esmodule-helpers.js":"9pCYc"}],"9Ntuz":[function(e,t,r){/** * @license * Copyright 2020 Google LLC. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. * ============================================================================= */var n=e("@parcel/transformer-js/src/esmodule-helpers.js");n.defineInteropFlag(r),n.export(r,"sparseToDense",()=>o),n.export(r,"sparseToDenseConfig",()=>l);var s=e("@tensorflow/tfjs-core"),a=e("./Scatter_impl");function o(e){let t;let{inputs:r,backend:n,attrs:o}=e,{sparseIndices:l,sparseValues:i,defaultValue:u}=r,{outputShape:p}=o,{sliceRank:c,numUpdates:d,sliceSize:f,strides:h,outputSize:m}=(0,s.backend_util).calculateShapes(i,l,p),g=n.bufferSync(l);switch(i.dtype){case"bool":{let e=n.bufferSync(i),r=!!n.data.get(u.dataId).values[0];t=(0,a.scatterImpl)(g,e,p,m,f,d,c,h,r,!1);break}case"float32":{let e=n.bufferSync(i),r=n.data.get(u.dataId).values[0];t=(0,a.scatterImpl)(g,e,p,m,f,d,c,h,r,!1);break}case"int32":{let e=n.bufferSync(i),r=n.data.get(u.dataId).values[0];t=(0,a.scatterImpl)(g,e,p,m,f,d,c,h,r,!1);break}case"string":{let e=n.bufferSync(i),r=(0,s.util).decodeString(n.data.get(u.dataId).values[0]);t=(0,a.scatterImpl)(g,e,p,m,f,d,c,h,r,!1);break}default:throw Error(`Unsupported type ${i.dtype}`)}return n.makeTensorInfo(p,t.dtype,t.values)}let l={kernelName:s.SparseToDense,backendName:"cpu",kernelFunc:o}},{"@tensorflow/tfjs-core":"2nuhV","./Scatter_impl":"f9QJS","@parcel/transformer-js/src/esmodule-helpers.js":"9pCYc"}],"3dfoP":[function(e,t,r){/** * @license * Copyright 2020 Google LLC. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. * ============================================================================= */var n=e("@parcel/transformer-js/src/esmodule-helpers.js");n.defineInteropFlag(r),n.export(r,"splitV",()=>o),n.export(r,"splitVConfig",()=>l);var s=e("@tensorflow/tfjs-core"),a=e("./Slice");function o(e){let{inputs:t,backend:r,attrs:n}=e,{x:o}=t,{numOrSizeSplits:l,axis:i}=n,u=(0,s.util).parseAxisParam(i,o.shape)[0],p=(0,s.backend_util).prepareSplitSize(o,l,u),c=Array(o.shape.length).fill(0),d=o.shape.slice();return p.map(e=>{let t=[...d];t[u]=e;let n=(0,a.slice)({inputs:{x:o},backend:r,attrs:{begin:c,size:t}});return c[u]+=e,n})}let l={kernelName:s.SplitV,backendName:"cpu",kernelFunc:o}},{"@tensorflow/tfjs-core":"2nuhV","./Slice":"loZC8","@parcel/transformer-js/src/esmodule-helpers.js":"9pCYc"}],lkA36:[function(e,t,r){/** * @license * Copyright 2019 Google LLC. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. * ============================================================================= */var n=e("@parcel/transformer-js/src/esmodule-helpers.js");n.defineInteropFlag(r),n.export(r,"squareConfig",()=>o);var s=e("@tensorflow/tfjs-core"),a=e("../cpu_util");let o={kernelName:s.Square,backendName:"cpu",kernelFunc:({inputs:e,backend:t})=>{let{x:r}=e;(0,a.assertNotComplex)(r,"square");let n=t.data.get(r.dataId).values,s=new Float32Array(n.length);for(let e=0;ea),n.export(r,"stepConfig",()=>o);var s=e("@tensorflow/tfjs-core");let a=(0,e("../utils/unary_utils").unaryKernelFunc)(s.Step,(e,t)=>isNaN(e)?NaN:e>0?1:t.alpha),o={kernelName:s.Step,backendName:"cpu",kernelFunc:a}},{"@tensorflow/tfjs-core":"2nuhV","../utils/unary_utils":"i8gKT","@parcel/transformer-js/src/esmodule-helpers.js":"9pCYc"}],"6Yrik":[function(e,t,r){/** * @license * Copyright 2020 Google LLC. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. * ============================================================================= */var n=e("@parcel/transformer-js/src/esmodule-helpers.js");n.defineInteropFlag(r),n.export(r,"stridedSlice",()=>u),n.export(r,"stridedSliceConfig",()=>p);var s=e("@tensorflow/tfjs-core"),a=e("../cpu_util"),o=e("./Reshape"),l=e("./Slice"),i=e("./StridedSlice_impl");function u(e){let t;let{inputs:r,backend:n,attrs:u}=e,{x:p}=r,{begin:c,end:d,strides:f,beginMask:h,endMask:m,ellipsisMask:g,newAxisMask:x,shrinkAxisMask:v}=u;(0,a.assertNotComplex)(p,"stridedSlice");let{finalShapeSparse:y,finalShape:b,isIdentity:_,sliceDim0:k,isSimpleSlice:j,begin:I,end:C,strides:w}=(0,s.slice_util).sliceInfo(p.shape,c,d,f,h,m,g,x,v);if(_)t=(0,o.reshape)({inputs:{x:p},backend:n,attrs:{shape:b}});else if(k||j){(0,s.util).assert(p.shape.length>=1,()=>`Input must have rank at least 1, got: ${p.shape.length}`);let e=(0,s.slice_util).computeOutShape(I,C,w),r=(0,l.slice)({inputs:{x:p},backend:n,attrs:{begin:I,size:e}});t=(0,o.reshape)({inputs:{x:r},backend:n,attrs:{shape:b}}),n.disposeIntermediateTensorInfo(r)}else{let e=n.bufferSync(p),r=(0,i.stridedSliceImpl)(y,e,w,I);t=n.makeTensorInfo(b,r.dtype,r.values)}return t}let p={kernelName:s.StridedSlice,backendName:"cpu",kernelFunc:u}},{"@tensorflow/tfjs-core":"2nuhV","../cpu_util":"f1aYU","./Reshape":"dPbEE","./Slice":"loZC8","./StridedSlice_impl":"3U7SN","@parcel/transformer-js/src/esmodule-helpers.js":"9pCYc"}],coUv2:[function(e,t,r){/** * @license * Copyright 2021 Google LLC. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. * ============================================================================= */var n=e("@parcel/transformer-js/src/esmodule-helpers.js");n.defineInteropFlag(r),n.export(r,"stringNGrams",()=>o),n.export(r,"stringNGramsConfig",()=>l);var s=e("@tensorflow/tfjs-core"),a=e("./StringNGrams_impl");function o(e){let{inputs:t,backend:r,attrs:n}=e,{separator:s,nGramWidths:o,leftPad:l,rightPad:i,padWidth:u,preserveShortSequences:p}=n,{data:c,dataSplits:d}=t,f=r.data.get(c.dataId).values,h=r.data.get(d.dataId).values,[m,g]=(0,a.stringNGramsImpl)(f,h,s,o,l,i,u,p);return[r.makeTensorInfo([m.length],"string",m),r.makeTensorInfo(d.shape,"int32",g)]}let l={kernelName:s.StringNGrams,backendName:"cpu",kernelFunc:o}},{"@tensorflow/tfjs-core":"2nuhV","./StringNGrams_impl":"j3eTT","@parcel/transformer-js/src/esmodule-helpers.js":"9pCYc"}],fg2js:[function(e,t,r){/** * @license * Copyright 2021 Google LLC. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. * ============================================================================= */var n=e("@parcel/transformer-js/src/esmodule-helpers.js");n.defineInteropFlag(r),n.export(r,"stringSplit",()=>o),n.export(r,"stringSplitConfig",()=>l);var s=e("@tensorflow/tfjs-core"),a=e("./StringSplit_impl");function o(e){let{inputs:t,backend:r,attrs:n}=e,{skipEmpty:s}=n,{input:o,delimiter:l}=t;if("string"!==o.dtype)throw Error("Input must be of datatype string");if(1!==o.shape.length)throw Error(`Input must be a vector, got shape: ${o.shape}`);if(0!==l.shape.length)throw Error(`Delimiter must be a scalar, got shape: ${l.shape}`);let i=r.data.get(o.dataId).values,u=r.data.get(l.dataId).values[0],[p,c,d]=(0,a.stringSplitImpl)(i,u,s),f=c.length;return[r.makeTensorInfo([f,2],"int32",p),r.makeTensorInfo([f],"string",c),r.makeTensorInfo([2],"int32",new Int32Array(d))]}let l={kernelName:s.StringSplit,backendName:"cpu",kernelFunc:o}},{"@tensorflow/tfjs-core":"2nuhV","./StringSplit_impl":"fAlpl","@parcel/transformer-js/src/esmodule-helpers.js":"9pCYc"}],jslcv:[function(e,t,r){/** * @license * Copyright 2021 Google LLC. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. * ============================================================================= */var n=e("@parcel/transformer-js/src/esmodule-helpers.js");n.defineInteropFlag(r),n.export(r,"stringToHashBucketFast",()=>o),n.export(r,"stringToHashBucketFastConfig",()=>l);var s=e("@tensorflow/tfjs-core"),a=e("./StringToHashBucketFast_impl");function o(e){let{inputs:t,backend:r,attrs:n}=e,{numBuckets:s}=n,{input:o}=t;if("string"!==o.dtype)throw Error("Input must be of datatype string");if(s<=0)throw Error("Number of buckets must be at least 1");let l=r.data.get(o.dataId).values,i=(0,a.stringToHashBucketFastImpl)(l,s);return r.makeTensorInfo(o.shape,"int32",i)}let l={kernelName:s.StringToHashBucketFast,backendName:"cpu",kernelFunc:o}},{"@tensorflow/tfjs-core":"2nuhV","./StringToHashBucketFast_impl":"lFait","@parcel/transformer-js/src/esmodule-helpers.js":"9pCYc"}],"70kuo":[function(e,t,r){/** * @license * Copyright 2020 Google LLC. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the License); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an AS IS BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. * ============================================================================= */var n=e("@parcel/transformer-js/src/esmodule-helpers.js");n.defineInteropFlag(r),n.export(r,"tan",()=>a),n.export(r,"tanConfig",()=>o);var s=e("@tensorflow/tfjs-core");let a=(0,e("../utils/unary_utils").unaryKernelFunc)(s.Tan,e=>Math.tan(e)),o={kernelName:s.Tan,backendName:"cpu",kernelFunc:a}},{"@tensorflow/tfjs-core":"2nuhV","../utils/unary_utils":"i8gKT","@parcel/transformer-js/src/esmodule-helpers.js":"9pCYc"}],"3H0jA":[function(e,t,r){/** * @license * Copyright 2020 Google LLC. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the License); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an AS IS BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. * ============================================================================= */var n=e("@parcel/transformer-js/src/esmodule-helpers.js");n.defineInteropFlag(r),n.export(r,"tanh",()=>a),n.export(r,"tanhConfig",()=>o);var s=e("@tensorflow/tfjs-core");let a=(0,e("../utils/unary_utils").unaryKernelFunc)(s.Tanh,e=>Math.tanh(e)),o={kernelName:s.Tanh,backendName:"cpu",kernelFunc:a}},{"@tensorflow/tfjs-core":"2nuhV","../utils/unary_utils":"i8gKT","@parcel/transformer-js/src/esmodule-helpers.js":"9pCYc"}],"56hl0":[function(e,t,r){/** * @license * Copyright 2022 Google LLC. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. * ============================================================================= */var n=e("@parcel/transformer-js/src/esmodule-helpers.js");n.defineInteropFlag(r),n.export(r,"tensorScatterUpdate",()=>o),n.export(r,"tensorScatterUpdateConfig",()=>l);var s=e("@tensorflow/tfjs-core"),a=e("./Scatter_impl");function o(e){let{inputs:t,backend:r}=e,{tensor:n,indices:o,updates:l}=t,{sliceRank:i,numUpdates:u,sliceSize:p,strides:c,outputSize:d}=(0,s.backend_util).calculateShapes(l,o,n.shape),f=r.bufferSync(o),h=r.bufferSync(l),m=r.bufferSync(n),g=(0,a.scatterImpl)(f,h,n.shape,d,p,u,i,c,m,!1);return r.makeTensorInfo(n.shape,g.dtype,g.values)}let l={kernelName:s.TensorScatterUpdate,backendName:"cpu",kernelFunc:o}},{"@tensorflow/tfjs-core":"2nuhV","./Scatter_impl":"f9QJS","@parcel/transformer-js/src/esmodule-helpers.js":"9pCYc"}],iWTrW:[function(e,t,r){/** * @license * Copyright 2020 Google LLC. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. * ============================================================================= */var n=e("@parcel/transformer-js/src/esmodule-helpers.js");n.defineInteropFlag(r),n.export(r,"tile",()=>l),n.export(r,"tileConfig",()=>i);var s=e("@tensorflow/tfjs-core"),a=e("../cpu_util"),o=e("./Tile_impl");function l(e){let{inputs:t,backend:r,attrs:n}=e,{x:s}=t,{reps:l}=n;(0,a.assertNotComplex)(s,"tile");let i=(0,o.tileImpl)(r.bufferSync(s),l);return r.makeTensorInfo(i.shape,i.dtype,i.values)}let i={kernelName:s.Tile,backendName:"cpu",kernelFunc:l}},{"@tensorflow/tfjs-core":"2nuhV","../cpu_util":"f1aYU","./Tile_impl":"fdvO1","@parcel/transformer-js/src/esmodule-helpers.js":"9pCYc"}],"2o4cv":[function(e,t,r){/** * @license * Copyright 2020 Google LLC. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. * ============================================================================= */var n=e("@parcel/transformer-js/src/esmodule-helpers.js");n.defineInteropFlag(r),n.export(r,"topK",()=>l),n.export(r,"topKConfig",()=>i);var s=e("@tensorflow/tfjs-core"),a=e("../cpu_util"),o=e("./TopK_impl");function l(e){let{inputs:t,backend:r,attrs:n}=e,{x:s}=t,{k:l,sorted:i}=n;(0,a.assertNotComplex)(s,"topk");let u=r.data.get(s.dataId).values,[p,c]=(0,o.topKImpl)(u,s.shape,s.dtype,l,i);return[r.makeTensorInfo(p.shape,p.dtype,p.values),r.makeTensorInfo(c.shape,c.dtype,c.values)]}let i={kernelName:s.TopK,backendName:"cpu",kernelFunc:l}},{"@tensorflow/tfjs-core":"2nuhV","../cpu_util":"f1aYU","./TopK_impl":"2JZKB","@parcel/transformer-js/src/esmodule-helpers.js":"9pCYc"}],"1hC97":[function(e,t,r){/** * @license * Copyright 2021 Google LLC. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. * ============================================================================= */var n=e("@parcel/transformer-js/src/esmodule-helpers.js");n.defineInteropFlag(r),n.export(r,"transform",()=>a),n.export(r,"transformConfig",()=>o);var s=e("@tensorflow/tfjs-core");function a(e){let{inputs:t,attrs:r,backend:n}=e,{image:a,transforms:o}=t,{interpolation:u,fillMode:p,fillValue:c,outputShape:d}=r,[f,h,m,g]=a.shape,[x,v]=null!=d?d:[h,m],y=[f,x,v,g],b=(0,s.util).computeStrides(a.shape),_=b[0],k=b[1],j=b[2],I=(0,s.util).computeStrides(y),C=I[0],w=I[1],T=I[2],S=(0,s.util).getTypedArrayFromDType(a.dtype,(0,s.util).sizeFromShape(y));S.fill(c);let N=n.data.get(a.dataId).values,E=n.data.get(o.dataId).values;for(let e=0;et-1){if(t<=1)r=0;else{let e=2*t;(r-=e*Math.trunc(r/e))>=t&&(r=e-r-1)}}return(0,s.util).clamp(0,r,t-1)}(e,t);case"wrap":let n;return(n=e)<0?t<=1?n=0:n+=t*(Math.trunc(-n/(t-1))+1):n>t-1&&(t<=1?n=0:n-=t*Math.trunc(n/(t-1))),(0,s.util).clamp(0,n,t-1);case"nearest":return(0,s.util).clamp(0,e,t-1);default:return e}}function i(e,t,r,n,s,a,o,l,i,u,p){return 0<=l&&ll),n.export(r,"uniqueConfig",()=>i);var s=e("@tensorflow/tfjs-core"),a=e("../cpu_util"),o=e("./Unique_impl");function l(e){let{inputs:t,attrs:r,backend:n}=e,{axis:s}=r,{x:l}=t;(0,a.assertNotComplex)(l,"unique");let i=n.data.get(l.dataId).values,{outputValues:u,outputShape:p,indices:c}=(0,o.uniqueImpl)(i,s,l.shape,l.dtype);return[n.makeTensorInfo(p,l.dtype,u),n.makeTensorInfo([c.length],"int32",c)]}let i={kernelName:s.Unique,backendName:"cpu",kernelFunc:l}},{"@tensorflow/tfjs-core":"2nuhV","../cpu_util":"f1aYU","./Unique_impl":"an8b2","@parcel/transformer-js/src/esmodule-helpers.js":"9pCYc"}],bgyoS:[function(e,t,r){/** * @license * Copyright 2020 Google LLC. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. * ============================================================================= */var n=e("@parcel/transformer-js/src/esmodule-helpers.js");n.defineInteropFlag(r),n.export(r,"unpack",()=>l),n.export(r,"unpackConfig",()=>i);var s=e("@tensorflow/tfjs-core"),a=e("./Reshape"),o=e("./Slice");function l(e){let{inputs:t,backend:r,attrs:n}=e,{value:s}=t,{axis:l}=n;l<0&&(l+=s.shape.length);let i=s.shape.length,u=s.shape[l],p=Array(i-1),c=0;for(let e=0;ed),n.export(r,"unsortedSegmentSumConfig",()=>f);var s=e("@tensorflow/tfjs-core"),a=e("../cpu_util"),o=e("./Cast"),l=e("./Equal"),i=e("./ExpandDims"),u=e("./Multiply"),p=e("./Pack"),c=e("./Sum");function d(e){let{inputs:t,backend:r,attrs:n}=e,{x:d,segmentIds:f}=t,{numSegments:h}=n;(0,a.assertNotComplex)(d,"unsortedSegmentSum");let m=d.shape.length,g=f.shape.length,x=[],v=[],y=m-g,b=f;for(let e=0;er.disposeIntermediateTensorInfo(e)),_}let f={kernelName:s.UnsortedSegmentSum,backendName:"cpu",kernelFunc:d}},{"@tensorflow/tfjs-core":"2nuhV","../cpu_util":"f1aYU","./Cast":"ep8e6","./Equal":"cApXD","./ExpandDims":"aVhKw","./Multiply":"k52uJ","./Pack":"gf163","./Sum":"dI67n","@parcel/transformer-js/src/esmodule-helpers.js":"9pCYc"}],"79Ppz":[function(e,t,r){/** * @license * Copyright 2023 Google LLC. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. * ============================================================================= */var n,s=e("@parcel/transformer-js/src/esmodule-helpers.js");s.defineInteropFlag(r),s.export(r,"SupportedModels",()=>eR),s.export(r,"blurBodyPart",()=>eJ),s.export(r,"bodyPixMaskValueToRainbowColor",()=>y),s.export(r,"createSegmenter",()=>eP),s.export(r,"drawBokehEffect",()=>eQ),s.export(r,"drawMask",()=>eH),s.export(r,"drawPixelatedMask",()=>eX),s.export(r,"toBinaryMask",()=>eq),s.export(r,"toColoredMask",()=>eK);var a=e("@tensorflow/tfjs-core"),o=e("@tensorflow/tfjs-converter"),l=e("@mediapipe/selfie_segmentation"),i=function(e,t){return(i=Object.setPrototypeOf||({__proto__:[]})instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)t.hasOwnProperty(r)&&(e[r]=t[r])})(e,t)};function u(e,t){function r(){this.constructor=e}i(e,t),e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)}var p=function(){return(p=Object.assign||function(e){for(var t,r=1,n=arguments.length;r0&&s[s.length-1])&&(6===a[0]||2===a[0])){o=0;continue}if(3===a[0]&&(!s||a[1]>s[0]&&a[1]=256)throw Error("Mask value must be in range [0, 255] but got "+e);if(!Number.isInteger(e))throw Error("Mask value must be an integer but got "+e)}var v=[[110,64,170],[143,61,178],[178,60,178],[210,62,167],[238,67,149],[255,78,125],[255,94,99],[255,115,75],[255,140,56],[239,167,47],[217,194,49],[194,219,64],[175,240,91],[135,245,87],[96,247,96],[64,243,115],[40,234,141],[28,219,169],[26,199,194],[33,176,213],[47,150,224],[65,125,224],[84,101,214],[99,81,195]];function y(e){if(x(e),er&&(s+=1,n+=Math.pow(e[a].x-t.keypoints[a].position.x,2)+Math.pow(e[a].y-t.keypoints[a].position.y,2));return 0===s?n=1/0:n/=s,n}(g,r[k]);j<_&&(b=k,_=j)}return b}function R(e,t){var r=e[0];return[Math.round((e[1]-1)/t+1),Math.round((r-1)/t+1)]}function A(e,t,r,n,s,o,l,i,u,p,c){for(var d=l[0],f=l[1],h=e.shape,m=h[0],g=h[1],x=t.shape.slice(0,2),v=x[0],y=x[1],b=(0,a.reshape)(t,[v,y,2,C]),_=new Float32Array(c*C*3).fill(0),k=0;k"+p+") {\n numKpt = numKpt + 1;\n curDistSum = curDistSum + dist(x, y, poseX, poseY);\n }\n }\n if (numKpt > 0 && curDistSum / float(numKpt)< minDist) {\n minDist = curDistSum / float(numKpt);\n iMin = i;\n }\n }\n return iMin;\n }\n\n void main() {\n ivec2 coords = getOutputCoords();\n int nearestPose = findNearestPose(coords[0], coords[1]);\n setOutput(float(nearestPose));\n }\n "},[e,b,A])}function P(){return"webgl"===(0,a.getBackend)()}function D(e){return Math.floor(e/2)}[["leftHip","leftShoulder"],["leftElbow","leftShoulder"],["leftElbow","leftWrist"],["leftHip","leftKnee"],["leftKnee","leftAnkle"],["rightHip","rightShoulder"],["rightElbow","rightShoulder"],["rightElbow","rightWrist"],["rightHip","rightKnee"],["rightKnee","rightAnkle"],["leftShoulder","rightShoulder"],["leftHip","rightHip"]].map(function(e){var t=e[0],r=e[1];return[w[t],w[r]]});var $=function(){function e(e,t){this.priorityQueue=Array(e),this.numberOfElements=-1,this.getElementValue=t}return e.prototype.enqueue=function(e){this.priorityQueue[++this.numberOfElements]=e,this.swim(this.numberOfElements)},e.prototype.dequeue=function(){var e=this.priorityQueue[0];return this.exchange(0,this.numberOfElements--),this.sink(0),this.priorityQueue[this.numberOfElements+1]=null,e},e.prototype.empty=function(){return -1===this.numberOfElements},e.prototype.size=function(){return this.numberOfElements+1},e.prototype.all=function(){return this.priorityQueue.slice(0,this.numberOfElements+1)},e.prototype.max=function(){return this.priorityQueue[0]},e.prototype.swim=function(e){for(;e>0&&this.less(D(e),e);)this.exchange(e,D(e)),e=D(e)},e.prototype.sink=function(e){for(;2*e<=this.numberOfElements;){var t=2*e;if(ta?a:s),x:(o=Math.round(e.x/t),l=n-1,o<0?0:o>l?l:o)}}function L(e,t,r,n,s,a,o,l){void 0===l&&(l=2);for(var i,u,p=n.shape,c=p[0],d=p[1],f=(i=B(t.position,a,c,d),u=o.shape[2]/2,{y:o.get(i.y,i.x,e),x:o.get(i.y,i.x,u+e)}),h=E(t.position,f),m=0;mt){u=!1;break}if(!u)break}return u}(p,c,i,u,1,r)&&l.enqueue({score:c,part:{heatmapY:i,heatmapX:u,id:p}})}return l}(o,0,e),p=l*l;i.length=0;--d){var f=O[d],h=V[d];i[f]&&!i[h]&&(i[h]=L(d,i[f],h,t,r,n,a))}for(d=0;d=.1,function(){return"inputResolution must be a string or number between 0.1 and 2, but was "+e}),e}(e);return[X(n*o,t),X(s*o,t)]}function ee(e,t,r,n,s){var o=t[0],l=t[1],i=r[0],u=r[1],p=n[0],c=p[0],d=p[1],f=n[1],h=f[0],m=f[1];return void 0===s&&(s=!1),(0,a.tidy)(function(){var t,r,n,p,f,g,x,v,y,b,_,k=(0,a.image).resizeBilinear(e,[i,u],!0);return s&&(k=(0,a.sigmoid)(k)),t=k,r=[o,l],n=[[c,d],[h,m]],p=r[0],f=r[1],x=(g=n[0])[0],v=g[1],b=(y=n[1])[0],_=y[1],(0,a.tidy)(function(){var e=(0,a.expandDims)(t);return(0,a.squeeze)((0,a.image).cropAndResize(e,[[x/(p+x+v-1),b/(f+b+_-1),(x+p-1)/(p+x+v-1),(b+f-1)/(f+b+_-1)]],[0],[p,f]),[0])})})}function et(e,t){var r=t[0],n=t[1],s=H(e),o=s[0],l=s[1],i=n/r,u=0,p=0,c=0,d=0;return l/o1)throw Error("segmentationThreshold "+t+". Should be in range [0.0, 1.0]");if(r<=0)throw Error("Invalid maxDetections "+r+". Should be >0");if(n<0||n>1)throw Error("Invalid scoreThreshold "+n+". Should be in range [0.0, 1.0]");if(s<=0)throw Error("Invalid nmsRadius "+s+".")}function ed(e){var t=e.segmentationThreshold,r=e.maxDetections,n=e.scoreThreshold,s=e.nmsRadius,a=e.minKeypointScore,o=e.refineSteps;if(t<0||t>1)throw Error("segmentationThreshold "+t+". Should be in range [0.0, 1.0]");if(r<=0)throw Error("Invalid maxDetections "+r+". Should be >0");if(n<0||n>1)throw Error("Invalid scoreThreshold "+n+". Should be in range [0.0, 1.0]");if(s<=0)throw Error("Invalid nmsRadius "+s+".");if(a<0||a>1)throw Error("Invalid minKeypointScore "+a+".Should be in range [0.0, 1.0]");if(o<=0||o>20)throw Error("Invalid refineSteps "+o+".Should be in range [1, 20]")}var ef=function(){function e(e){this.baseModel=e}return e.prototype.predictForPersonSegmentation=function(e){var t=this.baseModel.predict(e);return{segmentLogits:t.segmentation,heatmapScores:t.heatmapScores,offsets:t.offsets,displacementFwd:t.displacementFwd,displacementBwd:t.displacementBwd}},e.prototype.predictForPersonSegmentationAndPart=function(e){var t=this.baseModel.predict(e);return{segmentLogits:t.segmentation,partHeatmapLogits:t.partHeatmaps,heatmapScores:t.heatmapScores,offsets:t.offsets,displacementFwd:t.displacementFwd,displacementBwd:t.displacementBwd}},e.prototype.predictForMultiPersonInstanceSegmentationAndPart=function(e){var t=this.baseModel.predict(e);return{segmentLogits:t.segmentation,longOffsets:t.longOffsets,heatmapScores:t.heatmapScores,offsets:t.offsets,displacementFwd:t.displacementFwd,displacementBwd:t.displacementBwd,partHeatmaps:t.partHeatmaps}},e.prototype.segmentPersonActivation=function(e,t,r){var n=this;void 0===r&&(r=.5);var s=H(e),o=s[0],l=s[1],i=Z(t,this.baseModel.outputStride,[o,l]),u=et(e,i),p=u.resized,c=u.padding,d=(0,a.tidy)(function(){var e=n.predictForPersonSegmentation(p),t=e.segmentLogits,s=e.heatmapScores,i=e.offsets,u=e.displacementFwd,d=e.displacementBwd,f=p.shape,h=ee(t,[o,l],[f[0],f[1]],[[c.top,c.bottom],[c.left,c.right]],!0);return{segmentation:_((0,a.squeeze)(h),r),heatmapScores:s,offsets:i,displacementFwd:u,displacementBwd:d}}),f=d.segmentation,h=d.heatmapScores,m=d.offsets,g=d.displacementFwd,x=d.displacementBwd;return p.dispose(),{segmentation:f,heatmapScores:h,offsets:m,displacementFwd:g,displacementBwd:x,padding:c,internalResolutionHeightAndWidth:i}},e.prototype.segmentPerson=function(e,t){return void 0===t&&(t=eu),c(this,void 0,void 0,function(){var r,n,s,a,o,l,i,u,c,f,h,m,g,x,v;return d(this,function(d){switch(d.label){case 0:return ec(t=p(p({},eu),t)),n=(r=this.segmentPersonActivation(e,t.internalResolution,t.segmentationThreshold)).segmentation,s=r.heatmapScores,a=r.offsets,o=r.displacementFwd,l=r.displacementBwd,i=r.padding,u=r.internalResolutionHeightAndWidth,f=(c=n.shape)[0],h=c[1],[4,n.data()];case 1:return m=d.sent(),n.dispose(),[4,er([s,a,o,l])];case 2:return x=(g=d.sent())[0],v=en(v=z(x,g[1],g[2],g[3],this.baseModel.outputStride,t.maxDetections,t.scoreThreshold,t.nmsRadius),[f,h],u,i,!1),s.dispose(),a.dispose(),o.dispose(),l.dispose(),[2,{height:f,width:h,data:m,allPoses:v}]}})})},e.prototype.segmentMultiPerson=function(e,t){return void 0===t&&(t=ep),c(this,void 0,void 0,function(){var r,n,s,o,l,i,u,f,h,m,g,x,v,y,b,k,j,I,C=this;return d(this,function(w){switch(w.label){case 0:return ed(t=p(p({},ep),t)),n=(r=H(e))[0],s=r[1],i=(l=et(e,o=Z(t.internalResolution,this.baseModel.outputStride,[n,s]))).resized,u=l.padding,h=(f=(0,a.tidy)(function(){var e=C.predictForMultiPersonInstanceSegmentationAndPart(i),r=e.segmentLogits,l=e.longOffsets,p=e.heatmapScores,c=e.offsets,d=e.displacementFwd,f=e.displacementBwd,h=ee(r,[n,s],o,[[u.top,u.bottom],[u.left,u.right]],!0);return{segmentation:_((0,a.squeeze)(h),t.segmentationThreshold),longOffsets:l,heatmapScoresRaw:p,offsetsRaw:c,displacementFwdRaw:d,displacementBwdRaw:f}})).segmentation,m=f.longOffsets,g=f.heatmapScoresRaw,x=f.offsetsRaw,v=f.displacementFwdRaw,y=f.displacementBwdRaw,[4,er([g,x,v,y])];case 1:return k=(b=w.sent())[0],j=en(j=z(k,b[1],b[2],b[3],this.baseModel.outputStride,t.maxDetections,t.scoreThreshold,t.nmsRadius),[n,s],o,u,!1),[4,function(e,t,r,n,s,o,l,i,u,p,f,h){var m=l[0],g=l[1];return void 0===u&&(u=.2),void 0===p&&(p=8),void 0===f&&(f=.3),void 0===h&&(h=10),c(this,void 0,void 0,function(){var l,c,x,v,y;return d(this,function(d){switch(d.label){case 0:return l=r.filter(function(e){return e.score>=u}),P()?[4,Promise.all((x=(0,a.tidy)(function(){var r=A(e,t,l,n,s,o,[m,g],i,p,f,h),u=(0,a.engine)().makeTensorFromDataId(r.dataId,r.shape,r.dtype);return l.map(function(e,t){return(0,a.tidy)(function(){return(0,a.cast)((0,a.equal)(u,(0,a.scalar)(t)),"int32")})})})).map(function(e){return e.data()}))]:[3,2];case 1:return c=d.sent(),x.forEach(function(e){return e.dispose()}),[3,5];case 2:return[4,e.data()];case 3:return v=d.sent(),[4,t.data()];case 4:y=d.sent(),c=function(e,t,r,n,s,a,o,l,i,u){var p=o[0],c=o[1];void 0===u&&(u=5);for(var d=r.map(function(e){return new Uint8Array(n*s).fill(0)}),f=l.top,h=l.left,m=T([n,s],[p,c],l),g=m[0],x=m[1],v=R([p,c],a)[0],y=0;y=0&&(d[k][_]=1)}}return d}(v,y,l,n,s,o,[m,g],i,p),d.label=5;case 5:return[2,c.map(function(e,t){return{data:e,pose:l[t],width:s,height:n}})]}})})}(h,m,j,n,s,this.baseModel.outputStride,o,u,t.scoreThreshold,t.refineSteps,t.minKeypointScore,t.maxDetections)];case 2:return I=w.sent(),i.dispose(),h.dispose(),m.dispose(),g.dispose(),x.dispose(),v.dispose(),y.dispose(),[2,I]}})})},e.prototype.segmentPersonPartsActivation=function(e,t,r){var n=this;void 0===r&&(r=.5);var s=H(e),o=s[0],l=s[1],i=Z(t,this.baseModel.outputStride,[o,l]),u=et(e,i),p=u.resized,c=u.padding,d=(0,a.tidy)(function(){var e,t,s,i,u,d=n.predictForPersonSegmentationAndPart(p),f=d.segmentLogits,h=d.partHeatmapLogits,m=d.heatmapScores,g=d.offsets,x=d.displacementFwd,v=d.displacementBwd,y=p.shape,k=y[0],j=y[1],I=ee(f,[o,l],[k,j],[[c.top,c.bottom],[c.left,c.right]],!0),C=ee(h,[o,l],[k,j],[[c.top,c.bottom],[c.left,c.right]],!0);return{partSegmentation:(e=_((0,a.squeeze)(I),r),s=(t=C.shape)[0],i=t[1],u=t[2],(0,a.tidy)(function(){var t=b(C),r=(0,a.expandDims)((0,a.range)(0,u,1,"int32"),1),n=(0,a.cast)((0,a.matMul)(t,r),"int32"),o=(0,a.reshape)(n,[s,i]),l=(0,a.add)(o,(0,a.scalar)(1,"int32"));return(0,a.sub)((0,a.mul)(l,e),(0,a.scalar)(1,"int32"))})),heatmapScores:m,offsets:g,displacementFwd:x,displacementBwd:v}}),f=d.partSegmentation,h=d.heatmapScores,m=d.offsets,g=d.displacementFwd,x=d.displacementBwd;return p.dispose(),{partSegmentation:f,heatmapScores:h,offsets:m,displacementFwd:g,displacementBwd:x,padding:c,internalResolutionHeightAndWidth:i}},e.prototype.segmentPersonParts=function(e,t){return void 0===t&&(t=eu),c(this,void 0,void 0,function(){var r,n,s,a,o,l,i,u,c,f,h,m,g,x,v;return d(this,function(d){switch(d.label){case 0:return ec(t=p(p({},eu),t)),n=(r=this.segmentPersonPartsActivation(e,t.internalResolution,t.segmentationThreshold)).partSegmentation,s=r.heatmapScores,a=r.offsets,o=r.displacementFwd,l=r.displacementBwd,i=r.padding,u=r.internalResolutionHeightAndWidth,f=(c=n.shape)[0],h=c[1],[4,n.data()];case 1:return m=d.sent(),n.dispose(),[4,er([s,a,o,l])];case 2:return x=(g=d.sent())[0],v=en(v=z(x,g[1],g[2],g[3],this.baseModel.outputStride,t.maxDetections,t.scoreThreshold,t.nmsRadius),[f,h],u,i,!1),s.dispose(),a.dispose(),o.dispose(),l.dispose(),[2,{height:f,width:h,data:m,allPoses:v}]}})})},e.prototype.segmentMultiPersonParts=function(e,t){return void 0===t&&(t=ep),c(this,void 0,void 0,function(){var r,n,s,o,l,i,u,f,h,m,g,x,v,y,k,j,I,C,w,S=this;return d(this,function(N){switch(N.label){case 0:return ed(t=p(p({},ep),t)),n=(r=H(e))[0],s=r[1],i=(l=et(e,o=Z(t.internalResolution,this.baseModel.outputStride,[n,s]))).resized,u=l.padding,h=(f=(0,a.tidy)(function(){var e,r,l,p,c=S.predictForMultiPersonInstanceSegmentationAndPart(i),d=c.segmentLogits,f=c.longOffsets,h=c.heatmapScores,m=c.offsets,g=c.displacementFwd,x=c.displacementBwd,v=c.partHeatmaps,y=ee(d,[n,s],o,[[u.top,u.bottom],[u.left,u.right]],!0),k=ee(v,[n,s],o,[[u.top,u.bottom],[u.left,u.right]],!0);return{segmentation:_((0,a.squeeze)(y),t.segmentationThreshold),longOffsets:f,heatmapScoresRaw:h,offsetsRaw:m,displacementFwdRaw:g,displacementBwdRaw:x,partSegmentation:(r=(e=k.shape)[0],l=e[1],p=e[2],(0,a.tidy)(function(){var e=b(k),t=(0,a.expandDims)((0,a.range)(0,p,1,"int32"),1),n=(0,a.cast)((0,a.matMul)(e,t),"int32");return(0,a.reshape)(n,[r,l])}))}})).segmentation,m=f.longOffsets,g=f.heatmapScoresRaw,x=f.offsetsRaw,v=f.displacementFwdRaw,y=f.displacementBwdRaw,k=f.partSegmentation,[4,er([g,x,v,y])];case 1:return I=(j=N.sent())[0],C=en(C=z(I,j[1],j[2],j[3],this.baseModel.outputStride,t.maxDetections,t.scoreThreshold,t.nmsRadius),[n,s],o,u,!1),[4,function(e,t,r,n,s,o,l,i,u,p,f,h,m){var g=i[0],x=i[1];return void 0===p&&(p=.2),void 0===f&&(f=8),void 0===h&&(h=.3),void 0===m&&(m=10),c(this,void 0,void 0,function(){var i,c,v,y,b,_;return d(this,function(d){switch(d.label){case 0:return i=n.filter(function(e){return e.score>=p}),P()?[4,Promise.all((v=(0,a.tidy)(function(){var n=A(e,t,i,s,o,l,[g,x],u,f,h,m),p=(0,a.engine)().makeTensorFromDataId(n.dataId,n.shape,n.dtype);return i.map(function(e,t){return(0,a.tidy)(function(){return(0,a.sub)((0,a.mul)((0,a.cast)((0,a.equal)(p,(0,a.scalar)(t)),"int32"),(0,a.add)(r,1)),1)})})})).map(function(e){return e.data()}))]:[3,2];case 1:return c=d.sent(),v.forEach(function(e){return e.dispose()}),[3,6];case 2:return[4,e.data()];case 3:return y=d.sent(),[4,t.data()];case 4:return b=d.sent(),[4,r.data()];case 5:_=d.sent(),c=function(e,t,r,n,s,a,o,l,i,u,p){var c=l[0],d=l[1];void 0===p&&(p=5);for(var f=n.map(function(e){return new Int32Array(s*a).fill(-1)}),h=i.top,m=i.left,g=T([s,a],[c,d],i),x=g[0],v=g[1],y=R([c,d],o)[0],b=0;b=0&&(f[j][k]=r[k])}}return f}(y,b,_,i,s,o,l,[g,x],u,f),d.label=6;case 6:return[2,c.map(function(e,t){return{pose:i[t],data:e,height:s,width:o}})]}})})}(h,m,k,C,n,s,this.baseModel.outputStride,o,u,t.scoreThreshold,t.refineSteps,t.minKeypointScore,t.maxDetections)];case 2:return w=N.sent(),i.dispose(),h.dispose(),m.dispose(),g.dispose(),x.dispose(),v.dispose(),y.dispose(),k.dispose(),[2,w]}})})},e.prototype.dispose=function(){this.baseModel.dispose()},e}(),eh=["left_face","right_face","left_upper_arm_front","left_upper_arm_back","right_upper_arm_front","right_upper_arm_back","left_lower_arm_front","left_lower_arm_back","right_lower_arm_front","right_lower_arm_back","left_hand","right_hand","torso_front","torso_back","left_upper_leg_front","left_upper_leg_back","right_upper_leg_front","right_upper_leg_back","left_lower_leg_front","left_lower_leg_back","right_lower_leg_front","right_lower_leg_back","left_feet","right_feet"],em=function(){function e(e){this.mask=e}return e.prototype.toCanvasImageSource=function(){return c(this,void 0,void 0,function(){return d(this,function(e){return[2,h(this.mask)]})})},e.prototype.toImageData=function(){return c(this,void 0,void 0,function(){return d(this,function(e){return[2,this.mask]})})},e.prototype.toTensor=function(){return c(this,void 0,void 0,function(){return d(this,function(e){return[2,g(this.mask)]})})},e.prototype.getUnderlyingType=function(){return"imagedata"},e}();function eg(e){if(x(e),255!==e)throw Error("Foreground id must be 255 but got "+e);return"person"}function ex(e){if(x(e),e>=eh.length)throw Error("Invalid body part value "+e);return eh[e]}var ev=function(){function e(e){this.bodyPixModel=e}return e.prototype.segmentPeople=function(e,t){return c(this,void 0,void 0,function(){var r,n,s,a;return d(this,function(o){switch(o.label){case 0:return e instanceof ImageBitmap&&((r=document.createElement("canvas")).getContext("2d").drawImage(e,0,0),e=r),t.segmentBodyParts?t.multiSegmentation?[4,this.bodyPixModel.segmentMultiPersonParts(e,t)]:[3,2]:[3,5];case 1:return s=o.sent(),[3,4];case 2:return[4,this.bodyPixModel.segmentPersonParts(e,t)];case 3:s=[o.sent()],o.label=4;case 4:return n=s.map(function(e){var t=e.data,r=e.width,n=e.height,s=new Uint8ClampedArray(r*n*4).fill(0);return t.forEach(function(e,t){-1===e?(s[4*t]=eh.length,s[4*t+3]=0):(s[4*t]=e,s[4*t+3]=255)}),{maskValueToLabel:ex,mask:new em(new ImageData(s,r,n))}}),[3,10];case 5:return t.multiSegmentation?[4,this.bodyPixModel.segmentMultiPerson(e,t)]:[3,7];case 6:return a=o.sent(),[3,9];case 7:return[4,this.bodyPixModel.segmentPerson(e,t)];case 8:a=[o.sent()],o.label=9;case 9:n=a.map(function(e){var t=e.data,r=e.width,n=e.height,s=new Uint8ClampedArray(r*n*4).fill(0);return t.forEach(function(e,t){0===e?(s[4*t]=0,s[4*t+3]=0):(s[4*t]=255,s[4*t+3]=255)}),{maskValueToLabel:eg,mask:new em(new ImageData(s,r,n))}}),o.label=10;case 10:return[2,n]}})})},e.prototype.dispose=function(){this.bodyPixModel.dispose()},e.prototype.reset=function(){},e}(),ey={runtime:"mediapipe",modelType:"general"},eb=function(){function e(e){this.mask=e}return e.prototype.toCanvasImageSource=function(){return c(this,void 0,void 0,function(){return d(this,function(e){return[2,this.mask]})})},e.prototype.toImageData=function(){return c(this,void 0,void 0,function(){return d(this,function(e){return[2,m(this.mask)]})})},e.prototype.toTensor=function(){return c(this,void 0,void 0,function(){return d(this,function(e){return[2,g(this.mask)]})})},e.prototype.getUnderlyingType=function(){return"canvasimagesource"},e}();function e_(e){return x(e),"person"}var ek=function(){function e(e){var t,r,n=this;this.selfieMode=!1,this.selfieSegmentationSolution=new l.SelfieSegmentation({locateFile:null!==(r=e.locateFile)&&void 0!==r?r:function(t,r){return e.solutionPath?e.solutionPath.replace(/\/+$/,"")+"/"+t:r+"/"+t}}),t="landscape"===e.modelType?1:0,this.selfieSegmentationSolution.setOptions({modelSelection:t,selfieMode:this.selfieMode}),this.selfieSegmentationSolution.onResults(function(e){n.segmentation=[{maskValueToLabel:e_,mask:new eb(e.segmentationMask)}]})}return e.prototype.segmentPeople=function(e,t){return c(this,void 0,void 0,function(){var r,n;return d(this,function(s){switch(s.label){case 0:return t&&t.flipHorizontal&&t.flipHorizontal!==this.selfieMode&&(this.selfieMode=t.flipHorizontal,this.selfieSegmentationSolution.setOptions({selfieMode:this.selfieMode})),e instanceof a.Tensor?(n=ImageData.bind,[4,(0,a.browser).toPixels(e)]):[3,2];case 1:return r=new(n.apply(ImageData,[void 0,s.sent(),e.shape[1],e.shape[0]])),[3,3];case 2:r=e,s.label=3;case 3:return e=r,[4,this.selfieSegmentationSolution.send({image:e})];case 4:return s.sent(),[2,this.segmentation]}})})},e.prototype.dispose=function(){this.selfieSegmentationSolution.close()},e.prototype.reset=function(){this.selfieSegmentationSolution.reset(),this.segmentation=null,this.selfieMode=!1},e.prototype.initialize=function(){return this.selfieSegmentationSolution.initialize()},e}();function ej(e){return e instanceof a.Tensor?{height:e.shape[0],width:e.shape[1]}:{height:e.height,width:e.width}}function eI(e,t){(0,a.util).assert(0!==e.width,function(){return t+" width cannot be 0."}),(0,a.util).assert(0!==e.height,function(){return t+" height cannot be 0."})}var eC={runtime:"tfjs",modelType:"general",modelUrl:"https://tfhub.dev/mediapipe/tfjs-model/selfie_segmentation/general/1"},ew={flipHorizontal:!1},eT={outputTensorSize:{width:256,height:256},keepAspectRatio:!1,borderMode:"zero",outputTensorFloatRange:[0,1]},eS={outputTensorSize:{width:256,height:144},keepAspectRatio:!1,borderMode:"zero",outputTensorFloatRange:[0,1]},eN={activation:"none"},eE=function(){function e(e){this.mask=e}return e.prototype.toCanvasImageSource=function(){return c(this,void 0,void 0,function(){return d(this,function(e){return[2,h(this.mask)]})})},e.prototype.toImageData=function(){return c(this,void 0,void 0,function(){return d(this,function(e){return[2,m(this.mask)]})})},e.prototype.toTensor=function(){return c(this,void 0,void 0,function(){return d(this,function(e){return[2,this.mask]})})},e.prototype.getUnderlyingType=function(){return"tensor"},e}();function eF(e){return x(e),"person"}var eR,eA=function(){function e(e,t){this.modelType=e,this.model=t}return e.prototype.segmentPeople=function(e,t){return c(this,void 0,void 0,function(){var r=this;return d(this,function(n){return t=function(e){if(null==e)return p({},ew);var t=p({},e);return null==t.flipHorizontal&&(t.flipHorizontal=ew.flipHorizontal),t}(t),null==e?(this.reset(),[2,[]]):[2,[{maskValueToLabel:eF,mask:new eE((0,a.tidy)(function(){var t,n,s,o,l,i,u,p,c,d,f,h,m,g,x,v,y,b,_,k,j,I=(g=(t="general"===r.modelType?eT:eS).outputTensorSize,x=t.keepAspectRatio,v=t.borderMode,y=t.outputTensorFloatRange,k=function(e,t,r){if(void 0===r&&(r=!1),!r)return{top:0,left:0,right:0,bottom:0};var n=t.height,s=t.width;eI(t,"targetSize"),eI(e,"roi");var a,o,l=n/s,i=e.height/e.width,u=0,p=0;return l>i?(a=e.width,o=e.width*l,p=(1-i/l)/2):(a=e.height/l,o=e.height,u=(1-l/i)/2),e.width=a,e.height=o,{top:p,left:u,right:u,bottom:p}}(_={xCenter:.5*(n=b=ej(e)).width,yCenter:.5*n.height,width:n.width,height:n.height,rotation:0},g,x),s=b.width,o=b.height,l=_.width,i=_.height,u=Math.cos(_.rotation),p=Math.sin(_.rotation),c=_.xCenter,d=_.yCenter,f=1/s,h=1/o,(m=Array(16))[0]=l*u*1*f,m[1]=-i*p*f,m[2]=0,m[3]=(-.5*l*u*1+.5*i*p+c)*f,m[4]=l*p*1*h,m[5]=i*u*h,m[6]=0,m[7]=(-.5*i*u-.5*l*p*1+d)*h,m[8]=0,m[9]=0,m[10]=l*f,m[11]=0,m[12]=0,m[13]=0,m[14]=0,m[15]=1,j=function(e){if(16!==e.length)throw Error("Array length must be 16 but got "+e.length);return[[e[0],e[1],e[2],e[3]],[e[4],e[5],e[6],e[7]],[e[8],e[9],e[10],e[11]],[e[12],e[13],e[14],e[15]]]}(m),{imageTensor:(0,a.tidy)(function(){var t,r,n,s,o=e instanceof a.Tensor?e:(0,a.browser).fromPixels(e),l=(0,a.tensor2d)((eI(g,"inputResolution"),[1/g.width*j[0][0]*b.width,1/g.height*j[0][1]*b.width,j[0][3]*b.width,1/g.width*j[1][0]*b.height,1/g.height*j[1][1]*b.height,j[1][3]*b.height,0,0]),[1,8]),i=(0,a.image).transform((0,a.expandDims)((0,a.cast)(o,"float32")),l,"bilinear","zero"===v?"constant":"nearest",0,[g.height,g.width]);return null!=y?(t=0,r=y[0],s={scale:n=(y[1]-r)/255,offset:r-0*n},(0,a.tidy)(function(){return(0,a.add)((0,a.mul)(i,s.scale),s.offset)})):i}),padding:k,transformationMatrix:j}).imageTensor,C=(0,a.slice)(r.model.predict(I),[0,0,0,1],-1),w=ej(e),T=(0,a.tidy)(function(){var e=(0,a.squeeze)(C,[0]),t=e.shape[2];if(1===t){var r=e;switch(eN.activation){case"none":break;case"sigmoid":r=(0,a.sigmoid)(r);break;case"softmax":throw Error("Softmax activation requires two channels.");default:throw Error("Activation not supported ("+eN.activation+")")}var n=w?(0,a.image).resizeBilinear(r,[w.height,w.width]):r;return(0,a.squeeze)(n,[2])}throw Error("Unsupported number of tensor channels "+t)}),S=(0,a.expandDims)(T,2),N=(0,a.pad)(S,[[0,0],[0,0],[0,1]]);return(0,a.mirrorPad)(N,[[0,0],[0,0],[0,2]],"symmetric")}))}]]})})},e.prototype.dispose=function(){this.model.dispose()},e.prototype.reset=function(){},e}();function eP(e,t){return c(this,void 0,void 0,function(){var r,n;return d(this,function(s){switch(e){case eR.MediaPipeSelfieSegmentation:if(r=void 0,null!=(n=t)){if("tfjs"===n.runtime)return[2,function(e){return c(this,void 0,void 0,function(){var t,r,n;return d(this,function(s){switch(s.label){case 0:return r="string"==typeof(t=function(e){if(null==e)return p({},eC);var t=p({},e);if(t.runtime="tfjs",null==t.modelType&&(t.modelType=eC.modelType),"general"!==t.modelType&&"landscape"!==t.modelType)throw Error("Model type must be one of general or landscape, but got "+t.modelType);return null==t.modelUrl&&("general"===t.modelType?t.modelUrl="https://tfhub.dev/mediapipe/tfjs-model/selfie_segmentation/general/1":t.modelUrl="https://tfhub.dev/mediapipe/tfjs-model/selfie_segmentation/landscape/1"),t}(e)).modelUrl&&t.modelUrl.indexOf("https://tfhub.dev")>-1,[4,(0,o.loadGraphModel)(t.modelUrl,{fromTFHub:r})];case 1:return n=s.sent(),[2,new eA(t.modelType,n)]}})})}(n)];if("mediapipe"===n.runtime)return[2,function(e){return c(this,void 0,void 0,function(){var t;return d(this,function(r){switch(r.label){case 0:return[4,(t=new ek(function(e){if(null==e)return p({},ey);var t=p({},e);return t.runtime="mediapipe",null==t.modelType&&(t.modelType=ey.modelType),t}(e))).initialize()];case 1:return r.sent(),[2,t]}})})}(n)];r=n.runtime}throw Error("Expect modelConfig.runtime to be either 'tfjs' or 'mediapipe', but got "+r);case eR.BodyPix:return[2,function(e){return c(this,void 0,void 0,function(){return d(this,function(t){return[2,(function(e){return void 0===e&&(e=es),c(this,void 0,void 0,function(){return d(this,function(t){return"ResNet50"===(e=function(e){if(null==(e=e||es).architecture&&(e.architecture="MobileNetV1"),0>ea.indexOf(e.architecture))throw Error("Invalid architecture "+e.architecture+". Should be one of "+ea);if(null==e.outputStride&&(e.outputStride=16),0>eo[e.architecture].indexOf(e.outputStride))throw Error("Invalid outputStride "+e.outputStride+". Should be one of "+eo[e.architecture]+" for architecture "+e.architecture+".");if(null==e.multiplier&&(e.multiplier=1),0>el[e.architecture].indexOf(e.multiplier))throw Error("Invalid multiplier "+e.multiplier+". Should be one of "+el[e.architecture]+" for architecture "+e.architecture+".");if(null==e.quantBytes&&(e.quantBytes=4),0>ei.indexOf(e.quantBytes))throw Error("Invalid quantBytes "+e.quantBytes+". Should be one of "+ei+" for architecture "+e.architecture+".");return e}(e)).architecture?[2,function(e){return c(this,void 0,void 0,function(){var t,r,n;return d(this,function(s){switch(s.label){case 0:var l;if(t=e.outputStride,r=e.quantBytes,null==a)throw Error("Cannot find TensorFlow.js. If you are using a