Math.cos(e))),SS={kernelName:Et,backendName:"cpu",kernelFunc:CS},NS=LE(Ct,(e=>Math.cosh(e))),IS={kernelName:Ct,backendName:"cpu",kernelFunc:NS},DS={kernelName:Nt,backendName:"cpu",kernelFunc:function(e){const{inputs:t,backend:n,attrs:r}=e,{image:a,boxes:s,boxInd:i}=t,{cropSize:o,method:l,extrapolationValue:u}=r,[c,h,f,d]=a.shape,p=s.shape[0],[m,g]=o,y=Ls([p,m,g,d],"float32"),b=n.data.get(s.dataId).values,v=n.data.get(i.dataId).values,w=n.data.get(a.dataId).values,_=Ie(a.shape),x=Ie(y.shape);for(let e=0;e=c)continue;const o=m>1?(a-n)*(h-1)/(m-1):0,p=g>1?(s-r)*(f-1)/(g-1):0;for(let t=0;t1?n*(h-1)+t*o:.5*(n+a)*(h-1);if(c<0||c>h-1)for(let n=0;n1?r*(f-1)+l*p:.5*(r+s)*(f-1);if(c<0||c>f-1){for(let n=0;n1?r*(f-1)+n*p:.5*(r+s)*(f-1);if(a<0||a>f-1){for(let r=0;re+p-t-1:(e,t)=>e+t;for(let e=0;e`Only NHWC dataFormat supported on CPU for depthToSpace. Got ${i}`)),Z(s>1,(()=>`blockSize should be > 1 for depthToSpace, but was: ${s}`));const o=a.shape[0],l=a.shape[1],u=a.shape[2],c=a.shape[3],h=l*s,f=u*s,d=c/(s*s),p=n.data.get(a.dataId).values,m=new Float32Array(o*h*f*d);let g=0;for(let e=0;e`Error in depthwiseConv2d: Either strides or dilations must be 1. Got strides ${i} and dilations '${f}'`));const d=ul(a.shape,s.shape,i,f,o,u,!0),{filterHeight:p,filterWidth:m,dilationHeight:g,dilationWidth:y,padInfo:b}=d,v=b.left,w=b.top,_=d.outChannels/d.inChannels,x=new ha(d.outShape,a.dtype),k=n.data.get(a.dataId).values,E=n.data.get(s.dataId).values,C=x.values;for(let e=0;e=d.inHeight)continue;const s=e*h[0],i=t+n*c[1];for(let e=0;e=d.inWidth)continue;const a=s+e*h[1],o=i+r*d.inChannels;let l=t,u=a;for(let e=0;e{const{x:r,filter:a}=e,{strides:s,pad:i,dilations:o}=n,l=t,u=l.data.get(r.dataId).values,c=r.shape.length,h=l.data.get(a.dataId).values,f=a.shape.length,{batchSize:d,inHeight:p,inWidth:m,inChannels:g,outHeight:y,outWidth:b,padInfo:v,strideHeight:w,strideWidth:_,filterHeight:x,filterWidth:k,dilationHeight:E,dilationWidth:C,outShape:S}=il(r.shape,a.shape,s,i,"NHWC",o),N=ne(S),I=S.length,D=me(r.dtype,N);for(let e=0;e=0&&s=0&&dl&&(l=m)}}}D[Be([e,t,s,o],I,Ie(S))]=l}}}return{dataId:l.write(ia(D,r.dtype),S,r.dtype),shape:S,dtype:r.dtype}}},LS={kernelName:Mt,backendName:"cpu",kernelFunc:({inputs:e,backend:t,attrs:n})=>{const{x:r,filter:a,dy:s}=e,{strides:i,pad:o,dilations:l}=n,u=t,c=Ae(r.shape,u.data.get(r.dataId).values),h=Ae(a.shape,u.data.get(a.dataId).values),{batchSize:f,inHeight:d,inWidth:p,inChannels:m,outHeight:g,outWidth:y,padInfo:b,strideHeight:v,strideWidth:w,filterHeight:_,filterWidth:x,dilationHeight:k,dilationWidth:E,outShape:C}=il(r.shape,a.shape,i,o,"NHWC",l);Z(s.rank===C.length,(()=>`Error in ${Mt}, dy must have the same rank as output ${C.length}, but got ${s.rank}`));const S=Ae(C,u.data.get(s.dataId).values),N=Fe(a.shape,a.dtype);for(let e=0;e=0&&r=0&&ui&&(i=a,o=t,l=n)}}}N[o][l][s]+=S[e][t][r][s]}}}return{dataId:u.write(ia(N,r.dtype),a.shape,a.dtype),shape:a.shape,dtype:a.dtype}}},zS={kernelName:Bt,backendName:"cpu",kernelFunc:({inputs:e,backend:t,attrs:n})=>{const{x:r,filter:a,dy:s}=e,{strides:i,pad:o,dilations:l}=n,u=t,c=Ae(r.shape,u.data.get(r.dataId).values),h=Ae(a.shape,u.data.get(a.dataId).values),{batchSize:f,inHeight:d,inWidth:p,inChannels:m,outHeight:g,outWidth:y,padInfo:b,strideHeight:v,strideWidth:w,filterHeight:_,filterWidth:x,dilationHeight:k,dilationWidth:E,outShape:C}=il(r.shape,a.shape,i,o,"NHWC",l);Z(s.rank===C.length,(()=>`Error in ${Bt}, dy must have the same rank as output ${C.length}, but got ${s.rank}`));const S=Ae(C,u.data.get(s.dataId).values),N=Fe(r.shape,r.dtype);for(let e=0;e=0&&r=0&&u