museaikit
Version:
A powerful music-focused AI toolkit
2 lines • 314 kB
JavaScript
/*! For license information please see coconet.js.LICENSE.txt */
!function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t():"function"==typeof define&&define.amd?define([],t):"object"==typeof exports?exports.coconet=t():e.coconet=t()}(self,(()=>(()=>{var __webpack_modules__={41:(e,t,n)=>{"use strict";n.d(t,{uI:()=>r});class r{time(e){return o("time")}read(e){return o("read")}readSync(e){return o("readSync")}numDataIds(){return o("numDataIds")}disposeData(e){return o("disposeData")}write(e,t,n){return o("write")}move(e,t,n,r){return o("move")}memory(){return o("memory")}floatPrecision(){return o("floatPrecision")}epsilon(){return 32===this.floatPrecision()?1e-7:1e-4}batchMatMul(e,t,n,r){return o("batchMatMul")}fusedBatchMatMul({a:e,b:t,transposeA:n,transposeB:r,bias:s,activation:i,preluActivationWeights:a}){return o("fusedBatchMatMul")}slice(e,t,n){return o("slice")}stridedSlice(e,t,n,r){return o("stridedSlice")}unstack(e,t){return o("unstack")}reverse(e,t){return o("reverse")}concat(e,t){return o("concat")}neg(e){return o("neg")}add(e,t){return o("add")}addN(e){return o("addN")}subtract(e,t){return o("subtract")}multiply(e,t){return o("multiply")}realDivide(e,t){return o("realDivide")}floorDiv(e,t){return o("floorDiv")}sum(e,t){return o("sum")}prod(e,t){return o("prod")}unsortedSegmentSum(e,t,n){return o("unsortedSegmentSum")}argMin(e,t){return o("argMin")}argMax(e,t){return o("argMax")}equal(e,t){return o("equal")}notEqual(e,t){return o("notEqual")}less(e,t){return o("less")}lessEqual(e,t){return o("lessEqual")}greater(e,t){return o("greater")}greaterEqual(e,t){return o("greaterEqual")}logicalNot(e){return o("logicalNot")}logicalAnd(e,t){return o("logicalAnd")}logicalOr(e,t){return o("logicalOr")}where(e){return o("where")}select(e,t,n){return o("select")}topk(e,t,n){return o("topk")}min(e,t){return o("min")}minimum(e,t){return o("minimum")}mod(e,t){return o("mod")}max(e,t){return o("max")}maximum(e,t){return o("maximum")}all(e,t){return o("all")}any(e,t){return o("any")}squaredDifference(e,t){return o("squaredDifference")}ceil(e){return o("ceil")}floor(e){return o("floor")}round(e){return o("round")}sign(e){return o("sign")}isNaN(e){return o("isNaN")}isInf(e){return o("isInf")}isFinite(e){return o("isFinite")}pow(e,t){return o("pow")}exp(e){return o("exp")}expm1(e){return o("expm1")}softmax(e,t){return o("softmax")}log(e){return o("log")}log1p(e){return o("log1p")}sqrt(e){return o("sqrt")}rsqrt(e){return o("rsqrt")}square(e){return o("square")}reciprocal(e){return o("reciprocal")}relu(e){return o("relu")}relu6(e){return o("relu6")}prelu(e,t){return o("prelu")}elu(e){return o("elu")}eluDer(e,t){return o("eluDer")}selu(e){return o("selu")}int(e){return o("int")}clip(e,t,n){return o("clip")}abs(e){return o("abs")}complexAbs(e){return o("complexAbs")}sigmoid(e){return o("sigmoid")}softplus(e){return o("softplus")}sin(e){return o("sin")}cos(e){return o("cos")}tan(e){return o("tan")}asin(e){return o("asin")}acos(e){return o("acos")}atan(e){return o("atan")}atan2(e,t){return o("atan2")}sinh(e){return o("sinh")}cosh(e){return o("cosh")}tanh(e){return o("tanh")}asinh(e){return o("asinh")}acosh(e){return o("acosh")}atanh(e){return o("atanh")}erf(e){return o("erf")}step(e,t){return o("step")}fusedConv2d({input:e,filter:t,convInfo:n,bias:r,activation:s,preluActivationWeights:i}){return o("fusedConv2d")}conv2d(e,t,n){return o("conv2d")}conv2dDerInput(e,t,n){return o("conv2dDerInput")}conv2dDerFilter(e,t,n){return o("conv2dDerFilter")}fusedDepthwiseConv2D({input:e,filter:t,convInfo:n,bias:r,activation:s,preluActivationWeights:i}){return o("fusedDepthwiseConv2D")}depthwiseConv2D(e,t,n){return o("depthwiseConv2D")}depthwiseConv2DDerInput(e,t,n){return o("depthwiseConv2DDerInput")}depthwiseConv2DDerFilter(e,t,n){return o("depthwiseConv2DDerFilter")}conv3d(e,t,n){return o("conv3d")}conv3dDerInput(e,t,n){return o("conv3dDerInput")}conv3dDerFilter(e,t,n){return o("conv3dDerFilter")}maxPool(e,t){return o("maxPool")}maxPoolBackprop(e,t,n,r){return o("maxPoolBackprop")}avgPool(e,t){return o("avgPool")}avgPoolBackprop(e,t,n){return o("avgPoolBackprop")}avgPool3d(e,t){return o("avgPool3d")}avgPool3dBackprop(e,t,n){return o("avgPool3dBackprop")}maxPool3d(e,t){return o("maxPool3d")}maxPool3dBackprop(e,t,n,r){return o("maxPool3dBackprop")}reshape(e,t){return o("reshape")}cast(e,t){return o("cast")}tile(e,t){return o("tile")}pad(e,t,n){return o("pad")}transpose(e,t){return o("transpose")}gather(e,t,n){return o("gather")}gatherND(e,t){return o("gatherND")}scatterND(e,t,n){return o("scatterND")}batchToSpaceND(e,t,n){return o("batchToSpaceND")}spaceToBatchND(e,t,n){return o("spaceToBatchND")}resizeBilinear(e,t,n,r){return o("resizeBilinear")}resizeBilinearBackprop(e,t,n){return o("resizeBilinearBackprop")}resizeNearestNeighbor(e,t,n,r){return o("resizeNearestNeighbor")}resizeNearestNeighborBackprop(e,t,n){return o("resizeNearestNeighborBackprop")}batchNorm(e,t,n,r,s,i){return o("batchNorm")}localResponseNormalization4D(e,t,n,r,s){return o("localResponseNormalization4D")}LRNGrad(e,t,n,r,s,i,a){return o("LRNGrad")}multinomial(e,t,n,r){return o("multinomial")}oneHot(e,t,n,r){return o("oneHot")}cumsum(e,t,n,r){return o("cumsum")}nonMaxSuppression(e,t,n,r,s){return o("nonMaxSuppression")}fft(e){return o("fft")}ifft(e){return o("ifft")}complex(e,t){return o("complex")}real(e){return o("real")}imag(e){return o("imag")}cropAndResize(e,t,n,r,s,i){return o("cropAndResize")}depthToSpace(e,t,n){return o("depthToSpace")}split(e,t,n){return o("split")}sparseToDense(e,t,n,r){return o("sparseToDense")}diag(e){return o("diag")}fill(e,t,n){return o("fill")}onesLike(e){return o("onesLike")}zerosLike(e){return o("zerosLike")}linspace(e,t,n){return o("linspace")}dispose(){return o("dispose")}}function o(e){throw new Error(`'${e}' not yet implemented or not found in the registry. This kernel may not be supported by the tfjs backend you have chosen`)}},73:(e,t,n)=>{"use strict";n.d(t,{o:()=>i});var r=n(6197),o=n(693),s=n(6777);const i=(0,n(3397).op)({clone_:function(e){const t=(0,s.YT)(e,"x","clone",null),n={x:t};return r.T2.runKernelFunc((()=>r.T2.makeTensorFromDataId(t.dataId,t.shape,t.dtype)),n,null,o.lz)}})},239:(e,t,n)=>{"use strict";n.d(t,{qY:()=>y,yl:()=>l,rT:()=>w,B4:()=>g,Q5:()=>m,qP:()=>d});var r=n(7315);function o(e,t,n,o){const i=(0,r.Ur)(t),c=function(e,t,n,o){const i=(0,r.Ze)(t),a=o[o.length-1],c=new Array(a).fill(0),l=t.length,p="complex64"===n?u(e):e;if(l>1)for(let e=0;e<i/a;e++){const t=e*a;for(let e=0;e<a;e++)c[e]=Math.max(c[e],s(p[t+e],0,n).length)}return c}(e,t,n,i),l=t.length,p=a(e,t,n,i,c),h=["Tensor"];return o&&(h.push(` dtype: ${n}`),h.push(` rank: ${l}`),h.push(` shape: [${t}]`),h.push(" values:")),h.push(p.map((e=>" "+e)).join("\n")),h.join("\n")}function s(e,t,n){let o;return o=Array.isArray(e)?`${parseFloat(e[0].toFixed(7))} + ${parseFloat(e[1].toFixed(7))}j`:(0,r.Kg)(e)?`'${e}'`:"bool"===n?i(e):parseFloat(e.toFixed(7)).toString(),(0,r.av)(o,t)}function i(e){return 0===e?"false":"true"}function a(e,t,n,r,o,c=!0){const l="complex64"===n?2:1,p=t[0],h=t.length;if(0===h){if("complex64"===n){return[s(u(e)[0],0,n)]}return"bool"===n?[i(e[0])]:[e[0].toString()]}if(1===h){if(p>20){const t=3*l;let r=Array.from(e.slice(0,t)),i=Array.from(e.slice((p-3)*l,p*l));return"complex64"===n&&(r=u(r),i=u(i)),["["+r.map(((e,t)=>s(e,o[t],n))).join(", ")+", ..., "+i.map(((e,t)=>s(e,o[p-3+t],n))).join(", ")+"]"]}return["["+("complex64"===n?u(e):Array.from(e)).map(((e,t)=>s(e,o[t],n))).join(", ")+"]"]}const f=t.slice(1),d=r.slice(1),m=r[0]*l,g=[];if(p>20){for(let t=0;t<3;t++){const r=t*m,s=r+m;g.push(...a(e.slice(r,s),f,n,d,o,!1))}g.push("...");for(let t=p-3;t<p;t++){const r=t*m,s=r+m;g.push(...a(e.slice(r,s),f,n,d,o,t===p-1))}}else for(let t=0;t<p;t++){const r=t*m,s=r+m;g.push(...a(e.slice(r,s),f,n,d,o,t===p-1))}const y=2===h?",":"";g[0]="["+g[0]+y;for(let e=1;e<g.length-1;e++)g[e]=" "+g[e]+y;let w=",\n";for(let e=2;e<h;e++)w+="\n";return g[g.length-1]=" "+g[g.length-1]+"]"+(c?"":w),g}function u(e){const t=[];for(let n=0;n<e.length;n+=2)t.push([e[n],e[n+1]]);return t}var c=n(6131);class l{constructor(e,t,n){if(this.dtype=t,this.shape=e.slice(),this.size=r.Ze(e),null!=n){const e=n.length;r.vA(e===this.size,(()=>`Length of values '${e}' does not match the size inferred by the shape '${this.size}'.`))}if("complex64"===t)throw new Error("complex64 dtype TensorBuffers are not supported. Please create a TensorBuffer for the real and imaginary parts separately and call tf.complex(real, imag).");this.values=n||r.Ab(t,this.size),this.strides=(0,r.Ur)(e)}set(e,...t){0===t.length&&(t=[0]),r.vA(t.length===this.rank,(()=>`The number of provided coordinates (${t.length}) must match the rank (${this.rank})`));const n=this.locToIndex(t);this.values[n]=e}get(...e){0===e.length&&(e=[0]);let t=0;for(const n of e){if(n<0||n>=this.shape[t]){const t=`Requested out of range element at ${e}. Buffer shape=${this.shape}`;throw new Error(t)}t++}let n=e[e.length-1];for(let t=0;t<e.length-1;++t)n+=this.strides[t]*e[t];return this.values[n]}locToIndex(e){if(0===this.rank)return 0;if(1===this.rank)return e[0];let t=e[e.length-1];for(let n=0;n<e.length-1;++n)t+=this.strides[n]*e[n];return t}indexToLoc(e){if(0===this.rank)return[];if(1===this.rank)return[e];const t=new Array(this.shape.length);for(let n=0;n<t.length-1;++n)t[n]=Math.floor(e/this.strides[n]),e-=t[n]*this.strides[n];return t[t.length-1]=e,t}get rank(){return this.shape.length}toTensor(){return p().makeTensor(this.values,this.shape,this.dtype)}}let p=null,h=null,f=null;function d(e){p=e}function m(e){h=e}function g(e){f=e}class y{constructor(e,t,n,o){this.kept=!1,this.isDisposedInternal=!1,this.shape=e.slice(),this.dtype=t||"float32",this.size=r.Ze(e),this.strides=(0,r.Ur)(e),this.dataId=n,this.id=o,this.rankType=this.rank<5?this.rank.toString():"higher"}get rank(){return this.shape.length}async buffer(){const e=await this.data();return h.buffer(this.shape,this.dtype,e)}bufferSync(){return h.buffer(this.shape,this.dtype,this.dataSync())}async array(){const e=await this.data();return(0,r.yw)(this.shape,e)}arraySync(){return(0,r.yw)(this.shape,this.dataSync())}async data(){this.throwIfDisposed();const e=p().read(this.dataId);if("string"===this.dtype){const t=await e;try{return t.map((e=>c.decodeString(e)))}catch(e){throw new Error("Failed to decode the string bytes into utf-8. To get the original bytes, call tensor.bytes().")}}return e}dataSync(){this.throwIfDisposed();const e=p().readSync(this.dataId);if("string"===this.dtype)try{return e.map((e=>c.decodeString(e)))}catch(e){throw new Error("Failed to decode the string bytes into utf-8. To get the original bytes, call tensor.bytes().")}return e}async bytes(){this.throwIfDisposed();const e=await p().read(this.dataId);return"string"===this.dtype?e:new Uint8Array(e.buffer)}dispose(){this.isDisposed||(p().disposeTensor(this),this.isDisposedInternal=!0)}get isDisposed(){return this.isDisposedInternal}throwIfDisposed(){if(this.isDisposed)throw new Error("Tensor is disposed.")}print(e=!1){return h.print(this,e)}clone(){return this.throwIfDisposed(),h.clone(this)}toString(e=!1){return o(this.dataSync(),this.shape,this.dtype,e)}cast(e){return this.throwIfDisposed(),h.cast(this,e)}variable(e=!0,t,n){return this.throwIfDisposed(),p().makeVariable(this,e,t,n)}}Object.defineProperty(y,Symbol.hasInstance,{value:e=>!!e&&null!=e.data&&null!=e.dataSync&&null!=e.throwIfDisposed});class w extends y{constructor(e,t,n,r){super(e.shape,e.dtype,e.dataId,r),this.trainable=t,this.name=n}assign(e){if(e.dtype!==this.dtype)throw new Error(`dtype of the new value (${e.dtype}) and previous value (${this.dtype}) must match`);if(!r.r1(e.shape,this.shape))throw new Error(`shape of the new value (${e.shape}) and previous value (${this.shape}) must match`);p().disposeTensor(this),this.dataId=e.dataId,p().incRef(this,null)}dispose(){p().disposeVariable(this),this.isDisposedInternal=!0}}Object.defineProperty(w,Symbol.hasInstance,{value:e=>e instanceof y&&null!=e.assign&&e.assign instanceof Function})},381:e=>{"use strict";e.exports={}},382:()=>{},523:(e,t,n)=>{"use strict";let r;function o(){if(null==r){let e;if("undefined"!=typeof window)e=window;else if("undefined"!=typeof global)e=global;else if("undefined"!=typeof process)e=process;else{if("undefined"==typeof self)throw new Error("Could not find a global object");e=self}r=e}return r}function s(e,t){const n=function(){const e=o();return null==e._tfGlobals&&(e._tfGlobals=new Map),e._tfGlobals}();if(n.has(e))return n.get(e);{const r=t();return n.set(e,r),n.get(e)}}n.d(t,{L:()=>o,m:()=>s})},576:(e,t,n)=>{"use strict";n.d(t,{j:()=>a});var r=n(6197),o=n(693),s=n(6777),i=n(3709);const a=(0,n(3397).op)({relu6_:function(e){const t=(0,s.YT)(e,"x","relu6"),n={x:t};return r.T2.runKernelFunc(((e,n)=>(n([t]),"bool"===t.dtype?(0,i.w)(t,"int32"):e.relu6(t))),n,null,o.P_)}})},586:(e,t,n)=>{"use strict";n.d(t,{t:()=>a});var r=n(6197),o=n(693),s=n(6777),i=n(7315);const a=(0,n(3397).op)({reshape_:function(e,t){const n=(0,s.YT)(e,"x","reshape",null),a={x:n},u={shape:t};return r.T2.runKernelFunc(((e,r)=>(t=i.XT(t,n.size),i.vA(n.size===i.Ze(t),(()=>"new shape and old shape must have the same number of elements.")),r([n]),e.reshape(n,t))),a,null,o.R2,u)}})},639:(e,t,n)=>{"use strict";n.d(t,{O:()=>s});var r=n(6777),o=n(7647);function s(e,t,n){const s=(0,r.MZ)(e,n);return(0,o.Q)(e,t,s,n)}},693:(e,t,n)=>{"use strict";n.d(t,{$d:()=>E,A1:()=>P,A8:()=>gt,BK:()=>Dt,BL:()=>Fe,BR:()=>Q,Bl:()=>yt,Bx:()=>te,CE:()=>S,Cg:()=>ye,Cw:()=>me,D7:()=>rt,Dd:()=>bt,E3:()=>he,Ek:()=>a,El:()=>re,Ew:()=>Et,FA:()=>Nt,FC:()=>tt,FS:()=>c,Fi:()=>ft,Hx:()=>it,Ik:()=>k,J3:()=>lt,Ji:()=>ut,Jp:()=>l,K2:()=>wt,KX:()=>x,LB:()=>T,LD:()=>Ne,LG:()=>Pe,LR:()=>We,LW:()=>je,LX:()=>Se,M3:()=>ge,M6:()=>St,MR:()=>z,Mn:()=>B,NV:()=>Be,Nc:()=>Ge,OA:()=>ce,OD:()=>Re,OM:()=>i,P:()=>U,PH:()=>s,P_:()=>nt,Pb:()=>vt,Q6:()=>Ue,QD:()=>N,QK:()=>h,R2:()=>Je,RU:()=>we,SD:()=>ze,SQ:()=>ee,TB:()=>At,TM:()=>M,TO:()=>st,Ty:()=>d,Uc:()=>kt,VA:()=>xe,Vv:()=>o,Wu:()=>mt,X$:()=>j,XQ:()=>Xe,Xh:()=>ie,YV:()=>pt,Zg:()=>ne,Zl:()=>Me,_s:()=>V,bP:()=>K,cS:()=>b,dF:()=>dt,dX:()=>qt,dv:()=>le,e0:()=>Le,eD:()=>qe,ep:()=>f,fP:()=>Ie,fU:()=>Qe,g5:()=>Oe,gC:()=>F,gI:()=>pe,hV:()=>ot,hg:()=>et,ho:()=>y,hq:()=>ct,hu:()=>Ve,i:()=>H,i5:()=>oe,iG:()=>D,iP:()=>fe,iu:()=>xt,jA:()=>v,jM:()=>ke,jO:()=>Ze,jZ:()=>Te,jf:()=>_,jx:()=>R,kd:()=>He,lL:()=>ae,lN:()=>_e,lj:()=>r,lx:()=>g,lz:()=>ue,mI:()=>de,mx:()=>se,nV:()=>C,nY:()=>Y,nZ:()=>be,oF:()=>Tt,ox:()=>J,p2:()=>q,pP:()=>Ot,p_:()=>p,pk:()=>G,pn:()=>Pt,pr:()=>I,py:()=>Ke,rF:()=>O,rG:()=>X,rs:()=>W,t2:()=>$,t3:()=>Ae,tG:()=>L,u$:()=>at,u8:()=>u,ur:()=>Ce,v:()=>A,vI:()=>ht,vq:()=>w,wx:()=>It,x7:()=>De,xJ:()=>_t,xu:()=>$e,yS:()=>Ee,yb:()=>Z,yl:()=>Ye,zP:()=>m,zf:()=>ve});const r="Abs",o="Acos",s="Acosh",i="Add",a="AddN",u="All",c="Any",l="ArgMax",p="ArgMin",h="Asin",f="Asinh",d="Atan",m="Atanh",g="Atan2",y="AvgPool",w="AvgPoolBackprop",b="AvgPool3D",S="AvgPool3DBackprop",v="BatchMatMul",k="BatchToSpaceND",T="BroadcastTo",x="Cast",N="Ceil",A="ClipByValue",I="Complex",E="Concat",q="Conv2D",O="Conv2DBackpropFilter",_="Conv2DBackpropInput",P="Conv3D",D="Conv3DBackpropFilterV2",F="Conv3DBackpropInputV2",$="Cos",B="Cosh",Y="Cumsum",z="CropAndResize",M="DepthToSpace",L="DepthwiseConv2dNative",j="DepthwiseConv2dNativeBackpropFilter",C="DepthwiseConv2dNativeBackpropInput",R="Dilation2D",K="Dilation2DBackpropInput",G="Dilation2DBackpropFilter",H="Div",U="Elu",W="EluGrad",V="Erf",Q="Equal",J="Exp",Z="Expm1",X="FFT",ee="Fill",te="FlipLeftRight",ne="Floor",re="FloorDiv",oe="FusedBatchNorm",se="GatherV2",ie="Greater",ae="GreaterEqual",ue="Identity",ce="IFFT",le="Imag",pe="IsFinite",he="IsInf",fe="IsNan",de="Less",me="LessEqual",ge="Log",ye="Log1p",we="LogicalAnd",be="LogicalNot",Se="LogicalOr",ve="LogSoftmax",ke="LRN",Te="LRNBackprop",xe="Max",Ne="Maximum",Ae="MaxPool",Ie="MaxPoolBackprop",Ee="MaxPool3D",qe="MaxPool3DBackprop",Oe="Mean",_e="Min",Pe="Minimum",De="MirrorPad",Fe="Mod",$e="Multiply",Be="Negate",Ye="NotEqual",ze="NonMaxSuppressionV3",Me="NonMaxSuppressionV4",Le="NonMaxSuppressionV5",je="OnesLike",Ce="OneHot",Re="PadV2",Ke="Pow",Ge="Prelu",He="Prod",Ue="Range",We="Real",Ve="Reciprocal",Qe="Relu",Je="Reshape",Ze="ResizeNearestNeighbor",Xe="ResizeNearestNeighborGrad",et="ResizeBilinear",tt="ResizeBilinearGrad",nt="Relu6",rt="Reverse",ot="Round",st="Rsqrt",it="SelectV2",at="Selu",ut="Slice",ct="Sin",lt="Sinh",pt="Sign",ht="Sigmoid",ft="Softplus",dt="Sqrt",mt="Sum",gt="SpaceToBatchND",yt="SplitV",wt="Softmax",bt="SquaredDifference",St="Square",vt="Sub",kt="StridedSlice",Tt="Tan",xt="Tanh",Nt="Tile",At="TopK",It="Transpose",Et="Unique",qt="Unpack",Ot="UnsortedSegmentSum",_t="ZerosLike",Pt="Step",Dt="RotateWithOffset"},734:(e,t,n)=>{"use strict";n.d(t,{N:()=>i});var r=n(6197),o=n(693),s=n(6777);const i=(0,n(3397).op)({prelu_:function(e,t){const n=(0,s.YT)(e,"x","prelu"),i=(0,s.YT)(t,"alpha","prelu"),a={x:n,alpha:i};return r.T2.runKernelFunc(((e,t)=>{const r=e.prelu(n,i);return t([n,i]),r}),a,null,o.Nc)}})},955:(e,t,n)=>{"use strict";n.r(t),n.d(t,{userAgent:()=>r});const r=""},1049:(e,t,n)=>{"use strict";n.d(t,{L:()=>o,P:()=>s});var r=n(7315);function o(e,t){const n=e[0].length;e.forEach(((e,t)=>{r.vA(e.length===n,(()=>`Error in concat${n}D: rank of tensors[${t}] must be the same as the rank of the rest (${n})`))})),r.vA(t>=0&&t<n,(()=>`Error in concat${n}D: axis must be between 0 and ${n-1}.`));const o=e[0];e.forEach(((e,s)=>{for(let i=0;i<n;i++)r.vA(i===t||e[i]===o[i],(()=>`Error in concat${n}D: Shape of tensors[${s}] (${e}) does not match the shape of the rest (${o}) along the non-concatenated axis ${s}.`))}))}function s(e,t){const n=e[0].slice();for(let r=1;r<e.length;r++)n[t]+=e[r][t];return n}},1065:function(e,t,n){var r;!function(e,o){function s(e){var t=this,n="";t.next=function(){var e=t.b,n=t.c,r=t.d,o=t.a;return e=e<<25^e>>>7^n,n=n-r|0,r=r<<24^r>>>8^o,o=o-e|0,t.b=e=e<<20^e>>>12^n,t.c=n=n-r|0,t.d=r<<16^n>>>16^o,t.a=o-e|0},t.a=0,t.b=0,t.c=-1640531527,t.d=1367130551,e===Math.floor(e)?(t.a=e/4294967296|0,t.b=0|e):n+=e;for(var r=0;r<n.length+20;r++)t.b^=0|n.charCodeAt(r),t.next()}function i(e,t){return t.a=e.a,t.b=e.b,t.c=e.c,t.d=e.d,t}function a(e,t){var n=new s(e),r=t&&t.state,o=function(){return(n.next()>>>0)/4294967296};return o.double=function(){do{var e=((n.next()>>>11)+(n.next()>>>0)/4294967296)/(1<<21)}while(0===e);return e},o.int32=n.next,o.quick=o,r&&("object"==typeof r&&i(r,n),o.state=function(){return i(n,{})}),o}o&&o.exports?o.exports=a:n.amdD&&n.amdO?void 0===(r=function(){return a}.call(t,n,t,o))||(o.exports=r):this.tychei=a}(0,e=n.nmd(e),n.amdD)},1068:(e,t,n)=>{"use strict";n.d(t,{$:()=>c});var r=n(6197),o=n(693),s=n(6777),i=n(7315),a=n(586);function u(e){return null==e?null:0===e.rank?(0,a.t)(e,[e.size]):1===e.rank?e:2===e.rank?(0,a.t)(e,[1,1,e.shape[0],e.shape[1]]):3===e.rank?(0,a.t)(e,[1,e.shape[0],e.shape[1],e.shape[2]]):e}const c=(0,n(3397).op)({batchNorm_:function(e,t,n,c,l,p){null==p&&(p=.001);const h=(0,s.YT)(e,"x","batchNorm"),f=(0,s.YT)(t,"mean","batchNorm"),d=(0,s.YT)(n,"variance","batchNorm");let m,g;null!=l&&(m=(0,s.YT)(l,"scale","batchNorm")),null!=c&&(g=(0,s.YT)(c,"offset","batchNorm")),i.vA(f.rank===d.rank,(()=>"Batch normalization gradient requires mean and variance to have equal ranks.")),i.vA(null==g||f.rank===g.rank,(()=>"Batch normalization gradient requires mean and offset to have equal ranks.")),i.vA(null==m||f.rank===m.rank,(()=>"Batch normalization gradient requires mean and scale to have equal ranks."));const y=function(e){let t;return t=0===e.rank||1===e.rank?(0,a.t)(e,[1,1,1,e.size]):2===e.rank?(0,a.t)(e,[1,1,e.shape[0],e.shape[1]]):3===e.rank?(0,a.t)(e,[1,e.shape[0],e.shape[1],e.shape[2]]):e,t}(h),w={x:y,scale:m,offset:g,mean:f,variance:d},b={varianceEpsilon:p},S=r.T2.runKernelFunc(((e,t)=>(t([y,f,d,m]),e.batchNorm(y,u(f),u(d),u(g),u(m),p))),w,null,o.i5,b);return(0,a.t)(S,h.shape)}})},1124:(e,t,n)=>{"use strict";n.d(t,{X:()=>o,j:()=>r});const r=1.7580993408473768,o=1.0507009873554805},1137:(e,t,n)=>{"use strict";e.exports=u;var r,o=n(5382),s=o.LongBits,i=o.utf8;function a(e,t){return RangeError("index out of range: "+e.pos+" + "+(t||1)+" > "+e.len)}function u(e){this.buf=e,this.pos=0,this.len=e.length}var c,l="undefined"!=typeof Uint8Array?function(e){if(e instanceof Uint8Array||Array.isArray(e))return new u(e);throw Error("illegal buffer")}:function(e){if(Array.isArray(e))return new u(e);throw Error("illegal buffer")},p=function(){return o.Buffer?function(e){return(u.create=function(e){return o.Buffer.isBuffer(e)?new r(e):l(e)})(e)}:l};function h(){var e=new s(0,0),t=0;if(!(this.len-this.pos>4)){for(;t<3;++t){if(this.pos>=this.len)throw a(this);if(e.lo=(e.lo|(127&this.buf[this.pos])<<7*t)>>>0,this.buf[this.pos++]<128)return e}return e.lo=(e.lo|(127&this.buf[this.pos++])<<7*t)>>>0,e}for(;t<4;++t)if(e.lo=(e.lo|(127&this.buf[this.pos])<<7*t)>>>0,this.buf[this.pos++]<128)return e;if(e.lo=(e.lo|(127&this.buf[this.pos])<<28)>>>0,e.hi=(e.hi|(127&this.buf[this.pos])>>4)>>>0,this.buf[this.pos++]<128)return e;if(t=0,this.len-this.pos>4){for(;t<5;++t)if(e.hi=(e.hi|(127&this.buf[this.pos])<<7*t+3)>>>0,this.buf[this.pos++]<128)return e}else for(;t<5;++t){if(this.pos>=this.len)throw a(this);if(e.hi=(e.hi|(127&this.buf[this.pos])<<7*t+3)>>>0,this.buf[this.pos++]<128)return e}throw Error("invalid varint encoding")}function f(e,t){return(e[t-4]|e[t-3]<<8|e[t-2]<<16|e[t-1]<<24)>>>0}function d(){if(this.pos+8>this.len)throw a(this,8);return new s(f(this.buf,this.pos+=4),f(this.buf,this.pos+=4))}u.create=p(),u.prototype._slice=o.Array.prototype.subarray||o.Array.prototype.slice,u.prototype.uint32=(c=4294967295,function(){if(c=(127&this.buf[this.pos])>>>0,this.buf[this.pos++]<128)return c;if(c=(c|(127&this.buf[this.pos])<<7)>>>0,this.buf[this.pos++]<128)return c;if(c=(c|(127&this.buf[this.pos])<<14)>>>0,this.buf[this.pos++]<128)return c;if(c=(c|(127&this.buf[this.pos])<<21)>>>0,this.buf[this.pos++]<128)return c;if(c=(c|(15&this.buf[this.pos])<<28)>>>0,this.buf[this.pos++]<128)return c;if((this.pos+=5)>this.len)throw this.pos=this.len,a(this,10);return c}),u.prototype.int32=function(){return 0|this.uint32()},u.prototype.sint32=function(){var e=this.uint32();return e>>>1^-(1&e)},u.prototype.bool=function(){return 0!==this.uint32()},u.prototype.fixed32=function(){if(this.pos+4>this.len)throw a(this,4);return f(this.buf,this.pos+=4)},u.prototype.sfixed32=function(){if(this.pos+4>this.len)throw a(this,4);return 0|f(this.buf,this.pos+=4)},u.prototype.float=function(){if(this.pos+4>this.len)throw a(this,4);var e=o.float.readFloatLE(this.buf,this.pos);return this.pos+=4,e},u.prototype.double=function(){if(this.pos+8>this.len)throw a(this,4);var e=o.float.readDoubleLE(this.buf,this.pos);return this.pos+=8,e},u.prototype.bytes=function(){var e=this.uint32(),t=this.pos,n=this.pos+e;if(n>this.len)throw a(this,e);return this.pos+=e,Array.isArray(this.buf)?this.buf.slice(t,n):t===n?new this.buf.constructor(0):this._slice.call(this.buf,t,n)},u.prototype.string=function(){var e=this.bytes();return i.read(e,0,e.length)},u.prototype.skip=function(e){if("number"==typeof e){if(this.pos+e>this.len)throw a(this,e);this.pos+=e}else do{if(this.pos>=this.len)throw a(this)}while(128&this.buf[this.pos++]);return this},u.prototype.skipType=function(e){switch(e){case 0:this.skip();break;case 1:this.skip(8);break;case 2:this.skip(this.uint32());break;case 3:for(;4!=(e=7&this.uint32());)this.skipType(e);break;case 5:this.skip(4);break;default:throw Error("invalid wire type "+e+" at offset "+this.pos)}return this},u._configure=function(e){r=e,u.create=p(),r._configure();var t=o.Long?"toLong":"toNumber";o.merge(u.prototype,{int64:function(){return h.call(this)[t](!1)},uint64:function(){return h.call(this)[t](!0)},sint64:function(){return h.call(this).zzDecode()[t](!1)},fixed64:function(){return d.call(this)[t](!0)},sfixed64:function(){return d.call(this)[t](!1)}})}},1475:(e,t,n)=>{"use strict";n.d(t,{j:()=>l});var r=n(6197),o=n(693),s=n(6777),i=n(7315),a=n(2527),u=n(3397),c=n(586);const l=(0,u.op)({maxPool_:function(e,t,n,u,l){const p=(0,s.YT)(e,"x","maxPool");let h=p,f=!1;3===p.rank&&(f=!0,h=(0,c.t)(p,[1,p.shape[0],p.shape[1],p.shape[2]])),i.vA(4===h.rank,(()=>`Error in maxPool: input must be rank 4 but got rank ${h.rank}.`)),i.vA(a.G0(n,1),(()=>`Error in maxPool: Either strides or dilations must be 1. Got strides ${n} and dilations '1'`)),null!=l&&i.vA(i.E6(u),(()=>`Error in maxPool: pad must be an integer when using, dimRoundingMode ${l} but got pad ${u}.`));const d={x:h},m={filterSize:t,strides:n,pad:u,dimRoundingMode:l},g=r.T2.runKernelFunc(((e,r)=>{const o=a.E6(h.shape,t,n,1,u,l);let s;return s=1===o.filterWidth&&1===o.filterHeight&&i.r1(o.inShape,o.outShape)?h.clone():e.maxPool(h,o),r([h,s]),s}),d,null,o.t3,m);return f?(0,c.t)(g,[g.shape[1],g.shape[2],g.shape[3]]):g}})},1580:(e,t,n)=>{"use strict";n.d(t,{V:()=>u});var r=n(6197),o=n(693),s=n(6777),i=n(3397),a=n(3709);const u=(0,i.op)({relu_:function(e){const t=(0,s.YT)(e,"x","relu"),n={x:t};return r.T2.runKernelFunc(((e,n)=>(n([t]),"bool"===t.dtype?(0,a.w)(t,"int32"):e.relu(t))),n,null,o.fU)}})},1630:(e,t,n)=>{"use strict";n.d(t,{l:()=>a});var r=n(6197),o=n(693),s=n(7025),i=n(6777);const a=(0,n(3397).op)({mul_:function(e,t){let n=(0,i.YT)(e,"a","mul"),a=(0,i.YT)(t,"b","mul");[n,a]=(0,s.h0)(n,a);const u={a:n,b:a};return r.T2.runKernelFunc(((e,t)=>{const r=e.multiply(n,a);return t([n,a]),r}),u,null,o.xu)}})},1723:function(e,t,n){var r;!function(e,o){function s(e){var t=this,n="";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:n+=e;for(var r=0;r<n.length+64;r++)t.x^=0|n.charCodeAt(r),r==n.length&&(t.d=t.x<<10^t.x>>>4),t.next()}function i(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 n=new s(e),r=t&&t.state,o=function(){return(n.next()>>>0)/4294967296};return o.double=function(){do{var e=((n.next()>>>11)+(n.next()>>>0)/4294967296)/(1<<21)}while(0===e);return e},o.int32=n.next,o.quick=o,r&&("object"==typeof r&&i(r,n),o.state=function(){return i(n,{})}),o}o&&o.exports?o.exports=a:n.amdD&&n.amdO?void 0===(r=function(){return a}.call(t,n,t,o))||(o.exports=r):this.xorwow=a}(0,e=n.nmd(e),n.amdD)},1758:(e,t,n)=>{"use strict";n.d(t,{A:()=>o});var r=n(7151),o=r.tensorflow.magenta.NoteSequence},1925:module=>{"use strict";function inquire(moduleName){try{var mod=eval("quire".replace(/^/,"re"))(moduleName);if(mod&&(mod.length||Object.keys(mod).length))return mod}catch(e){}return null}module.exports=inquire},1979:(e,t)=>{"use strict";var n=t;n.length=function(e){var t=e.length;if(!t)return 0;for(var n=0;--t%4>1&&"="===e.charAt(t);)++n;return Math.ceil(3*e.length)/4-n};for(var r=new Array(64),o=new Array(123),s=0;s<64;)o[r[s]=s<26?s+65:s<52?s+71:s<62?s-4:s-59|43]=s++;n.encode=function(e,t,n){for(var o,s=null,i=[],a=0,u=0;t<n;){var c=e[t++];switch(u){case 0:i[a++]=r[c>>2],o=(3&c)<<4,u=1;break;case 1:i[a++]=r[o|c>>4],o=(15&c)<<2,u=2;break;case 2:i[a++]=r[o|c>>6],i[a++]=r[63&c],u=0}a>8191&&((s||(s=[])).push(String.fromCharCode.apply(String,i)),a=0)}return u&&(i[a++]=r[o],i[a++]=61,1===u&&(i[a++]=61)),s?(a&&s.push(String.fromCharCode.apply(String,i.slice(0,a))),s.join("")):String.fromCharCode.apply(String,i.slice(0,a))};var i="invalid encoding";n.decode=function(e,t,n){for(var r,s=n,a=0,u=0;u<e.length;){var c=e.charCodeAt(u++);if(61===c&&a>1)break;if(void 0===(c=o[c]))throw Error(i);switch(a){case 0:r=c,a=1;break;case 1:t[n++]=r<<2|(48&c)>>4,r=c,a=2;break;case 2:t[n++]=(15&r)<<4|(60&c)>>2,r=c,a=3;break;case 3:t[n++]=(3&r)<<6|c,a=0}}if(1===a)throw Error(i);return n-s},n.test=function(e){return/^(?:[A-Za-z0-9+/]{4})*(?:[A-Za-z0-9+/]{2}==|[A-Za-z0-9+/]{3}=)?$/.test(e)}},1996:(e,t,n)=>{"use strict";n.d(t,{M:()=>u});var r=n(6197),o=n(693),s=n(6777),i=n(3397),a=n(586);const u=(0,i.op)({oneHot_:function(e,t,n=1,i=0){if(t<2)throw new Error(`Error in oneHot: depth must be >=2, but it is ${t}`);const u=(0,s.YT)(e,"indices","oneHot","int32"),c=[...u.shape,t],l={indices:u},p={depth:t,onValue:n,offValue:i};return r.T2.runKernelFunc(((e,r)=>(r([u]),(0,a.t)(e.oneHot((0,a.t)(u,[u.size]),t,n,i),c))),l,null,o.ur,p)}})},2169:function(e,t,n){var r;!function(e,o){function s(e){var t=this,n="";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:n+=e;for(var r=0;r<n.length+64;r++)t.x^=0|n.charCodeAt(r),t.next()}function i(e,t){return t.x=e.x,t.y=e.y,t.z=e.z,t.w=e.w,t}function a(e,t){var n=new s(e),r=t&&t.state,o=function(){return(n.next()>>>0)/4294967296};return o.double=function(){do{var e=((n.next()>>>11)+(n.next()>>>0)/4294967296)/(1<<21)}while(0===e);return e},o.int32=n.next,o.quick=o,r&&("object"==typeof r&&i(r,n),o.state=function(){return i(n,{})}),o}o&&o.exports?o.exports=a:n.amdD&&n.amdO?void 0===(r=function(){return a}.call(t,n,t,o))||(o.exports=r):this.xor128=a}(0,e=n.nmd(e),n.amdD)},2527:(e,t,n)=>{"use strict";n.d(t,{$Q:()=>m,Dh:()=>f,E6:()=>o,G0:()=>d,l5:()=>s,p$:()=>a,uf:()=>i});var r=n(7315);function o(e,t,n,r,o,s,a="channelsLast"){const[u,l]=c(t);let p;if("channelsLast"===a)p=[u,l,e[3],e[3]];else{if("channelsFirst"!==a)throw new Error(`Unknown dataFormat ${a}`);p=[u,l,e[1],e[1]]}return i(e,p,n,r,o,s,!1,a)}function s(e,t,n,r,o,s,i="NDHWC"){const[u,c,p]=l(t);let h,f;if("NDHWC"===i)f="channelsLast",h=[u,c,p,e[4],e[4]];else{if("NCDHW"!==i)throw new Error(`Unknown dataFormat ${i}`);f="channelsFirst",h=[u,c,p,e[1],e[1]]}return a(e,h,n,r,o,!1,f,s)}function i(e,t,n,o,s,i,a=!1,l="channelsLast"){let[f,d,m,g]=[-1,-1,-1,-1];if("channelsLast"===l)[f,d,m,g]=e;else{if("channelsFirst"!==l)throw new Error(`Unknown dataFormat ${l}`);[f,g,d,m]=e}const[y,w,,b]=t,[S,v]=c(n),[k,T]=c(o),x=p(y,k),N=p(w,T),{padInfo:A,outHeight:I,outWidth:E}=function(e,t,n,o,s,i,a,c,l){let p,f,d;if("number"==typeof e){p={top:e,bottom:e,left:e,right:e,type:0===e?"VALID":"NUMBER"};const s=function(e,t,n,o,s){null==o&&(o=u(e,t,n));const i=e[0],a=e[1],c=h((i-t+2*o)/n+1,s);r.vA(r.E6(c),(()=>`The output # of rows (${c}) must be an integer. Change the stride and/or zero pad parameters`));const l=h((a-t+2*o)/n+1,s);return r.vA(r.E6(l),(()=>`The output # of columns (${l}) must be an integer. Change the stride and/or zero pad parameters`)),[c,l]}([t,n],i,o,e,c);f=s[0],d=s[1]}else if("same"===e){f=Math.ceil(t/o),d=Math.ceil(n/s);const e=Math.max(0,(f-1)*o+i-t),r=Math.max(0,(d-1)*s+a-n),u=Math.floor(e/2),c=e-u,l=Math.floor(r/2);p={top:u,bottom:c,left:l,right:r-l,type:"SAME"}}else if("valid"===e)p={top:0,bottom:0,left:0,right:0,type:"VALID"},f=Math.ceil((t-i+1)/o),d=Math.ceil((n-a+1)/s);else{if("object"!=typeof e)throw Error(`Unknown padding parameter: ${e}`);{const r="channelsLast"===l?e[1][0]:e[2][0],u="channelsLast"===l?e[1][1]:e[2][1],m="channelsLast"===l?e[2][0]:e[3][0],g="channelsLast"===l?e[2][1]:e[3][1];p={top:r,bottom:u,left:m,right:g,type:0===r&&0===u&&0===m&&0===g?"VALID":"EXPLICIT"},f=h((t-i+r+u)/o+1,c),d=h((n-a+m+g)/s+1,c)}}return{padInfo:p,outHeight:f,outWidth:d}}(s,d,m,S,v,x,N,i,l),q=a?b*g:b;let O;return"channelsFirst"===l?O=[f,q,I,E]:"channelsLast"===l&&(O=[f,I,E,q]),{batchSize:f,dataFormat:l,inHeight:d,inWidth:m,inChannels:g,outHeight:I,outWidth:E,outChannels:q,padInfo:A,strideHeight:S,strideWidth:v,filterHeight:y,filterWidth:w,effectiveFilterHeight:x,effectiveFilterWidth:N,dilationHeight:k,dilationWidth:T,inShape:e,outShape:O,filterShape:t}}function a(e,t,n,o,s,i=!1,a="channelsLast",c){let[f,d,m,g,y]=[-1,-1,-1,-1,-1];if("channelsLast"===a)[f,d,m,g,y]=e;else{if("channelsFirst"!==a)throw new Error(`Unknown dataFormat ${a}`);[f,y,d,m,g]=e}const[w,b,S,,v]=t,[k,T,x]=l(n),[N,A,I]=l(o),E=p(w,N),q=p(b,A),O=p(S,I),{padInfo:_,outDepth:P,outHeight:D,outWidth:F}=function(e,t,n,o,s,i,a,c,l,p,f){let d,m,g,y;if("number"==typeof e){d={top:e,bottom:e,left:e,right:e,front:e,back:e,type:0===e?"VALID":"NUMBER"};const i=function(e,t,n,o,s,i){null==s&&(s=u(e,t,o));const a=e[0],c=e[1],l=e[2],p=h((a-t+2*s)/o+1,i);r.vA(r.E6(p),(()=>`The output # of depths (${p}) must be an integer. Change the stride and/or zero pad parameters`));const f=h((c-t+2*s)/o+1,i);r.vA(r.E6(f),(()=>`The output # of rows (${f}) must be an integer. Change the stride and/or zero pad parameters`));const d=h((l-t+2*s)/o+1,i);return r.vA(r.E6(d),(()=>`The output # of columns (${d}) must be an integer. Change the stride and/or zero pad parameters`)),[p,f,d,n]}([t,n,o,1],c,1,s,e,f);m=i[0],g=i[1],y=i[2]}else if("same"===e){m=Math.ceil(t/s),g=Math.ceil(n/i),y=Math.ceil(o/a);const e=(m-1)*s+c-t,r=(g-1)*i+l-n,u=(y-1)*a+p-o,h=Math.floor(e/2),f=e-h,w=Math.floor(r/2),b=r-w,S=Math.floor(u/2);d={top:w,bottom:b,left:S,right:u-S,front:h,back:f,type:"SAME"}}else{if("valid"!==e)throw Error(`Unknown padding parameter: ${e}`);d={top:0,bottom:0,left:0,right:0,front:0,back:0,type:"VALID"},m=Math.ceil((t-c+1)/s),g=Math.ceil((n-l+1)/i),y=Math.ceil((o-p+1)/a)}return{padInfo:d,outDepth:m,outHeight:g,outWidth:y}}(s,d,m,g,k,T,x,E,q,O,c),$=i?v*y:v;let B;return"channelsFirst"===a?B=[f,$,P,D,F]:"channelsLast"===a&&(B=[f,P,D,F,$]),{batchSize:f,dataFormat:a,inDepth:d,inHeight:m,inWidth:g,inChannels:y,outDepth:P,outHeight:D,outWidth:F,outChannels:$,padInfo:_,strideDepth:k,strideHeight:T,strideWidth:x,filterDepth:w,filterHeight:b,filterWidth:S,effectiveFilterDepth:E,effectiveFilterHeight:q,effectiveFilterWidth:O,dilationDepth:N,dilationHeight:A,dilationWidth:I,inShape:e,outShape:B,filterShape:t}}function u(e,t,n,r=1){const o=p(t,r);return Math.floor((e[0]*(n-1)-n+o)/2)}function c(e){return"number"==typeof e?[e,e,e]:2===e.length?[e[0],e[1],1]:e}function l(e){return"number"==typeof e?[e,e,e]:e}function p(e,t){return t<=1?e:e+(e-1)*(t-1)}function h(e,t){if(!t)return e;switch(t){case"round":return Math.round(e);case"ceil":return Math.ceil(e);case"floor":return Math.floor(e);default:throw new Error(`Unknown roundingMode ${t}`)}}function f(e){const[t,n,r]=c(e);return 1===t&&1===n&&1===r}function d(e,t){return f(e)||f(t)}function m(e){if("NHWC"===e)return"channelsLast";if("NCHW"===e)return"channelsFirst";throw new Error(`Unknown dataFormat ${e}`)}},2596:(e,t,n)=>{"use strict";n.d(t,{assertIsRelativeQuantizedSequence:()=>o});n(1758),n(5447);Error;Error;Error;Error;class r extends Error{constructor(e){super(e),Object.setPrototypeOf(this,new.target.prototype)}}function o(e){if(!function(e){return e.quantizationInfo&&e.quantizationInfo.stepsPerQuarter>0}(e))throw new r(`NoteSequence ${e.id} is not quantized or is quantized based on absolute timing`)}},2611:(e,t,n)=>{"use strict";n.d(t,{h:()=>c});var r=n(6197),o=n(693),s=n(6777),i=n(73),a=n(3397),u=n(586);const c=(0,a.op)({broadcastTo_:function(e,t){let n=(0,s.YT)(e,"broadcastTo","x");const a=n.shape;if(t.some((e=>!(e>0)||e%1!=0)))throw new Error(`broadcastTo(): Invalid broadcast shape [${t}].`);if(t.length<n.rank)throw new Error(`broadcastTo(): shape.length=${t.length} < input.rank=${n.rank}.`);if(t.length>n.rank){const e=n.shape.slice();for(;e.length<t.length;)e.unshift(1);n=(0,u.t)(n,e)}const c=n.shape,l=Array.from(t);for(let e=t.length-1;e>=0;e--)if(c[e]===t[e])l[e]=1;else if(1!==n.shape[e])throw new Error(`broadcastTo(): [${a}] cannot be broadcast to [${t}].`);if(0===l.map(((e,t)=>e>1?t:-1)).filter((e=>e>=0)).length)return(0,i.o)(n);const p={x:n},h={shape:t,inputShape:c};return r.T2.runKernelFunc((e=>e.tile(n,l)),p,null,o.LB,h)}})},2656:(e,t,n)=>{"use strict";function r(e,t,n){const r=e.shape[n],o=[];let s=1,i=1;for(let t=0;t<n;t++)o.push(e.shape[t]),s*=e.shape[t];for(let e=0;e<t.rank;e++)o.push(t.shape[e]);for(let t=n+1;t<e.rank;t++)o.push(e.shape[t]),i*=e.shape[t];return{batchSize:s,sliceSize:i,dimSize:r,outputShape:o}}n.d(t,{collectGatherOpShapeInfo:()=>r})},2762:(e,t,n)=>{"use strict";var r,o,s,i,a;n.d(t,{Tu:()=>c}),function(e){e.R0="R0",e.R1="R1",e.R2="R2",e.R3="R3",e.R4="R4",e.R5="R5",e.R6="R6"}(r||(r={})),function(e){e.float32="float32",e.int32="int32",e.bool="int32",e.complex64="complex64"}(o||(o={})),function(e){e.float32="float32",e.int32="int32",e.bool="bool",e.complex64="complex64"}(s||(s={})),function(e){e.float32="float32",e.int32="float32",e.bool="float32",e.complex64="complex64"}(i||(i={})),function(e){e.float32="complex64",e.int32="complex64",e.bool="complex64",e.complex64="complex64"}(a||(a={}));const u={float32:i,int32:o,bool:s,complex64:a};function c(e,t){if("string"===e||"string"===t){if("string"===e&&"string"===t)return"string";throw new Error(`Can not upcast ${e} with ${t}`)}return u[e][t]}},2774:(e,t,n)=>{"use strict";n.d(t,{w:()=>c});var r=n(6777),o=n(7315),s=n(9614),i=n(2856),a=n(3397),u=n(586);const c=(0,a.op)({separableConv2d_:function(e,t,n,a,c,l=[1,1],p="NHWC"){const h=(0,r.YT)(e,"x","separableConv2d"),f=(0,r.YT)(t,"depthwiseFilter","separableConv2d"),d=(0,r.YT)(n,"pointwiseFilter","separableConv2d");let m=h,g=!1;if(3===h.rank&&(g=!0,m=(0,u.t)(h,[1,h.shape[0],h.shape[1],h.shape[2]])),"NCHW"===p)throw new Error("separableConv2d currently does not support dataFormat NCHW; only NHWC is supported");o.vA(4===m.rank,(()=>`Error in separableConv2d: input must be rank 4, but got rank ${m.rank}.`)),o.vA(4===f.rank,(()=>`Error in separableConv2d: depthwise filter must be rank 4, but got rank ${f.rank}.`)),o.vA(4===d.rank,(()=>`Error in separableConv2d: pointwise filter must be rank 4, but got rank ${f.rank}.`)),o.vA(1===d.shape[0],(()=>`Error in separableConv2d: the first dimension of pointwise filter must be 1, but got ${d.shape[0]}.`)),o.vA(1===d.shape[1],(()=>`Error in separableConv2d: the second dimension of pointwise filter must be 1, but got ${d.shape[1]}.`));const y=f.shape[2],w=f.shape[3];o.vA(d.shape[2]===y*w,(()=>`Error in separableConv2d: the third dimension of pointwise filter must be ${y*w}, but got ${d.shape[2]}.`));const b=(0,i.G)(m,f,a,c,p,l),S=(0,s.X)(b,d,1,"valid",p);return g?(0,u.t)(S,[S.shape[1],S.shape[2],S.shape[3]]):S}})},2778:(e,t,n)=>{"use strict";n.d(t,{j:()=>a});var r=n(6197),o=n(693),s=n(7025),i=n(6777);const a=(0,n(3397).op)({sub_:function(e,t){let n=(0,i.YT)(e,"a","sub"),a=(0,i.YT)(t,"b","sub");[n,a]=(0,s.h0)(n,a);const u={a:n,b:a};return r.T2.runKernelFunc(((e,t)=>{const r=e.subtract(n,a);return t([n,a]),r}),u,null,o.Pb)}})},2856:(e,t,n)=>{"use strict";n.d(t,{G:()=>l});var r=n(6197),o=n(693),s=n(6777),i=n(7315),a=n(2527),u=n(3397),c=n(586);const l=(0,u.op)({depthwiseConv2d_:function(e,t,n,u,l="NHWC",p=[1,1],h){const f=(0,s.YT)(e,"x","depthwiseConv2d"),d=(0,s.YT)(t,"filter","depthwiseConv2d");let m=f,g=!1;3===f.rank&&(g=!0,m=(0,c.t)(f,[1,f.shape[0],f.shape[1],f.shape[2]])),i.vA(4===m.rank,(()=>`Error in depthwiseConv2d: input must be rank 4, but got rank ${m.rank}.`)),i.vA(4===d.rank,(()=>`Error in depthwiseConv2d: filter must be rank 4, but got rank ${d.rank}.`)),i.vA(m.shape[3]===d.shape[2],(()=>`Error in depthwiseConv2d: number of input channels (${m.shape[3]}) must match the inChannels dimension in filter ${d.shape[2]}.`)),null!=h&&i.vA(i.E6(u),(()=>`Error in depthwiseConv2d: pad must be an integer when using, dimRoundingMode ${h} but got pad ${u}.`));const y={x:m,filter:d},w={strides:n,pad:u,dataFormat:l,dilations:p,dimRoundingMode:h},b=r.T2.runKernelFunc(((e,t)=>{null==p&&(p=[1,1]),i.vA(a.G0(n,p),(()=>`Error in depthwiseConv2d: Either strides or dilations must be 1. Got strides ${n} and dilations '${p}'`));const r=a.uf(m.shape,d.shape,n,p,u,h,!0),o=e.depthwiseConv2D(m,d,r);return t([m,d]),o}),y,null,o.tG,w);return g?(0,c.t)(b,[b.shape[1],b.shape[2],b.shape[3]]):b}})},2955:(e,t,n)=>{"use strict";n.d(t,{_:()=>c});var r=n(6197),o=n(693),s=n(6777),i=n(7315),a=n(2611),u=n(5330);const c=(0,n(3397).op)({where_:function(e,t,n){const c=(0,s.YT)(t,"a","where"),l=(0,s.YT)(n,"b","where"),p=(0,s.YT)(e,"condition","where","bool"),h=(0,u.Ky)(c.shape,l.shape),f=(0,a.h)(c,h),d=(0,a.h)(l,h);1===p.rank&&(0,i.vA)(p.shape[0]===c.shape[0],(()=>"The first dimension of `a` must match the size of `condition`.")),1!==p.rank&&(0,i.O3)(p.shape,d.shape,"Error in where: ");const m={condition:p,t:f,e:d};return r.T2.runKernelFunc(((e,t)=>{const n=e.select(p,f,d);return t([p]),n}),m,null,o.Hx)}})},2971:(e,t)=>{"use strict";var n=t;n.length=function(e){for(var t=0,n=0,r=0;r<e.length;++r)(n=e.charCodeAt(r))<128?t+=1:n<2048?t+=2:55296==(64512&n)&&56320==(64512&e.charCodeAt(r+1))?(++r,t+=4):t+=3;return t},n.read=function(e,t,n){if(n-t<1)return"";for(var r,o=null,s=[],i=0;t<n;)(r=e[t++])<128?s[i++]=r:r>191&&r<224?s[i++]=(31&r)<<6|63&e[t++]:r>239&&r<365?(r=((7&r)<<18|(63&e[t++])<<12|(63&e[t++])<<6|63&e[t++])-65536,s[i++]=55296+(r>>10),s[i++]=56320+(1023&r)):s[i++]=(15&r)<<12|(63&e[t++])<<6|63&e[t++],i>8191&&((o||(o=[])).push(String.fromCharCode.apply(String,s)),i=0);return o?(i&&o.push(String.fromCharCode.apply(String,s.slice(0,i))),o.join("")):String.fromCharCode.apply(String,s.slice(0,i))},n.write=function(e,t,n){for(var r,o,s=n,i=0;i<e.length;++i)(r=e.charCodeAt(i))<128?t[n++]=r:r<2048?(t[n++]=r>>6|192,t[n++]=63&r|128):55296==(64512&r)&&56320==(64512&(o=e.charCodeAt(i+1)))?(r=65536+((1023&r)<<10)+(1023&o),++i,t[n++]=r>>18|240,t[n++]=r>>12&63|128,t[n++]=r>>6&63|128,t[n++]=63&r|128):(t[n++]=r>>12|224,t[n++]=r>>6&63|128,t[n++]=63&r|128);return n-s}},3220:(e,t,n)=>{"use strict";n.d(t,{r:()=>s});var r=n(239),o=n(7315);function s(e,t="float32",n){return t=t||"float32",o.SA(e),new r.yl(e,t,n)}},3347:(e,t,n)=>{"use strict";n.d(t,{U:()=>i});var r=n(6197),o=n(7315),s=n(7240);function i(e,t="float32"){if("complex64"===t){const t=i(e,"float32"),n=i(e,"float32");return(0,s.f)(t,n)}const n=(0,o.Ty)((0,o.Ze)(e),t);return r.T2.makeTensor(n,e,t)}},3397:(e,t,n)=>{"use strict";n.d(t,{op:()=>i});var r=n(6197),o=n(7315);const s="__op";function i(e){const t=Object.keys(e);if(1!==t.length)throw new Error(`Please provide an object with a single key (operation name) mapping to a function. Got an object with ${t.length} keys.`);let n=t[0];const i=e[n];n.endsWith("_")&&(n=n.substring(0,n.length-1)),n+=s;const a=(...e)=>{r.T2.startScope(n);try{const t=i(...e);return(0,o.yL)(t)&&console.error("Cannot return a Promise inside of tidy."),r.T2.endScope(t),t}catch(e){throw r.T2.endScope(null),e}};return Object.defineProperty(a,"name",{value:n,configurable:!0}),a}},3408:(e,t,n)=>{"use strict";n.d(t,{P:()=>i});var r=n(6197),o=n(693),s=n(6777);const i=(0,n(3397).op)({step_:function(e,t=0){const n=(0,s.YT)(e,"x","step"),i={x:n},a={alpha:t};return r.T2.runKernelFunc((e=>e.step(n,t)),i,null,o.pn,a)}})},3465:(e,t,n)=>{"use strict";n.d(t,{y:()=>u});var r=n(6197),o=n(693),s=n(7315),i=n(4686),a=n(3347);function u(e,t,n=1,u="float32"){if(0===n)throw new Error("Cannot have a step of zero");const c={start:e,stop:t,step:n,dtype:u};return r.T2.runKernelFunc((()=>{if(e===t||e<t&&n<0||t<e&&n>1)return(0,a.U)([0],u);const r=Math.abs(Math.ceil((t-e)/n)),o=(0,s.Ty)(r,u);t<e&&1===n&&(n=-1),o[0]=e;for(let e=1;e<o.length;e++)o[e]=o[e-1]+n;return(0,i.t)(o,u)}),{},null,o.Q6,c)}},3474:e=>{"use strict";function t(){this._listeners={}}e.exports=t,t.prototype.on=function(e,t,n){return(this._listeners[e]||(this._listeners[e]=[])).push({fn:t,ctx:n||this}),this},t.prototype.off=function(e,t){if(void 0===e)this._listeners={};else if(void 0===t)this._listeners[e]=[];else for(var n=this._listeners[e],r=0;r<n.length;)n[r].fn===t?n.splice(r,1):++r;return this},t.prototype.emit=function(e){var t=this._listeners[e];if(t){for(var n=[],r=1;r<arguments.length;)n.push(arguments[r++]);for(r=0;r<t.length;)t[r].fn.apply(t[r++].ctx,n)}return this}},3512:(e,t,n)=>{"use strict";n.d(t,{r:()=>a});var r=n(6777),o=n(7315),s=n(3397),i=n(586);const a=(0,s.op)({squeeze_:function(e,t){const n=(0,r.YT)(e,"x","squeeze");return(0,i.t)(n,(0,o.gx)(n.shape,t).newShape)}})},3547:(e,t,n)=>{"use strict";n.d(t,{c:()=>h});var r=n(6197),o=n(693),s=n(6777),i=n(7315),a=n(5298),u=n(3709),c=n(3397),l=n(586),p=n(5347);const h=(0,c.op)({sum_:function(e,t=null,n=!1){let c=(0,s.YT)(e,"x","sum");"bool"===c.dtype&&(c=(0,u.w)(c,"int32"));const h={x:c},f={axis:t,keepDims:n};return r.T2.runKernelFunc(((e,r)=>{r([c]);const o=(0,i.Y6)(t,c.shape),s=(0,a.Em)(o,c.rank);let u=o,h=c;null!=s&&(h=(0,p.m)(c,s),u=(0,a.fK)(u.length,c.rank));let f=e.sum(h,u);if(n){const e=(0,a.SM)(f.shape,o);f=(0,l.t)(f,e)}return f}),h,null,o.Wu,f)}})},3709:(e,t,n)=>{"use strict";n.d(t,{w:()=>a});var r=n(6197),o=n(693),s=n(6777),i=n(7315);const a=(0,n(3397).op)({cast_:function(e,t){const n=(0,s.YT)(e,"x","cast");if(!i.xn(t))throw new Error(`Failed to cast to unknown dtype ${t}`);if("string"===t&&"string"!==n.dtype||"string"!==t&&"string"===n.dtype)throw new Error("Only strings can be casted to strings");const a={x:n},u={dtype:t};return r.T2.runKernelFunc((e=>e.cast(n,t)),a,null,o.KX,u)}})},3918:(e,t,n)=>{"use strict";n.r(t),n.d(t,{now:()=>o,timing:()=>s});const r=global.process.hrtime(),o=()=>{const e=global.process.hrtime(r);return e[0]+e[1]/1e9},s={navigationStart:Date.now()}},3996:(e,t,n)=>{"use strict";n.d(t,{l:()=>c});var r=n(6197),o=n(693),s=n(6777),i=n(7315),a=n(3397),u=n(7419);const c=(0,a.op)({split_:function(e,t,n=0){const a=(0,s.YT)(e,"x","split"),c={x:a},l={numOrSizeSplits:t,axis:n};return r.T2.runKernelFunc(((e,r)=>{const o=(0,i.Y6)(n,a.shape)[0],s=(0,u.z)(a,t,o);return e.split(a,s,o)}),c,null,o.Bl,l)}})},4010:(e,t,n)=>{"use strict";e.exports=s;var r=n(1137);(s.prototype=Object.create(r.prototype)).constructor=s;var o=n(5382);function s(e){r.call(this,e)}s._configure=function(){o.Buffer&&(s.prototype._slice=o.Buffer.prototype.slice)},s.prototype.string=function(){var e=this.uint32();return this.buf.utf8Slice?this.buf.utf8Slice(this.pos,this.pos=Math.min(this.pos+e,this.len)):this.buf.toString("utf-8",this.pos,this.pos=Math.min(this.pos+e,this.len))},s._configure()},4070:(e,t,n)=>{"use strict";n.d(t,{T:()=>p});var r=n(6197),o=n(693),s=n(6777),i=n(7315),a=n(5298),u=n(3397),c=n(586),l=n(5347);const p=(0,u.op)({max_:function(e,t=null,n=!1){const u=(0,s.YT)(e,"x","max"),p={x:u},h={reductionIndices:t,keepDims:n};return r.T2.runKernelFunc(((e,r)=>{let o=i.Y6(t,u.shape);const s=a.Em(o,u.rank);let p=u;null!=s&&(p=(0,l.m)(u,s),o=a.fK(o.length,p.rank));const h=e.max(p,o);null!=s&&p.dispose();let f=h;if(n){const e=a.SM(f.shape,i.Y6(t,u.shape));f=(0,c.t)(f,e),h.dispose()}return r([u,f]),f}),p,null,o.VA,h)}})},4110:(e,t,n)=>{"use strict";e.exports=n(7134)},4226:e=>{"use strict";e.exports=function(e,t,n){var r=n||8192,o=r>>>1,s=null,i=r;return function(n){if(n<1||n>o)return e(n);i+n>r&&(s=e(r),i=0);var a=t.call(s,i,i+=n);return 7&i&&(i=1+(7|i)),a}}},4301:(e,t,n)=>{"use strict";e.exports=p;var r,o=n(5382),s=o.LongBits,i=o.base64,a=o.utf8;function u(e,t,n){this.fn=e,this.len=t,this.next=void 0,this.val=n}function c(){}function l(e){this.head=e.head,this.tail=e.tail,this.len=e.len,this.next=e.states}function p(){this.len=0,this.head=new u(c,0,0),this.tail=this.head,this.states=null}var h=function(){return o.Buffer?function(){return(p.create=function(){return new r})()}:function(){return new p}};function f(e,t,n){t[n]=255&e}function d(e,t){this.len=e,this.next=void 0,this.val=t}function m(e,t,n){for(;e.hi;)t[n++]=127&e.lo|128,e.lo=(e.lo>>>7|e.hi<<25)>>>0,e.hi>>>=7;for(;e.lo>127;)t[n++]=127&e.lo|128,e.lo=e.lo>>>7;t[n++]=e.lo}function g(e,t,n){t[n]=255&e,t[n+1]=e>>>8&255,t[n+2]=e>>>16&255,t[n+3]=e>>>24}p.create=h(),p.alloc=function(e){return new o.Array(e)},o.Array!==Array&&(p.alloc=o.pool(p.alloc,o.Array.prototype.subarray)),p.prototype._push=function(e,t,n){return this.tail=this.tail.next=new u(e,t,n),this.len+=t,this},d.prototype=Object.create(u.prototype),d.prototype.fn=function(e,t,n){for(;e>127;)t[n++]=127&e|128,e>>>=7;t[n]=e},p.prototype.uint32=function(e){return this.len+=(this.tail=this.tail.next=new d((e>>>=0)<128?1:e<16384?2:e<2097152?3:e<268435456?4:5,e)).len,this},p.prototype.int32=function(e){return e<0?this._push(m,10,s.fromNumber(e)):this.uint32(e)},p.prototype.sint32=function(e){return this.uint32((e<<1^e>>31)>>>0)},p.prototype.uint64=function(e){var t=s.from(e);return this._push(m,t.length(),t)},p.prototype.int64=p.prototype.uint64,p.prototype.sint64=function(e){var t=s.from(e).zzEncode();return this._push(m,t.length(),t)},p.prototype.bool=function(e){return this._push(f,1,e?1:0)},p.prototype.fixed32=function(e){return this._push(g,4,e>>>0)},p.prototype.sfixed32=p.prototype.fixed32,p.prototype.fixed64=function(e){var t=s.from(e);return this._push(g,4,t.lo)._push(g,4,t.hi)},p.prototype.sfixed64=p.prototype.fixed64,p.prototype.float=function(e){return this._push(o.float.writeFloatLE,4,e)},p.prototype.double=function(e){return this._push(o.float.writeDoubleLE,8,e)};var y=o.Array.prototype.set?function(e,t,n){t.set(e,n)}:function(e,t,n){for(var r=0;r<e.length;++r)t[n+r]=e[r]};p.prototype.bytes=function(e){var t=e.length>>>0;if(!t)return this._push(f,1,0);if(o.isString(e)){var n=p.alloc(t=i.length(e));i.decode(e,n,0),e=n}return this.uint32(t)._push(y,t,e)},p.prototype.string=function(e){var t=a.length(e);return t?this.uint32(t)._push(a.write,t,e):this._push(f,1,0)},p.prototype.fork=function(){return this.states=new l(this),this.head=this.tail=new u(c,0,0),this.len=0,this},p.prototype.reset=function(){return this.states?(this.head=this.states.head,this.tail=this.states.tail,this.len=this.states.len,this.states=this.states.next):(this.head=this.tail=new u(c,0,0),this.len=0),this},p.prototype.ldelim=function(){var e=this.head,t=this.tail,n=this.len;return this.reset().uint32(n),n&&(this.tail.next=e.next,this.tail=t,this.len+=n),this},p.prototype.finish=function(){for(var e=this.head.next,t=this.constructor.alloc(this.len),n=0;e;)e.fn(e.val,t,n),n+=e.len,e=e.next;return t},p._configure=function(e){r=e,p.create=h(),r._configure()}},4400:(e,t,n)=>{"use strict";function r(){return"undefined"!=typeof window&&null!=window.document||"undefined"!=typeof WorkerGlobalScope}n.d(t,{isBrowser:()=>r})},4447:(e,t,n)=>{"use strict";e.exports=o;var r=n(5382);function o(e,t,n){if("function"!=typeof e)throw TypeError("rpcImpl must be a function");r.EventEmitter.call(this),this.rpcImpl=e,this.requestDelimited=Boolean(t),this.responseDelimited=Boolean(n)}(o.prototype=Object.create(r.Eve