=128&&O("not-basic"),P.push(e.charCodeAt(r));for(n=a>0?a+1:0;n=b&&O("invalid-input"),((d=(N=e.charCodeAt(n++))-48<10?N-22:N-65<26?N-65:N-97<26?N-97:u)>=u||d>v((p-x)/s))&&O("overflow"),x+=d*s,!(d<(f=i<=w?l:i>=w+m?m:i-w));i+=u)s>v(p/(g=u-f))&&O("overflow"),s*=g;w=A(x-o,t=P.length+1,0==o),v(x/t)>p-I&&O("overflow"),I+=v(x/t),x%=t,P.splice(x++,0,I)}return k(P)}function S(e){var t,a,r,n,o,s,i,d,f,g,N,P,b,x,w,V=[];for(P=(e=T(e)).length,t=h,a=0,o=c,s=0;s=t&&Nv((p-a)/(b=r+1))&&O("overflow"),a+=(i-t)*b,t=i,s=0;s
p&&O("overflow"),N==t){for(d=a,f=u;!(d<(g=f<=o?l:f>=o+m?m:f-o));f+=u)w=d-g,x=u-g,V.push(I(_(g+w%x,0))),d=v(w/x);V.push(I(_(d,0))),o=A(a,b,r==n),a=0,++r}++a,++t}return V.join("")}if(s={version:"1.3.2",ucs2:{decode:T,encode:k},decode:$,encode:S,toASCII:function(e){return V(e,function(e){return N.test(e)?"xn--"+S(e):e})},toUnicode:function(e){return V(e,function(e){return g.test(e)?$(e.slice(4).toLowerCase()):e})}},r&&n)if(e.exports==r)n.exports=s;else for(i in s)s.hasOwnProperty(i)&&(r[i]=s[i]);else a.punycode=s}(commonjsGlobal)}),util={isString:function(e){return"string"==typeof e},isObject:function(e){return"object"==typeof e&&null!==e},isNull:function(e){return null===e},isNullOrUndefined:function(e){return null==e}};function hasOwnProperty(e,t){return Object.prototype.hasOwnProperty.call(e,t)}var decode=function(e,t,a,r){t=t||"&",a=a||"=";var n={};if("string"!=typeof e||0===e.length)return n;var o=/\+/g;e=e.split(t);var s=1e3;r&&"number"==typeof r.maxKeys&&(s=r.maxKeys);var i=e.length;s>0&&i>s&&(i=s);for(var p=0;p=0?(u=f.substr(0,c),l=f.substr(c+1)):(u=f,l=""),m=decodeURIComponent(u),d=decodeURIComponent(l),hasOwnProperty(n,m)?Array.isArray(n[m])?n[m].push(d):n[m]=[n[m],d]:n[m]=d}return n},stringifyPrimitive=function(e){switch(typeof e){case"string":return e;case"boolean":return e?"true":"false";case"number":return isFinite(e)?e:"";default:return""}},encode=function(e,t,a,r){return t=t||"&",a=a||"=",null===e&&(e=void 0),"object"==typeof e?Object.keys(e).map(function(r){var n=encodeURIComponent(stringifyPrimitive(r))+a;return Array.isArray(e[r])?e[r].map(function(e){return n+encodeURIComponent(stringifyPrimitive(e))}).join(t):n+encodeURIComponent(stringifyPrimitive(e[r]))}).join(t):r?encodeURIComponent(stringifyPrimitive(r))+a+encodeURIComponent(stringifyPrimitive(e)):""},querystring=createCommonjsModule(function(e,t){t.decode=t.parse=decode,t.encode=t.stringify=encode}),querystring_1=querystring.decode,querystring_2=querystring.parse,querystring_3=querystring.encode,querystring_4=querystring.stringify,parse=urlParse,format=urlFormat;function Url(){this.protocol=null,this.slashes=null,this.auth=null,this.host=null,this.port=null,this.hostname=null,this.hash=null,this.search=null,this.query=null,this.pathname=null,this.path=null,this.href=null}var protocolPattern=/^([a-z0-9.+-]+:)/i,portPattern=/:[0-9]*$/,simplePathPattern=/^(\/\/?(?!\/)[^\?\s]*)(\?[^\s]*)?$/,delims=["<",">",'"',"`"," ","\r","\n","\t"],unwise=["{","}","|","\\","^","`"].concat(delims),autoEscape=["'"].concat(unwise),nonHostChars=["%","/","?",";","#"].concat(autoEscape),hostEndingChars=["/","?","#"],hostnameMaxLen=255,hostnamePartPattern=/^[+a-z0-9A-Z_-]{0,63}$/,hostnamePartStart=/^([+a-z0-9A-Z_-]{0,63})(.*)$/,unsafeProtocol={javascript:!0,"javascript:":!0},hostlessProtocol={javascript:!0,"javascript:":!0},slashedProtocol={http:!0,https:!0,ftp:!0,gopher:!0,file:!0,"http:":!0,"https:":!0,"ftp:":!0,"gopher:":!0,"file:":!0};function urlParse(e,t,a){if(e&&util.isObject(e)&&e instanceof Url)return e;var r=new Url;return r.parse(e,t,a),r}function urlFormat(e){return util.isString(e)&&(e=urlParse(e)),e instanceof Url?e.format():Url.prototype.format.call(e)}Url.prototype.parse=function(e,t,a){if(!util.isString(e))throw new TypeError("Parameter 'url' must be a string, not "+typeof e);var r=e.indexOf("?"),n=-1!==r&&r127?b+="x":b+=P[x];if(!b.match(hostnamePartPattern)){var I=g.slice(0,c),O=g.slice(c+1),w=P.match(hostnamePartStart);w&&(I.push(w[1]),O.unshift(w[2])),O.length&&(s="/"+O.join(".")+s),this.hostname=I.join(".");break}}}this.hostname.length>hostnameMaxLen?this.hostname="":this.hostname=this.hostname.toLowerCase(),y||(this.hostname=punycode.toASCII(this.hostname));var V=this.port?":"+this.port:"",T=this.hostname||"";this.host=T+V,this.href+=this.host,y&&(this.hostname=this.hostname.substr(1,this.hostname.length-2),"/"!==s[0]&&(s="/"+s))}if(!unsafeProtocol[u])for(c=0,N=autoEscape.length;c0)&&a.host.split("@"))&&(a.auth=w.shift(),a.host=a.hostname=w.shift());return a.search=e.search,a.query=e.query,util.isNull(a.pathname)&&util.isNull(a.search)||(a.path=(a.pathname?a.pathname:"")+(a.search?a.search:"")),a.href=a.format(),a}if(!P.length)return a.pathname=null,a.search?a.path="/"+a.search:a.path=null,a.href=a.format(),a;for(var x=P.slice(-1)[0],v=(a.host||e.host||P.length>1)&&("."===x||".."===x)||""===x,I=0,O=P.length;O>=0;O--)"."===(x=P[O])?P.splice(O,1):".."===x?(P.splice(O,1),I++):I&&(P.splice(O,1),I--);if(!g&&!N)for(;I--;I)P.unshift("..");!g||""===P[0]||P[0]&&"/"===P[0].charAt(0)||P.unshift(""),v&&"/"!==P.join("/").substr(-1)&&P.push("");var w,V=""===P[0]||P[0]&&"/"===P[0].charAt(0);b&&(a.hostname=a.host=V?"":P.length?P.shift():"",(w=!!(a.host&&a.host.indexOf("@")>0)&&a.host.split("@"))&&(a.auth=w.shift(),a.host=a.hostname=w.shift()));return(g=g||a.host&&P.length)&&!V&&P.unshift(""),P.length?a.pathname=P.join("/"):(a.pathname=null,a.path=null),util.isNull(a.pathname)&&util.isNull(a.search)||(a.path=(a.pathname?a.pathname:"")+(a.search?a.search:"")),a.auth=e.auth||a.auth,a.slashes=a.slashes||e.slashes,a.href=a.format(),a},Url.prototype.parseHost=function(){var e=this.host,t=portPattern.exec(e);t&&(":"!==(t=t[0])&&(this.port=t.substr(1)),e=e.substr(0,e.length-t.length)),e&&(this.hostname=e)};var aspromise=asPromise;function asPromise(e,t){for(var a=new Array(arguments.length-1),r=0,n=2,o=!0;n1&&"="===e.charAt(t);)++a;return Math.ceil(3*e.length)/4-a};for(var r=new Array(64),n=new Array(123),o=0;o<64;)n[r[o]=o<26?o+65:o<52?o+71:o<62?o-4:o-59|43]=o++;a.encode=function(e,t,a){for(var n,o=null,s=[],i=0,p=0;t>2],n=(3&u)<<4,p=1;break;case 1:s[i++]=r[n|u>>4],n=(15&u)<<2,p=2;break;case 2:s[i++]=r[n|u>>6],s[i++]=r[63&u],p=0}i>8191&&((o||(o=[])).push(String.fromCharCode.apply(String,s)),i=0)}return p&&(s[i++]=r[n],s[i++]=61,1===p&&(s[i++]=61)),o?(i&&o.push(String.fromCharCode.apply(String,s.slice(0,i))),o.join("")):String.fromCharCode.apply(String,s.slice(0,i))};a.decode=function(e,t,a){for(var r,o=a,s=0,i=0;i1)break;if(void 0===(p=n[p]))throw Error("invalid encoding");switch(s){case 0:r=p,s=1;break;case 1:t[a++]=r<<2|(48&p)>>4,r=p,s=2;break;case 2:t[a++]=(15&r)<<4|(60&p)>>2,r=p,s=3;break;case 3:t[a++]=(3&r)<<6|p,s=0}}if(1===s)throw Error("invalid encoding");return a-o},a.test=function(e){return/^(?:[A-Za-z0-9+/]{4})*(?:[A-Za-z0-9+/]{2}==|[A-Za-z0-9+/]{3}=)?$/.test(e)}}),eventemitter=EventEmitter;function EventEmitter(){this._listeners={}}EventEmitter.prototype.on=function(e,t,a){return(this._listeners[e]||(this._listeners[e]=[])).push({fn:t,ctx:a||this}),this},EventEmitter.prototype.off=function(e,t){if(void 0===e)this._listeners={};else if(void 0===t)this._listeners[e]=[];else for(var a=this._listeners[e],r=0;r0?0:2147483648,a,r);else if(isNaN(t))e(2143289344,a,r);else if(t>3.4028234663852886e38)e((n<<31|2139095040)>>>0,a,r);else if(t<1.1754943508222875e-38)e((n<<31|Math.round(t/1.401298464324817e-45))>>>0,a,r);else{var o=Math.floor(Math.log(t)/Math.LN2);e((n<<31|o+127<<23|8388607&Math.round(t*Math.pow(2,-o)*8388608))>>>0,a,r)}}function a(e,t,a){var r=e(t,a),n=2*(r>>31)+1,o=r>>>23&255,s=8388607&r;return 255===o?s?NaN:n*(1/0):0===o?1.401298464324817e-45*n*s:n*Math.pow(2,o-150)*(s+8388608)}e.writeFloatLE=t.bind(null,writeUintLE),e.writeFloatBE=t.bind(null,writeUintBE),e.readFloatLE=a.bind(null,readUintLE),e.readFloatBE=a.bind(null,readUintBE)}(),"undefined"!=typeof Float64Array?function(){var t=new Float64Array([-0]),a=new Uint8Array(t.buffer),r=128===a[7];function n(e,r,n){t[0]=e,r[n]=a[0],r[n+1]=a[1],r[n+2]=a[2],r[n+3]=a[3],r[n+4]=a[4],r[n+5]=a[5],r[n+6]=a[6],r[n+7]=a[7]}function o(e,r,n){t[0]=e,r[n]=a[7],r[n+1]=a[6],r[n+2]=a[5],r[n+3]=a[4],r[n+4]=a[3],r[n+5]=a[2],r[n+6]=a[1],r[n+7]=a[0]}function s(e,r){return a[0]=e[r],a[1]=e[r+1],a[2]=e[r+2],a[3]=e[r+3],a[4]=e[r+4],a[5]=e[r+5],a[6]=e[r+6],a[7]=e[r+7],t[0]}function i(e,r){return a[7]=e[r],a[6]=e[r+1],a[5]=e[r+2],a[4]=e[r+3],a[3]=e[r+4],a[2]=e[r+5],a[1]=e[r+6],a[0]=e[r+7],t[0]}e.writeDoubleLE=r?n:o,e.writeDoubleBE=r?o:n,e.readDoubleLE=r?s:i,e.readDoubleBE=r?i:s}():function(){function t(e,t,a,r,n,o){var s=r<0?1:0;if(s&&(r=-r),0===r)e(0,n,o+t),e(1/r>0?0:2147483648,n,o+a);else if(isNaN(r))e(0,n,o+t),e(2146959360,n,o+a);else if(r>1.7976931348623157e308)e(0,n,o+t),e((s<<31|2146435072)>>>0,n,o+a);else{var i;if(r<2.2250738585072014e-308)e((i=r/5e-324)>>>0,n,o+t),e((s<<31|i/4294967296)>>>0,n,o+a);else{var p=Math.floor(Math.log(r)/Math.LN2);1024===p&&(p=1023),e(4503599627370496*(i=r*Math.pow(2,-p))>>>0,n,o+t),e((s<<31|p+1023<<20|1048576*i&1048575)>>>0,n,o+a)}}}function a(e,t,a,r,n){var o=e(r,n+t),s=e(r,n+a),i=2*(s>>31)+1,p=s>>>20&2047,u=4294967296*(1048575&s)+o;return 2047===p?u?NaN:i*(1/0):0===p?5e-324*i*u:i*Math.pow(2,p-1075)*(u+4503599627370496)}e.writeDoubleLE=t.bind(null,writeUintLE,0,4),e.writeDoubleBE=t.bind(null,writeUintBE,4,0),e.readDoubleLE=a.bind(null,readUintLE,0,4),e.readDoubleBE=a.bind(null,readUintBE,4,0)}(),e}function writeUintLE(e,t,a){t[a]=255&e,t[a+1]=e>>>8&255,t[a+2]=e>>>16&255,t[a+3]=e>>>24}function writeUintBE(e,t,a){t[a]=e>>>24,t[a+1]=e>>>16&255,t[a+2]=e>>>8&255,t[a+3]=255&e}function readUintLE(e,t){return(e[t]|e[t+1]<<8|e[t+2]<<16|e[t+3]<<24)>>>0}function readUintBE(e,t){return(e[t]<<24|e[t+1]<<16|e[t+2]<<8|e[t+3])>>>0}var inquire_1=inquire;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}var utf8_1=createCommonjsModule(function(e,t){var a=t;a.length=function(e){for(var t=0,a=0,r=0;r191&&r<224?o[s++]=(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,o[s++]=55296+(r>>10),o[s++]=56320+(1023&r)):o[s++]=(15&r)<<12|(63&e[t++])<<6|63&e[t++],s>8191&&((n||(n=[])).push(String.fromCharCode.apply(String,o)),s=0);return n?(s&&n.push(String.fromCharCode.apply(String,o.slice(0,s))),n.join("")):String.fromCharCode.apply(String,o.slice(0,s))},a.write=function(e,t,a){for(var r,n,o=a,s=0;s>6|192,t[a++]=63&r|128):55296==(64512&r)&&56320==(64512&(n=e.charCodeAt(s+1)))?(r=65536+((1023&r)<<10)+(1023&n),++s,t[a++]=r>>18|240,t[a++]=r>>12&63|128,t[a++]=r>>6&63|128,t[a++]=63&r|128):(t[a++]=r>>12|224,t[a++]=r>>6&63|128,t[a++]=63&r|128);return a-o}}),pool_1=pool;function pool(e,t,a){var r=a||8192,n=r>>>1,o=null,s=r;return function(a){if(a<1||a>n)return e(a);s+a>r&&(o=e(r),s=0);var i=t.call(o,s,s+=a);return 7&s&&(s=1+(7|s)),i}}var longbits=LongBits;function LongBits(e,t){this.lo=e>>>0,this.hi=t>>>0}var zero=LongBits.zero=new LongBits(0,0);zero.toNumber=function(){return 0},zero.zzEncode=zero.zzDecode=function(){return this},zero.length=function(){return 1};var zeroHash=LongBits.zeroHash="\0\0\0\0\0\0\0\0";LongBits.fromNumber=function(e){if(0===e)return zero;var t=e<0;t&&(e=-e);var a=e>>>0,r=(e-a)/4294967296>>>0;return t&&(r=~r>>>0,a=~a>>>0,++a>4294967295&&(a=0,++r>4294967295&&(r=0))),new LongBits(a,r)},LongBits.from=function(e){if("number"==typeof e)return LongBits.fromNumber(e);if(minimal.isString(e)){if(!minimal.Long)return LongBits.fromNumber(parseInt(e,10));e=minimal.Long.fromString(e)}return e.low||e.high?new LongBits(e.low>>>0,e.high>>>0):zero},LongBits.prototype.toNumber=function(e){if(!e&&this.hi>>>31){var t=1+~this.lo>>>0,a=~this.hi>>>0;return t||(a=a+1>>>0),-(t+4294967296*a)}return this.lo+4294967296*this.hi},LongBits.prototype.toLong=function(e){return minimal.Long?new minimal.Long(0|this.lo,0|this.hi,Boolean(e)):{low:0|this.lo,high:0|this.hi,unsigned:Boolean(e)}};var charCodeAt=String.prototype.charCodeAt;LongBits.fromHash=function(e){return e===zeroHash?zero:new LongBits((charCodeAt.call(e,0)|charCodeAt.call(e,1)<<8|charCodeAt.call(e,2)<<16|charCodeAt.call(e,3)<<24)>>>0,(charCodeAt.call(e,4)|charCodeAt.call(e,5)<<8|charCodeAt.call(e,6)<<16|charCodeAt.call(e,7)<<24)>>>0)},LongBits.prototype.toHash=function(){return String.fromCharCode(255&this.lo,this.lo>>>8&255,this.lo>>>16&255,this.lo>>>24,255&this.hi,this.hi>>>8&255,this.hi>>>16&255,this.hi>>>24)},LongBits.prototype.zzEncode=function(){var e=this.hi>>31;return this.hi=((this.hi<<1|this.lo>>>31)^e)>>>0,this.lo=(this.lo<<1^e)>>>0,this},LongBits.prototype.zzDecode=function(){var e=-(1&this.lo);return this.lo=((this.lo>>>1|this.hi<<31)^e)>>>0,this.hi=(this.hi>>>1^e)>>>0,this},LongBits.prototype.length=function(){var e=this.lo,t=(this.lo>>>28|this.hi<<4)>>>0,a=this.hi>>>24;return 0===a?0===t?e<16384?e<128?1:2:e<2097152?3:4:t<16384?t<128?5:6:t<2097152?7:8:a<128?9:10};var minimal=createCommonjsModule(function(e,t){var a=t;function r(e,t,a){for(var r=Object.keys(t),n=0;n0)},a.Buffer=function(){try{var e=a.inquire("buffer").Buffer;return e.prototype.utf8Write?e:null}catch(e){return null}}(),a._Buffer_from=null,a._Buffer_allocUnsafe=null,a.newBuffer=function(e){return"number"==typeof e?a.Buffer?a._Buffer_allocUnsafe(e):new a.Array(e):a.Buffer?a._Buffer_from(e):"undefined"==typeof Uint8Array?e:new Uint8Array(e)},a.Array="undefined"!=typeof Uint8Array?Uint8Array:Array,a.Long=commonjsGlobal.dcodeIO&&commonjsGlobal.dcodeIO.Long||a.inquire("long"),a.key2Re=/^true|false|0|1$/,a.key32Re=/^-?(?:0|[1-9][0-9]*)$/,a.key64Re=/^(?:[\\x00-\\xff]{8}|-?(?:0|[1-9][0-9]*))$/,a.longToHash=function(e){return e?a.LongBits.from(e).toHash():a.LongBits.zeroHash},a.longFromHash=function(e,t){var r=a.LongBits.fromHash(e);return a.Long?a.Long.fromBits(r.lo,r.hi,t):r.toNumber(Boolean(t))},a.merge=r,a.lcFirst=function(e){return e.charAt(0).toLowerCase()+e.substring(1)},a.newError=n,a.ProtocolError=n("ProtocolError"),a.oneOfGetter=function(e){for(var t={},a=0;a-1;--a)if(1===t[e[a]]&&void 0!==this[e[a]]&&null!==this[e[a]])return e[a]}},a.oneOfSetter=function(e){return function(t){for(var a=0;a127;)t[a++]=127&e|128,e>>>=7;t[a]=e}function VarintOp(e,t){this.len=e,this.next=void 0,this.val=t}function writeVarint64(e,t,a){for(;e.hi;)t[a++]=127&e.lo|128,e.lo=(e.lo>>>7|e.hi<<25)>>>0,e.hi>>>=7;for(;e.lo>127;)t[a++]=127&e.lo|128,e.lo=e.lo>>>7;t[a++]=e.lo}function writeFixed32(e,t,a){t[a]=255&e,t[a+1]=e>>>8&255,t[a+2]=e>>>16&255,t[a+3]=e>>>24}Writer.create=minimal.Buffer?function(){return(Writer.create=function(){return new BufferWriter})()}:function(){return new Writer},Writer.alloc=function(e){return new minimal.Array(e)},minimal.Array!==Array&&(Writer.alloc=minimal.pool(Writer.alloc,minimal.Array.prototype.subarray)),Writer.prototype._push=function(e,t,a){return this.tail=this.tail.next=new Op(e,t,a),this.len+=t,this},VarintOp.prototype=Object.create(Op.prototype),VarintOp.prototype.fn=writeVarint32,Writer.prototype.uint32=function(e){return this.len+=(this.tail=this.tail.next=new VarintOp((e>>>=0)<128?1:e<16384?2:e<2097152?3:e<268435456?4:5,e)).len,this},Writer.prototype.int32=function(e){return e<0?this._push(writeVarint64,10,LongBits$1.fromNumber(e)):this.uint32(e)},Writer.prototype.sint32=function(e){return this.uint32((e<<1^e>>31)>>>0)},Writer.prototype.uint64=function(e){var t=LongBits$1.from(e);return this._push(writeVarint64,t.length(),t)},Writer.prototype.int64=Writer.prototype.uint64,Writer.prototype.sint64=function(e){var t=LongBits$1.from(e).zzEncode();return this._push(writeVarint64,t.length(),t)},Writer.prototype.bool=function(e){return this._push(writeByte,1,e?1:0)},Writer.prototype.fixed32=function(e){return this._push(writeFixed32,4,e>>>0)},Writer.prototype.sfixed32=Writer.prototype.fixed32,Writer.prototype.fixed64=function(e){var t=LongBits$1.from(e);return this._push(writeFixed32,4,t.lo)._push(writeFixed32,4,t.hi)},Writer.prototype.sfixed64=Writer.prototype.fixed64,Writer.prototype.float=function(e){return this._push(minimal.float.writeFloatLE,4,e)},Writer.prototype.double=function(e){return this._push(minimal.float.writeDoubleLE,8,e)};var writeBytes=minimal.Array.prototype.set?function(e,t,a){t.set(e,a)}:function(e,t,a){for(var r=0;r>>0;if(!t)return this._push(writeByte,1,0);if(minimal.isString(e)){var a=Writer.alloc(t=base64.length(e));base64.decode(e,a,0),e=a}return this.uint32(t)._push(writeBytes,t,e)},Writer.prototype.string=function(e){var t=utf8.length(e);return t?this.uint32(t)._push(utf8.write,t,e):this._push(writeByte,1,0)},Writer.prototype.fork=function(){return this.states=new State(this),this.head=this.tail=new Op(noop,0,0),this.len=0,this},Writer.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 Op(noop,0,0),this.len=0),this},Writer.prototype.ldelim=function(){var e=this.head,t=this.tail,a=this.len;return this.reset().uint32(a),a&&(this.tail.next=e.next,this.tail=t,this.len+=a),this},Writer.prototype.finish=function(){for(var e=this.head.next,t=this.constructor.alloc(this.len),a=0;e;)e.fn(e.val,t,a),a+=e.len,e=e.next;return t},Writer._configure=function(e){BufferWriter=e};var writer_buffer=BufferWriter$1;(BufferWriter$1.prototype=Object.create(writer.prototype)).constructor=BufferWriter$1;var Buffer=minimal.Buffer;function BufferWriter$1(){writer.call(this)}BufferWriter$1.alloc=function(e){return(BufferWriter$1.alloc=minimal._Buffer_allocUnsafe)(e)};var writeBytesBuffer=Buffer&&Buffer.prototype instanceof Uint8Array&&"set"===Buffer.prototype.set.name?function(e,t,a){t.set(e,a)}:function(e,t,a){if(e.copy)e.copy(t,a,0,e.length);else for(var r=0;r>>0;return this.uint32(t),t&&this._push(writeBytesBuffer,t,e),this},BufferWriter$1.prototype.string=function(e){var t=Buffer.byteLength(e);return this.uint32(t),t&&this._push(writeStringBuffer,t,e),this};var reader=Reader,BufferReader,LongBits$2=minimal.LongBits,utf8$1=minimal.utf8;function indexOutOfRange(e,t){return RangeError("index out of range: "+e.pos+" + "+(t||1)+" > "+e.len)}function Reader(e){this.buf=e,this.pos=0,this.len=e.length}var create_array="undefined"!=typeof Uint8Array?function(e){if(e instanceof Uint8Array||Array.isArray(e))return new Reader(e);throw Error("illegal buffer")}:function(e){if(Array.isArray(e))return new Reader(e);throw Error("illegal buffer")},value;function readLongVarint(){var e=new LongBits$2(0,0),t=0;if(!(this.len-this.pos>4)){for(;t<3;++t){if(this.pos>=this.len)throw indexOutOfRange(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 indexOutOfRange(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 readFixed32_end(e,t){return(e[t-4]|e[t-3]<<8|e[t-2]<<16|e[t-1]<<24)>>>0}function readFixed64(){if(this.pos+8>this.len)throw indexOutOfRange(this,8);return new LongBits$2(readFixed32_end(this.buf,this.pos+=4),readFixed32_end(this.buf,this.pos+=4))}Reader.create=minimal.Buffer?function(e){return(Reader.create=function(e){return minimal.Buffer.isBuffer(e)?new BufferReader(e):create_array(e)})(e)}:create_array,Reader.prototype._slice=minimal.Array.prototype.subarray||minimal.Array.prototype.slice,Reader.prototype.uint32=(value=4294967295,function(){if(value=(127&this.buf[this.pos])>>>0,this.buf[this.pos++]<128)return value;if(value=(value|(127&this.buf[this.pos])<<7)>>>0,this.buf[this.pos++]<128)return value;if(value=(value|(127&this.buf[this.pos])<<14)>>>0,this.buf[this.pos++]<128)return value;if(value=(value|(127&this.buf[this.pos])<<21)>>>0,this.buf[this.pos++]<128)return value;if(value=(value|(15&this.buf[this.pos])<<28)>>>0,this.buf[this.pos++]<128)return value;if((this.pos+=5)>this.len)throw this.pos=this.len,indexOutOfRange(this,10);return value}),Reader.prototype.int32=function(){return 0|this.uint32()},Reader.prototype.sint32=function(){var e=this.uint32();return e>>>1^-(1&e)|0},Reader.prototype.bool=function(){return 0!==this.uint32()},Reader.prototype.fixed32=function(){if(this.pos+4>this.len)throw indexOutOfRange(this,4);return readFixed32_end(this.buf,this.pos+=4)},Reader.prototype.sfixed32=function(){if(this.pos+4>this.len)throw indexOutOfRange(this,4);return 0|readFixed32_end(this.buf,this.pos+=4)},Reader.prototype.float=function(){if(this.pos+4>this.len)throw indexOutOfRange(this,4);var e=minimal.float.readFloatLE(this.buf,this.pos);return this.pos+=4,e},Reader.prototype.double=function(){if(this.pos+8>this.len)throw indexOutOfRange(this,4);var e=minimal.float.readDoubleLE(this.buf,this.pos);return this.pos+=8,e},Reader.prototype.bytes=function(){var e=this.uint32(),t=this.pos,a=this.pos+e;if(a>this.len)throw indexOutOfRange(this,e);return this.pos+=e,Array.isArray(this.buf)?this.buf.slice(t,a):t===a?new this.buf.constructor(0):this._slice.call(this.buf,t,a)},Reader.prototype.string=function(){var e=this.bytes();return utf8$1.read(e,0,e.length)},Reader.prototype.skip=function(e){if("number"==typeof e){if(this.pos+e>this.len)throw indexOutOfRange(this,e);this.pos+=e}else do{if(this.pos>=this.len)throw indexOutOfRange(this)}while(128&this.buf[this.pos++]);return this},Reader.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(;;){if(4==(e=7&this.uint32()))break;this.skipType(e)}break;case 5:this.skip(4);break;default:throw Error("invalid wire type "+e+" at offset "+this.pos)}return this},Reader._configure=function(e){BufferReader=e;var t=minimal.Long?"toLong":"toNumber";minimal.merge(Reader.prototype,{int64:function(){return readLongVarint.call(this)[t](!1)},uint64:function(){return readLongVarint.call(this)[t](!0)},sint64:function(){return readLongVarint.call(this).zzDecode()[t](!1)},fixed64:function(){return readFixed64.call(this)[t](!0)},sfixed64:function(){return readFixed64.call(this)[t](!1)}})};var reader_buffer=BufferReader$1;function BufferReader$1(e){reader.call(this,e)}(BufferReader$1.prototype=Object.create(reader.prototype)).constructor=BufferReader$1,minimal.Buffer&&(BufferReader$1.prototype._slice=minimal.Buffer.prototype.slice),BufferReader$1.prototype.string=function(){var e=this.uint32();return this.buf.utf8Slice(this.pos,this.pos=Math.min(this.pos+e,this.len))};var service=Service;function Service(e,t,a){if("function"!=typeof e)throw TypeError("rpcImpl must be a function");minimal.EventEmitter.call(this),this.rpcImpl=e,this.requestDelimited=Boolean(t),this.responseDelimited=Boolean(a)}(Service.prototype=Object.create(minimal.EventEmitter.prototype)).constructor=Service,Service.prototype.rpcCall=function e(t,a,r,n,o){if(!n)throw TypeError("request must be specified");var s=this;if(!o)return minimal.asPromise(e,s,t,a,r,n);if(s.rpcImpl)try{return s.rpcImpl(t,a[s.requestDelimited?"encodeDelimited":"encode"](n).finish(),function(e,a){if(e)return s.emit("error",e,t),o(e);if(null!==a){if(!(a instanceof r))try{a=r[s.responseDelimited?"decodeDelimited":"decode"](a)}catch(e){return s.emit("error",e,t),o(e)}return s.emit("data",a,t),o(null,a)}s.end(!0)})}catch(e){return s.emit("error",e,t),void setTimeout(function(){o(e)},0)}else setTimeout(function(){o(Error("already ended"))},0)},Service.prototype.end=function(e){return this.rpcImpl&&(e||this.rpcImpl(null,null,null),this.rpcImpl=null,this.emit("end").off()),this};var rpc_1=createCommonjsModule(function(e,t){t.Service=service}),roots={},indexMinimal=createCommonjsModule(function(e,t){var a=t;function r(){a.Reader._configure(a.BufferReader),a.util._configure()}a.build="minimal",a.Writer=writer,a.BufferWriter=writer_buffer,a.Reader=reader,a.BufferReader=reader_buffer,a.util=minimal,a.rpc=rpc_1,a.roots=roots,a.configure=r,a.Writer._configure(a.BufferWriter),r()}),minimal$1=indexMinimal,minimal_1=minimal$1.roots,minimal_2=minimal$1.Reader,minimal_3=minimal$1.util,$Reader=minimal$1.Reader,$util=minimal$1.util,$root=minimal$1.roots.default||(minimal$1.roots.default={}),valuesById,values,tensorflow;$root.tensorflow=(tensorflow={},tensorflow.Any=function(){function e(e){if(e)for(var t=Object.keys(e),a=0;a>>3){case 1:r.typeUrl=e.string();break;case 2:r.value=e.bytes();break;default:e.skipType(7&n)}}return r},e}(),tensorflow.DataType=(valuesById={},(values=Object.create(valuesById))[valuesById[0]="DT_INVALID"]=0,values[valuesById[1]="DT_FLOAT"]=1,values[valuesById[2]="DT_DOUBLE"]=2,values[valuesById[3]="DT_INT32"]=3,values[valuesById[4]="DT_UINT8"]=4,values[valuesById[5]="DT_INT16"]=5,values[valuesById[6]="DT_INT8"]=6,values[valuesById[7]="DT_STRING"]=7,values[valuesById[8]="DT_COMPLEX64"]=8,values[valuesById[9]="DT_INT64"]=9,values[valuesById[10]="DT_BOOL"]=10,values[valuesById[11]="DT_QINT8"]=11,values[valuesById[12]="DT_QUINT8"]=12,values[valuesById[13]="DT_QINT32"]=13,values[valuesById[14]="DT_BFLOAT16"]=14,values[valuesById[101]="DT_FLOAT_REF"]=101,values[valuesById[102]="DT_DOUBLE_REF"]=102,values[valuesById[103]="DT_INT32_REF"]=103,values[valuesById[104]="DT_UINT8_REF"]=104,values[valuesById[105]="DT_INT16_REF"]=105,values[valuesById[106]="DT_INT8_REF"]=106,values[valuesById[107]="DT_STRING_REF"]=107,values[valuesById[108]="DT_COMPLEX64_REF"]=108,values[valuesById[109]="DT_INT64_REF"]=109,values[valuesById[110]="DT_BOOL_REF"]=110,values[valuesById[111]="DT_QINT8_REF"]=111,values[valuesById[112]="DT_QUINT8_REF"]=112,values[valuesById[113]="DT_QINT32_REF"]=113,values[valuesById[114]="DT_BFLOAT16_REF"]=114,values),tensorflow.TensorShape=function(){function e(e){if(this.dim=[],e)for(var t=Object.keys(e),a=0;a>>3){case 2:r.dim&&r.dim.length||(r.dim=[]),r.dim.push($root.tensorflow.TensorShape.Dim.decode(e,e.uint32()));break;case 3:r.unknownRank=e.bool();break;default:e.skipType(7&n)}}return r},e.Dim=function(){function e(e){if(e)for(var t=Object.keys(e),a=0;a>>3){case 1:r.size=e.int64();break;case 2:r.name=e.string();break;default:e.skipType(7&n)}}return r},e}(),e}(),tensorflow.Tensor=function(){function e(e){if(this.floatVal=[],this.doubleVal=[],this.intVal=[],this.stringVal=[],this.scomplexVal=[],this.int64Val=[],this.boolVal=[],this.uint32Val=[],this.uint64Val=[],e)for(var t=Object.keys(e),a=0;a>>3){case 1:r.dtype=e.int32();break;case 2:r.tensorShape=$root.tensorflow.TensorShape.decode(e,e.uint32());break;case 3:r.versionNumber=e.int32();break;case 4:r.tensorContent=e.bytes();break;case 5:if(r.floatVal&&r.floatVal.length||(r.floatVal=[]),2==(7&n))for(var o=e.uint32()+e.pos;e.pos>>3){case 1:r.list=$root.tensorflow.AttrValue.ListValue.decode(e,e.uint32());break;case 2:r.s=e.bytes();break;case 3:r.i=e.int64();break;case 4:r.f=e.float();break;case 5:r.b=e.bool();break;case 6:r.type=e.int32();break;case 7:r.shape=$root.tensorflow.TensorShape.decode(e,e.uint32());break;case 8:r.tensor=$root.tensorflow.Tensor.decode(e,e.uint32());break;case 9:r.placeholder=e.string();break;case 10:r.func=$root.tensorflow.NameAttrList.decode(e,e.uint32());break;default:e.skipType(7&n)}}return r},e.ListValue=function(){function e(e){if(this.s=[],this.i=[],this.f=[],this.b=[],this.type=[],this.shape=[],this.tensor=[],this.func=[],e)for(var t=Object.keys(e),a=0;a>>3){case 2:r.s&&r.s.length||(r.s=[]),r.s.push(e.bytes());break;case 3:if(r.i&&r.i.length||(r.i=[]),2==(7&n))for(var o=e.uint32()+e.pos;e.pos>>3){case 1:n.name=e.string();break;case 2:e.skip().pos++,n.attr===$util.emptyObject&&(n.attr={}),a=e.string(),e.pos++,n.attr[a]=$root.tensorflow.AttrValue.decode(e,e.uint32());break;default:e.skipType(7&o)}}return n},e}(),tensorflow.NodeDef=function(){function e(e){if(this.input=[],this.attr={},e)for(var t=Object.keys(e),a=0;a>>3){case 1:n.name=e.string();break;case 2:n.op=e.string();break;case 3:n.input&&n.input.length||(n.input=[]),n.input.push(e.string());break;case 4:n.device=e.string();break;case 5:e.skip().pos++,n.attr===$util.emptyObject&&(n.attr={}),a=e.string(),e.pos++,n.attr[a]=$root.tensorflow.AttrValue.decode(e,e.uint32());break;default:e.skipType(7&o)}}return n},e}(),tensorflow.VersionDef=function(){function e(e){if(this.badConsumers=[],e)for(var t=Object.keys(e),a=0;a>>3){case 1:r.producer=e.int32();break;case 2:r.minConsumer=e.int32();break;case 3:if(r.badConsumers&&r.badConsumers.length||(r.badConsumers=[]),2==(7&n))for(var o=e.uint32()+e.pos;e.pos>>3){case 1:r.node&&r.node.length||(r.node=[]),r.node.push($root.tensorflow.NodeDef.decode(e,e.uint32()));break;case 4:r.versions=$root.tensorflow.VersionDef.decode(e,e.uint32());break;case 2:r.library=$root.tensorflow.FunctionDefLibrary.decode(e,e.uint32());break;default:e.skipType(7&n)}}return r},e}(),tensorflow.CollectionDef=function(){function e(e){if(e)for(var t=Object.keys(e),a=0;a>>3){case 1:r.nodeList=$root.tensorflow.CollectionDef.NodeList.decode(e,e.uint32());break;case 2:r.bytesList=$root.tensorflow.CollectionDef.BytesList.decode(e,e.uint32());break;case 3:r.int64List=$root.tensorflow.CollectionDef.Int64List.decode(e,e.uint32());break;case 4:r.floatList=$root.tensorflow.CollectionDef.FloatList.decode(e,e.uint32());break;case 5:r.anyList=$root.tensorflow.CollectionDef.AnyList.decode(e,e.uint32());break;default:e.skipType(7&n)}}return r},e.NodeList=function(){function e(e){if(this.value=[],e)for(var t=Object.keys(e),a=0;a>>3){case 1:r.value&&r.value.length||(r.value=[]),r.value.push(e.string());break;default:e.skipType(7&n)}}return r},e}(),e.BytesList=function(){function e(e){if(this.value=[],e)for(var t=Object.keys(e),a=0;a>>3){case 1:r.value&&r.value.length||(r.value=[]),r.value.push(e.bytes());break;default:e.skipType(7&n)}}return r},e}(),e.Int64List=function(){function e(e){if(this.value=[],e)for(var t=Object.keys(e),a=0;a>>3){case 1:if(r.value&&r.value.length||(r.value=[]),2==(7&n))for(var o=e.uint32()+e.pos;e.pos>>3){case 1:if(r.value&&r.value.length||(r.value=[]),2==(7&n))for(var o=e.uint32()+e.pos;e.pos>>3){case 1:r.value&&r.value.length||(r.value=[]),r.value.push($root.tensorflow.Any.decode(e,e.uint32()));break;default:e.skipType(7&n)}}return r},e}(),e}(),tensorflow.SaverDef=function(){function e(e){if(e)for(var t=Object.keys(e),a=0;a>>3){case 1:r.filenameTensorName=e.string();break;case 2:r.saveTensorName=e.string();break;case 3:r.restoreOpName=e.string();break;case 4:r.maxToKeep=e.int32();break;case 5:r.sharded=e.bool();break;case 6:r.keepCheckpointEveryNHours=e.float();break;case 7:r.version=e.int32();break;default:e.skipType(7&n)}}return r},e.CheckpointFormatVersion=(t={},(a=Object.create(t))[t[0]="LEGACY"]=0,a[t[1]="V1"]=1,a[t[2]="V2"]=2,a),e}(),tensorflow.TensorInfo=function(){function e(e){if(e)for(var t=Object.keys(e),a=0;a>>3){case 1:r.name=e.string();break;case 4:r.cooSparse=$root.tensorflow.TensorInfo.CooSparse.decode(e,e.uint32());break;case 2:r.dtype=e.int32();break;case 3:r.tensorShape=$root.tensorflow.TensorShape.decode(e,e.uint32());break;default:e.skipType(7&n)}}return r},e.CooSparse=function(){function e(e){if(e)for(var t=Object.keys(e),a=0;a>>3){case 1:r.valuesTensorName=e.string();break;case 2:r.indicesTensorName=e.string();break;case 3:r.denseShapeTensorName=e.string();break;default:e.skipType(7&n)}}return r},e}(),e}(),tensorflow.SignatureDef=function(){function e(e){if(this.inputs={},this.outputs={},e)for(var t=Object.keys(e),a=0;a>>3){case 1:e.skip().pos++,n.inputs===$util.emptyObject&&(n.inputs={}),a=e.string(),e.pos++,n.inputs[a]=$root.tensorflow.TensorInfo.decode(e,e.uint32());break;case 2:e.skip().pos++,n.outputs===$util.emptyObject&&(n.outputs={}),a=e.string(),e.pos++,n.outputs[a]=$root.tensorflow.TensorInfo.decode(e,e.uint32());break;case 3:n.methodName=e.string();break;default:e.skipType(7&o)}}return n},e}(),tensorflow.AssetFileDef=function(){function e(e){if(e)for(var t=Object.keys(e),a=0;a>>3){case 1:r.tensorInfo=$root.tensorflow.TensorInfo.decode(e,e.uint32());break;case 2:r.filename=e.string();break;default:e.skipType(7&n)}}return r},e}(),tensorflow.OpDef=function(){function e(e){if(this.inputArg=[],this.outputArg=[],this.attr=[],e)for(var t=Object.keys(e),a=0;a>>3){case 1:r.name=e.string();break;case 2:r.inputArg&&r.inputArg.length||(r.inputArg=[]),r.inputArg.push($root.tensorflow.OpDef.ArgDef.decode(e,e.uint32()));break;case 3:r.outputArg&&r.outputArg.length||(r.outputArg=[]),r.outputArg.push($root.tensorflow.OpDef.ArgDef.decode(e,e.uint32()));break;case 4:r.attr&&r.attr.length||(r.attr=[]),r.attr.push($root.tensorflow.OpDef.AttrDef.decode(e,e.uint32()));break;case 8:r.deprecation=$root.tensorflow.OpDef.OpDeprecation.decode(e,e.uint32());break;case 5:r.summary=e.string();break;case 6:r.description=e.string();break;case 18:r.isCommutative=e.bool();break;case 16:r.isAggregate=e.bool();break;case 17:r.isStateful=e.bool();break;case 19:r.allowsUninitializedInput=e.bool();break;default:e.skipType(7&n)}}return r},e.ArgDef=function(){function e(e){if(e)for(var t=Object.keys(e),a=0;a>>3){case 1:r.name=e.string();break;case 2:r.description=e.string();break;case 3:r.type=e.int32();break;case 4:r.typeAttr=e.string();break;case 5:r.numberAttr=e.string();break;case 6:r.typeListAttr=e.string();break;case 16:r.isRef=e.bool();break;default:e.skipType(7&n)}}return r},e}(),e.AttrDef=function(){function e(e){if(e)for(var t=Object.keys(e),a=0;a>>3){case 1:r.name=e.string();break;case 2:r.type=e.string();break;case 3:r.defaultValue=$root.tensorflow.AttrValue.decode(e,e.uint32());break;case 4:r.description=e.string();break;case 5:r.hasMinimum=e.bool();break;case 6:r.minimum=e.int64();break;case 7:r.allowedValues=$root.tensorflow.AttrValue.decode(e,e.uint32());break;default:e.skipType(7&n)}}return r},e}(),e.OpDeprecation=function(){function e(e){if(e)for(var t=Object.keys(e),a=0;a>>3){case 1:r.version=e.int32();break;case 2:r.explanation=e.string();break;default:e.skipType(7&n)}}return r},e}(),e}(),tensorflow.OpList=function(){function e(e){if(this.op=[],e)for(var t=Object.keys(e),a=0;a>>3){case 1:r.op&&r.op.length||(r.op=[]),r.op.push($root.tensorflow.OpDef.decode(e,e.uint32()));break;default:e.skipType(7&n)}}return r},e}(),tensorflow.MetaGraphDef=function(){function e(e){if(this.collectionDef={},this.signatureDef={},this.assetFileDef=[],e)for(var t=Object.keys(e),a=0;a>>3){case 1:n.metaInfoDef=$root.tensorflow.MetaGraphDef.MetaInfoDef.decode(e,e.uint32());break;case 2:n.graphDef=$root.tensorflow.GraphDef.decode(e,e.uint32());break;case 3:n.saverDef=$root.tensorflow.SaverDef.decode(e,e.uint32());break;case 4:e.skip().pos++,n.collectionDef===$util.emptyObject&&(n.collectionDef={}),a=e.string(),e.pos++,n.collectionDef[a]=$root.tensorflow.CollectionDef.decode(e,e.uint32());break;case 5:e.skip().pos++,n.signatureDef===$util.emptyObject&&(n.signatureDef={}),a=e.string(),e.pos++,n.signatureDef[a]=$root.tensorflow.SignatureDef.decode(e,e.uint32());break;case 6:n.assetFileDef&&n.assetFileDef.length||(n.assetFileDef=[]),n.assetFileDef.push($root.tensorflow.AssetFileDef.decode(e,e.uint32()));break;default:e.skipType(7&o)}}return n},e.MetaInfoDef=function(){function e(e){if(this.tags=[],e)for(var t=Object.keys(e),a=0;a>>3){case 1:r.metaGraphVersion=e.string();break;case 2:r.strippedOpList=$root.tensorflow.OpList.decode(e,e.uint32());break;case 3:r.anyInfo=$root.tensorflow.Any.decode(e,e.uint32());break;case 4:r.tags&&r.tags.length||(r.tags=[]),r.tags.push(e.string());break;case 5:r.tensorflowVersion=e.string();break;case 6:r.tensorflowGitVersion=e.string();break;default:e.skipType(7&n)}}return r},e}(),e}(),tensorflow.SavedModel=function(){function e(e){if(this.metaGraphs=[],e)for(var t=Object.keys(e),a=0;a>>3){case 1:r.savedModelSchemaVersion=e.int64();break;case 2:r.metaGraphs&&r.metaGraphs.length||(r.metaGraphs=[]),r.metaGraphs.push($root.tensorflow.MetaGraphDef.decode(e,e.uint32()));break;default:e.skipType(7&n)}}return r},e}(),tensorflow.FunctionDefLibrary=function(){function e(e){if(this.function=[],this.gradient=[],e)for(var t=Object.keys(e),a=0;a>>3){case 1:r.function&&r.function.length||(r.function=[]),r.function.push($root.tensorflow.FunctionDef.decode(e,e.uint32()));break;case 2:r.gradient&&r.gradient.length||(r.gradient=[]),r.gradient.push($root.tensorflow.GradientDef.decode(e,e.uint32()));break;default:e.skipType(7&n)}}return r},e}(),tensorflow.FunctionDef=function(){function e(e){if(this.attr={},this.nodeDef=[],this.ret={},e)for(var t=Object.keys(e),a=0;a>>3){case 1:n.signature=$root.tensorflow.OpDef.decode(e,e.uint32());break;case 5:e.skip().pos++,n.attr===$util.emptyObject&&(n.attr={}),a=e.string(),e.pos++,n.attr[a]=$root.tensorflow.AttrValue.decode(e,e.uint32());break;case 3:n.nodeDef&&n.nodeDef.length||(n.nodeDef=[]),n.nodeDef.push($root.tensorflow.NodeDef.decode(e,e.uint32()));break;case 4:e.skip().pos++,n.ret===$util.emptyObject&&(n.ret={}),a=e.string(),e.pos++,n.ret[a]=e.string();break;default:e.skipType(7&o)}}return n},e}(),tensorflow.GradientDef=function(){function e(e){if(e)for(var t=Object.keys(e),a=0;a>>3){case 1:r.functionName=e.string();break;case 2:r.gradientFunc=e.string();break;default:e.skipType(7&n)}}return r},e}(),tensorflow);var compiled_api=$root,compiled_api_1=compiled_api.tensorflow;function getParamValue(e,t,a,r){var n=t.params[e];if(n&&void 0!==n.inputIndex){if("tensor"===n.type)return getTensor(t.inputNames[n.inputIndex],a,r);if("tensors"===n.type)return(0===n.inputIndex?0===n.inputParamLength?t.inputNames:t.inputNames.slice(n.inputIndex,-n.inputParamLength):t.inputNames.splice(n.inputIndex)).map(function(e){return getTensor(e,a,r)});var o=Array.prototype.slice.call(getTensor(t.inputNames.slice(n.inputIndex)[0],a,r).dataSync());return"number"===n.type?o[0]:o}return n&&n.value}function getTensor(e,t,a){var r=parseNodeName(e),n=r[0],o=r[1],s=a.currentContextIds.find(function(e){return!!t[getNodeNameWithContextId(n,e)]});return void 0!==s?t[getNodeNameWithContextId(n,s)][o]:void 0}function getNodeNameAndIndex(e,t){var a=parseNodeName(e),r=a[0],n=a[1];return[getNodeNameWithContextId(r,t&&t.currentContextId),n]}function getNodeNameWithContextId(e,t){return t?e+"-"+t:e}function parseNodeName(e){var t=e.lastIndexOf(":");return-1===t?[e,0]:[e.substring(0,t),Number(e.substring(t+1))]}function split(e,t){for(var a=[],r=0;r=this.tensors.length)throw new Error("Tried to read from index "+e+", but array size is: "+this.tensors.length);var t=this.tensors[e];if(t.cleared)throw new Error("TensorArray "+this.name+": Could not read index "+e+" twice because it was cleared after a previous read (perhaps try setting clear_after_read = false?).");return this.clearAfterRead&&(t.cleared=!0),t.read=!0,t.tensor},e.prototype.readMany=function(e){var t=this;return e.map(function(e){return t.read(e)})},e.prototype.write=function(e,t){if(this.closed_)throw new Error("TensorArray "+this.name+" has already been closed.");if(e<0||!this.dynamicSize&&e>=this.maxSize)throw new Error("Tried to write to index "+e+", but array is not resizeable and size is: "+this.maxSize);var a=this.tensors[e]||{};if(t.dtype!==this.dtype)throw new Error("TensorArray "+this.name+": Could not write to TensorArray index "+e+",\n because the value dtype is "+t.dtype+", but TensorArray dtype is "+this.dtype+".");if(0===this.size()&&0===this.elementShape.length&&(this.elementShape=t.shape),tfc.util.assertShapesMatch(this.elementShape,t.shape,"TensorArray "+this.name+": Could not write to TensorArray index "+e+"."),a&&a.read)throw new Error("TensorArray "+this.name+": Could not write to TensorArray index "+e+", because it has already been read.");if(a&&a.written)throw new Error("TensorArray "+this.name+": Could not write to TensorArray index "+e+", because it has already been written.");a.tensor=t,a.written=!0,this.tensors[e]=a},e.prototype.writeMany=function(e,t){var a=this;if(e.length!==t.length)throw new Error("TensorArray "+this.name+": could not write multiple tensors,because the index size: "+e.length+" is not the same as tensors size: "+t.length+".");e.map(function(e,r){return a.write(e,t[r])})},e.prototype.gather=function(e,t){if(t&&t!==this.dtype)throw new Error("TensorArray dtype is "+this.dtype+" but gather requested dtype "+t);if(!e){e=[];for(var a=0;a=this.maxSize)throw new Error("Max index must be < array size ("+a+" vs. "+this.maxSize+")");this.writeMany(e,tfc.unstack(t,0))},e.prototype.split=function(e,t){var a=this;if(t.dtype!==this.dtype)throw new Error("TensorArray dtype is "+this.dtype+" but tensor has dtype "+t.dtype);var r=0,n=e.map(function(e){return r+=e});if(r!==t.shape[0])throw new Error("Expected sum of lengths to be equal to\n tensor.shape[0], but sum of lengths is\n "+r+", and tensor's shape is: "+t.shape);if(!this.dynamicSize&&e.length!==this.maxSize)throw new Error("TensorArray's size is not equal to the size of lengths ("+this.maxSize+" vs. "+e.length+"), and the TensorArray is not marked as dynamically resizeable");var o=0===r?0:t.size/r,s=[];tfc.tidy(function(){t=t.reshape([1,r,o]);for(var i=0;i1)for(var c=1;c1))throw new Error("Cannot exit frame, the context is empty");this.contexts=this.contexts.slice(),this.contexts.splice(-1),this.currentContextIds.shift()},e.prototype.nextIteration=function(){if(!(this.contexts&&this.contexts.length>0))throw new Error("Cannot increase frame iteration, the context is empty");this.contexts=this.contexts.slice(),this.lastId++;var e=Object.assign({},this.contexts[this.contexts.length-1]);e.iterationId+=1,e.id=this.lastId,this.contexts.splice(-1,1,e),this._currentContextIds.splice(0,1,this.contextIdforContexts(this.contexts))},e.prototype.getWeight=function(e){return this.weightMap[e]},e.prototype.addTensorArray=function(e){this.tensorArrayMap[e.id]=e},e.prototype.getTensorArray=function(e){return this.tensorArrayMap[e]},e}(),GraphExecutor=function(){function e(e){this.graph=e,this.compiledOrder=[],this._weightMap={},this.placeholders=e.placeholders,this._outputs=e.outputs,this.compile()}return Object.defineProperty(e.prototype,"weightMap",{get:function(){return this._weightMap},set:function(e){var t=Object.keys(e).map(function(t){return e[t].map(function(e){return e.id})});this.weightIds=[].concat.apply([],t),this._weightMap=e},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"inputs",{get:function(){return this.placeholders.map(function(e){return{name:e.name,shape:e.params.shape?e.params.shape.value:void 0,dtype:e.params.dtype?e.params.dtype.value:void 0}})},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"outputs",{get:function(){return this._outputs.map(function(e){return{name:e.name,shape:e.params.shape?e.params.shape.value:void 0,dtype:e.params.dtype?e.params.dtype.value:void 0}})},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"inputNodes",{get:function(){return this.placeholders.map(function(e){return e.name})},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"outputNodes",{get:function(){return this.outputs.map(function(e){return e.name})},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"isControlFlowModel",{get:function(){return this.graph.withControlFlow},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"isDynamicShapeModel",{get:function(){return this.graph.withDynamicShape},enumerable:!0,configurable:!0}),e.prototype.compile=function(){if(!this.graph.withControlFlow&&!this.graph.withDynamicShape)for(var e=this.graph.inputs.slice(),t={};e.length>0;){var a=e.pop();t[a.name]=!0,this.compiledOrder.push(a),a.children.forEach(function(a){!t[a.name]&&a.inputNames.every(function(e){var a=getNodeNameAndIndex(e)[0];return t[a]})&&e.push(a)})}},e.prototype.execute=function(e,t){var a=this;this.checkInput(e),this.checkInputShapeAndType(e);var r={};return tfc.tidy(function(){var n=new ExecutionContext(a._weightMap,r),o=a.compiledOrder.reduce(function(e,t){return e[t.name]=executeOp$15(t,e,n),e},__assign({},a.weightMap,e));return a.findOutputs(o,n,t)})},e.prototype.executeAsync=function(e,t){return __awaiter(this,void 0,void 0,function(){var a,r,n,o,s,i,p,u=this;return __generator(this,function(l){switch(l.label){case 0:return this.checkInput(e),this.checkInputShapeAndType(e),a={},r=new ExecutionContext(this._weightMap,a),[4,this.executeWithControlFlow(e,r)];case 1:return n=l.sent(),o=this.findOutputs(n,r,t),s=Object.keys(o).map(function(e){return o[e].id}),i=Object.keys(e).map(function(t){return e[t].map(function(e){return e.id})}),p=[].concat.apply([],i),Object.keys(n).forEach(function(e){n[e].forEach(function(e){e&&-1===s.indexOf(e.id)&&-1===p.indexOf(e.id)&&-1===u.weightIds.indexOf(e.id)&&e.dispose()})}),[2,o]}})})},e.prototype.executeWithControlFlow=function(e,t){return __awaiter(this,void 0,void 0,function(){var a,r,n,o,s,i,p,u;return __generator(this,function(l){switch(l.label){case 0:a=this.graph.inputs.map(function(e){return{node:e,contexts:t.currentContext}}),r=__assign({},this.weightMap,e),n={},l.label=1;case 1:return a.length>0?(o=a.pop(),t.currentContext=o.contexts,s="","enter"===o.node.op&&getParamValue("isConstant",o.node,r,t)&&(s=getNodeNameAndIndex(o.node.name,t)[0]),i=executeOp$15(o.node,r,t),s||(s=getNodeNameAndIndex(o.node.name,t)[0]),p=r,u=s,[4,i]):[3,3];case 2:return p[u]=l.sent(),o.node.children.forEach(function(e){var o=getNodeNameAndIndex(e.name,t)[0];n[o]||("merge"===e.op?e.inputNames.some(function(e){return!!getTensor(e,r,t)})&&(n[o]=!0,a.push({contexts:t.currentContext,node:e})):e.inputNames.every(function(e){return!!getTensor(e,r,t)})&&(n[o]=!0,a.push({contexts:t.currentContext,node:e})))}),[3,1];case 3:return[2,r]}})})},e.prototype.findOutputs=function(e,t,a){return!a||a instanceof Array||(a=[a]),(a||this.graph.outputs.map(function(e){return e.name})).reduce(function(a,r){return a[r]=getTensor(r,e,t),a},{})},e.prototype.dispose=function(){var e=this;Object.keys(this.weightMap).forEach(function(t){return e.weightMap[t].forEach(function(e){return e.dispose()})})},e.prototype.checkInputShapeAndType=function(e){this.placeholders.forEach(function(t){var a=e[t.name][0];if(t.params.shape&&t.params.shape.value){var r=t.params.shape.value,n=r.length===a.shape.length&&a.shape.every(function(e,t){return-1===r[t]||r[t]===e});tfc.util.assert(n,"The shape of dict['"+t.name+"'] provided in model.execute(dict) must be ["+r+"], but was ["+a.shape+"]")}t.params.dtype&&t.params.dtype.value&&tfc.util.assert(a.dtype===t.params.dtype.value,"The dtype of dict['"+t.name+"'] provided in model.execute(dict) must be "+t.params.dtype.value+", but was "+a.dtype)})},e.prototype.checkInput=function(e){var t=this,a=Object.keys(e),r=[],n=[];if(this.inputNodes.forEach(function(e){-1===a.indexOf(e)&&r.push(e)}),a.forEach(function(e){-1===t.inputNodes.indexOf(e)&&n.push(e)}),r.length>0)throw new Error("The dict provided in model.execute(dict) has the keys ["+a+"], but is missing the required keys: ["+r+"].");if(n.length>0)throw new Error("The dict provided in model.execute(dict) has unused keys: ["+n+"]. Please provide only the following keys: ["+this.inputNodes+"].")},e}(),FrozenModel=function(){function e(e,t,a){this.modelUrl=e,this.weightManifestUrl=t,this.requestOption=a,this.version="n/a",this.pathPrefix=this.getPathPrefix()}return Object.defineProperty(e.prototype,"modelVersion",{get:function(){return this.version},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"inputNodes",{get:function(){return this.executor.inputNodes},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"outputNodes",{get:function(){return this.executor.outputNodes},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"inputs",{get:function(){return this.executor.inputs},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"outputs",{get:function(){return this.executor.outputs},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"weights",{get:function(){return this.executor.weightMap},enumerable:!0,configurable:!0}),e.prototype.getPathPrefix=function(){var e=parse(this.weightManifestUrl),t=e.pathname.split("/");return t.splice(-1),e.pathname=t.join("/"),format(e)+"/"},e.prototype.loadRemoteProtoFile=function(){return __awaiter(this,void 0,void 0,function(){var e,t,a,r,n;return __generator(this,function(o){switch(o.label){case 0:return o.trys.push([0,3,,4]),[4,fetch(this.modelUrl,this.requestOption)];case 1:return e=o.sent(),a=(t=compiled_api_1.GraphDef).decode,r=Uint8Array.bind,[4,e.arrayBuffer()];case 2:return[2,a.apply(t,[new(r.apply(Uint8Array,[void 0,o.sent()]))])];case 3:throw n=o.sent(),new Error(this.modelUrl+" not found. "+n);case 4:return[2]}})})},e.prototype.loadWeightManifest=function(){return __awaiter(this,void 0,void 0,function(){var e,t,a;return __generator(this,function(r){switch(r.label){case 0:return r.trys.push([0,3,,4]),[4,fetch(this.weightManifestUrl,this.requestOption)];case 1:return e=r.sent(),t=this,[4,e.clone().json()];case 2:return t.weightManifest=r.sent(),[3,4];case 3:throw a=r.sent(),new Error(this.weightManifestUrl+" not found. "+a);case 4:return[2]}})})},e.prototype.load=function(){return __awaiter(this,void 0,void 0,function(){var e,t,a,r;return __generator(this,function(n){switch(n.label){case 0:return e=this.loadRemoteProtoFile(),t=this.loadWeightManifest(),[4,Promise.all([e,t])];case 1:return a=n.sent()[0],this.version=a.versions.producer+"."+a.versions.minConsumer,[4,tfc.io.loadWeights(this.weightManifest,this.pathPrefix,void 0,this.requestOption)];case 2:return r=n.sent(),this.executor=new GraphExecutor(OperationMapper.Instance.transformGraph(a)),this.executor.weightMap=this.convertTensorMapToTensorsMap(r),[2,!0]}})})},e.prototype.predict=function(e,t){return this.execute(e,this.outputNodes)},e.prototype.constructTensorMap=function(e){var t=e instanceof tfc.Tensor?[e]:e;if(t.length!==this.inputNodes.length)throw new Error("Input tensor count mismatch,the frozen model has "+this.inputNodes.length+" placeholders, while there are "+t.length+" input tensors.");return this.inputNodes.reduce(function(e,a,r){return e[a]=t[r],e},{})},e.prototype.execute=function(e,t){if(t=t||this.outputNodes,(e instanceof tfc.Tensor||Array.isArray(e))&&(e=this.constructTensorMap(e)),this.executor.isControlFlowModel||this.executor.isDynamicShapeModel)throw new Error("The model contains control flow or dynamic shape ops, please use executeAsync method");var a=this.executor.execute(this.convertTensorMapToTensorsMap(e),t),r=Object.keys(a);return Array.isArray(t)&&t.length>1?t.map(function(e){return a[e]}):a[r[0]]},e.prototype.executeAsync=function(e,t){return __awaiter(this,void 0,void 0,function(){var a,r;return __generator(this,function(n){switch(n.label){case 0:if(!this.executor.isControlFlowModel||!this.executor.isDynamicShapeModel)throw new Error("The model does not contain control flow or dynamic shape ops, please use execute method for better performance.");return t=t||this.outputNodes,(e instanceof tfc.Tensor||Array.isArray(e))&&(e=this.constructTensorMap(e)),[4,this.executor.executeAsync(this.convertTensorMapToTensorsMap(e),t)];case 1:return a=n.sent(),r=Object.keys(a),[2,Array.isArray(t)&&t.length>1?t.map(function(e){return a[e]}):a[r[0]]]}})})},e.prototype.convertTensorMapToTensorsMap=function(e){return Object.keys(e).reduce(function(t,a){return t[a]=[e[a]],t},{})},e.prototype.dispose=function(){this.executor.dispose()},e}();function loadFrozenModel(e,t,a){return __awaiter(this,void 0,void 0,function(){var r;return __generator(this,function(n){switch(n.label){case 0:return[4,(r=new FrozenModel(e,t,a)).load()];case 1:return n.sent(),[2,r]}})})}var version="0.5.5";exports.FrozenModel=FrozenModel,exports.loadFrozenModel=loadFrozenModel,exports.version_converter=version,Object.defineProperty(exports,"__esModule",{value:!0})});
diff --git a/node_modules/@tensorflow/tfjs-converter/dist/version.d.ts b/node_modules/@tensorflow/tfjs-converter/dist/version.d.ts
new file mode 100644
index 0000000..097c78d
--- /dev/null
+++ b/node_modules/@tensorflow/tfjs-converter/dist/version.d.ts
@@ -0,0 +1,2 @@
+declare const version = "0.5.5";
+export { version };
diff --git a/node_modules/@tensorflow/tfjs-converter/dist/version.js b/node_modules/@tensorflow/tfjs-converter/dist/version.js
new file mode 100644
index 0000000..a5b460f
--- /dev/null
+++ b/node_modules/@tensorflow/tfjs-converter/dist/version.js
@@ -0,0 +1,5 @@
+"use strict";
+Object.defineProperty(exports, "__esModule", { value: true });
+var version = '0.5.5';
+exports.version = version;
+//# sourceMappingURL=version.js.map
\ No newline at end of file
diff --git a/node_modules/@tensorflow/tfjs-converter/package.json b/node_modules/@tensorflow/tfjs-converter/package.json
new file mode 100644
index 0000000..ef48560
--- /dev/null
+++ b/node_modules/@tensorflow/tfjs-converter/package.json
@@ -0,0 +1,97 @@
+{
+ "_from": "@tensorflow/tfjs-converter@0.5.5",
+ "_id": "@tensorflow/tfjs-converter@0.5.5",
+ "_inBundle": false,
+ "_integrity": "sha512-tLIv4u0+BtE61oarjQWJUsL0Ro54YmiDx8XVCbN9QY34V6zZrNFr/VJYZEIZnKcepCQ0MxZ09mggnfBD3EvMrQ==",
+ "_location": "/@tensorflow/tfjs-converter",
+ "_phantomChildren": {},
+ "_requested": {
+ "type": "version",
+ "registry": true,
+ "raw": "@tensorflow/tfjs-converter@0.5.5",
+ "name": "@tensorflow/tfjs-converter",
+ "escapedName": "@tensorflow%2ftfjs-converter",
+ "scope": "@tensorflow",
+ "rawSpec": "0.5.5",
+ "saveSpec": null,
+ "fetchSpec": "0.5.5"
+ },
+ "_requiredBy": [
+ "/@tensorflow/tfjs"
+ ],
+ "_resolved": "https://registry.npmjs.org/@tensorflow/tfjs-converter/-/tfjs-converter-0.5.5.tgz",
+ "_shasum": "0b8ced232d598e70bc52a4a6d95ba69f88af1b8d",
+ "_spec": "@tensorflow/tfjs-converter@0.5.5",
+ "_where": "C:\\Users\\Gavin\\Desktop\\opensource\\ratzbot\\node_modules\\@tensorflow\\tfjs",
+ "bugs": {
+ "url": "https://github.com/tensorflow/tfjs-converter/issues"
+ },
+ "bundleDependencies": false,
+ "dependencies": {
+ "@types/long": "~3.0.32",
+ "protobufjs": "~6.8.6",
+ "url": "~0.11.0"
+ },
+ "deprecated": false,
+ "description": "Tensorflow model converter for javascript",
+ "devDependencies": {
+ "@tensorflow/tfjs-core": "~0.12.8",
+ "@types/jasmine": "~2.8.6",
+ "@types/node-fetch": "1.6.9",
+ "ajv": "~6.3.0",
+ "babel-core": "~6.26.3",
+ "babel-plugin-external-helpers": "~6.22.0",
+ "babel-preset-env": "~1.7.0",
+ "clang-format": "~1.2.2",
+ "copyfiles": "~1.2.0",
+ "jasmine-core": "~3.1.0",
+ "karma": "~2.0.0",
+ "karma-browserstack-launcher": "~1.3.0",
+ "karma-chrome-launcher": "~2.2.0",
+ "karma-firefox-launcher": "~1.0.1",
+ "karma-jasmine": "~1.1.1",
+ "karma-typescript": "~3.0.12",
+ "node-fetch": "~2.1.2",
+ "opn": "~5.1.0",
+ "rimraf": "~2.6.2",
+ "rollup": "~0.58.2",
+ "rollup-plugin-commonjs": "~9.1.3",
+ "rollup-plugin-json": "~3.0.0",
+ "rollup-plugin-node-resolve": "~3.3.0",
+ "rollup-plugin-typescript2": "~0.13.0",
+ "rollup-plugin-uglify": "~3.0.0",
+ "ts-node": "~4.1.0",
+ "tslint": "~5.8.0",
+ "tslint-no-circular-imports": "~0.5.0",
+ "typescript": "~2.7.2",
+ "yalc": "~1.0.0-pre.21"
+ },
+ "homepage": "https://github.com/tensorflow/tfjs-converter#readme",
+ "jsdelivr": "dist/tf-converter.min.js",
+ "jsnext:main": "dist/tf-converter.esm.js",
+ "license": "Apache-2.0",
+ "main": "dist/index.js",
+ "module": "dist/tf-converter.esm.js",
+ "name": "@tensorflow/tfjs-converter",
+ "peerDependencies": {
+ "@tensorflow/tfjs-core": "~0.12.8"
+ },
+ "repository": {
+ "type": "git",
+ "url": "git+https://github.com/tensorflow/tfjs-converter.git"
+ },
+ "scripts": {
+ "build": "tsc && copyfiles -f src/data/compiled_api.* dist/data && copyfiles -f src/operations/op_list/*.json dist/operations/op_list && copyfiles -f src/operations/typings.d.ts dist/operations",
+ "build-npm": "./scripts/build-npm.sh",
+ "gen-doc": "ts-node ./src/docs/doc_gen.ts",
+ "link-local": "yalc link",
+ "lint": "tslint -p . -t verbose",
+ "make-version": "sh -c ./scripts/make-version",
+ "publish-local": "yarn build-npm && yalc push",
+ "test": "karma start",
+ "test-travis": "karma start --browsers='bs_firefox_mac,bs_chrome_mac' --singleRun"
+ },
+ "types": "dist/index.d.ts",
+ "unpkg": "dist/tf-converter.min.js",
+ "version": "0.5.5"
+}
diff --git a/node_modules/@tensorflow/tfjs-core/LICENSE b/node_modules/@tensorflow/tfjs-core/LICENSE
new file mode 100644
index 0000000..d645695
--- /dev/null
+++ b/node_modules/@tensorflow/tfjs-core/LICENSE
@@ -0,0 +1,202 @@
+
+ Apache License
+ Version 2.0, January 2004
+ http://www.apache.org/licenses/
+
+ TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
+
+ 1. Definitions.
+
+ "License" shall mean the terms and conditions for use, reproduction,
+ and distribution as defined by Sections 1 through 9 of this document.
+
+ "Licensor" shall mean the copyright owner or entity authorized by
+ the copyright owner that is granting the License.
+
+ "Legal Entity" shall mean the union of the acting entity and all
+ other entities that control, are controlled by, or are under common
+ control with that entity. For the purposes of this definition,
+ "control" means (i) the power, direct or indirect, to cause the
+ direction or management of such entity, whether by contract or
+ otherwise, or (ii) ownership of fifty percent (50%) or more of the
+ outstanding shares, or (iii) beneficial ownership of such entity.
+
+ "You" (or "Your") shall mean an individual or Legal Entity
+ exercising permissions granted by this License.
+
+ "Source" form shall mean the preferred form for making modifications,
+ including but not limited to software source code, documentation
+ source, and configuration files.
+
+ "Object" form shall mean any form resulting from mechanical
+ transformation or translation of a Source form, including but
+ not limited to compiled object code, generated documentation,
+ and conversions to other media types.
+
+ "Work" shall mean the work of authorship, whether in Source or
+ Object form, made available under the License, as indicated by a
+ copyright notice that is included in or attached to the work
+ (an example is provided in the Appendix below).
+
+ "Derivative Works" shall mean any work, whether in Source or Object
+ form, that is based on (or derived from) the Work and for which the
+ editorial revisions, annotations, elaborations, or other modifications
+ represent, as a whole, an original work of authorship. For the purposes
+ of this License, Derivative Works shall not include works that remain
+ separable from, or merely link (or bind by name) to the interfaces of,
+ the Work and Derivative Works thereof.
+
+ "Contribution" shall mean any work of authorship, including
+ the original version of the Work and any modifications or additions
+ to that Work or Derivative Works thereof, that is intentionally
+ submitted to Licensor for inclusion in the Work by the copyright owner
+ or by an individual or Legal Entity authorized to submit on behalf of
+ the copyright owner. For the purposes of this definition, "submitted"
+ means any form of electronic, verbal, or written communication sent
+ to the Licensor or its representatives, including but not limited to
+ communication on electronic mailing lists, source code control systems,
+ and issue tracking systems that are managed by, or on behalf of, the
+ Licensor for the purpose of discussing and improving the Work, but
+ excluding communication that is conspicuously marked or otherwise
+ designated in writing by the copyright owner as "Not a Contribution."
+
+ "Contributor" shall mean Licensor and any individual or Legal Entity
+ on behalf of whom a Contribution has been received by Licensor and
+ subsequently incorporated within the Work.
+
+ 2. Grant of Copyright License. Subject to the terms and conditions of
+ this License, each Contributor hereby grants to You a perpetual,
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
+ copyright license to reproduce, prepare Derivative Works of,
+ publicly display, publicly perform, sublicense, and distribute the
+ Work and such Derivative Works in Source or Object form.
+
+ 3. Grant of Patent License. Subject to the terms and conditions of
+ this License, each Contributor hereby grants to You a perpetual,
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
+ (except as stated in this section) patent license to make, have made,
+ use, offer to sell, sell, import, and otherwise transfer the Work,
+ where such license applies only to those patent claims licensable
+ by such Contributor that are necessarily infringed by their
+ Contribution(s) alone or by combination of their Contribution(s)
+ with the Work to which such Contribution(s) was submitted. If You
+ institute patent litigation against any entity (including a
+ cross-claim or counterclaim in a lawsuit) alleging that the Work
+ or a Contribution incorporated within the Work constitutes direct
+ or contributory patent infringement, then any patent licenses
+ granted to You under this License for that Work shall terminate
+ as of the date such litigation is filed.
+
+ 4. Redistribution. You may reproduce and distribute copies of the
+ Work or Derivative Works thereof in any medium, with or without
+ modifications, and in Source or Object form, provided that You
+ meet the following conditions:
+
+ (a) You must give any other recipients of the Work or
+ Derivative Works a copy of this License; and
+
+ (b) You must cause any modified files to carry prominent notices
+ stating that You changed the files; and
+
+ (c) You must retain, in the Source form of any Derivative Works
+ that You distribute, all copyright, patent, trademark, and
+ attribution notices from the Source form of the Work,
+ excluding those notices that do not pertain to any part of
+ the Derivative Works; and
+
+ (d) If the Work includes a "NOTICE" text file as part of its
+ distribution, then any Derivative Works that You distribute must
+ include a readable copy of the attribution notices contained
+ within such NOTICE file, excluding those notices that do not
+ pertain to any part of the Derivative Works, in at least one
+ of the following places: within a NOTICE text file distributed
+ as part of the Derivative Works; within the Source form or
+ documentation, if provided along with the Derivative Works; or,
+ within a display generated by the Derivative Works, if and
+ wherever such third-party notices normally appear. The contents
+ of the NOTICE file are for informational purposes only and
+ do not modify the License. You may add Your own attribution
+ notices within Derivative Works that You distribute, alongside
+ or as an addendum to the NOTICE text from the Work, provided
+ that such additional attribution notices cannot be construed
+ as modifying the License.
+
+ You may add Your own copyright statement to Your modifications and
+ may provide additional or different license terms and conditions
+ for use, reproduction, or distribution of Your modifications, or
+ for any such Derivative Works as a whole, provided Your use,
+ reproduction, and distribution of the Work otherwise complies with
+ the conditions stated in this License.
+
+ 5. Submission of Contributions. Unless You explicitly state otherwise,
+ any Contribution intentionally submitted for inclusion in the Work
+ by You to the Licensor shall be under the terms and conditions of
+ this License, without any additional terms or conditions.
+ Notwithstanding the above, nothing herein shall supersede or modify
+ the terms of any separate license agreement you may have executed
+ with Licensor regarding such Contributions.
+
+ 6. Trademarks. This License does not grant permission to use the trade
+ names, trademarks, service marks, or product names of the Licensor,
+ except as required for reasonable and customary use in describing the
+ origin of the Work and reproducing the content of the NOTICE file.
+
+ 7. Disclaimer of Warranty. Unless required by applicable law or
+ agreed to in writing, Licensor provides the Work (and each
+ Contributor provides its Contributions) on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
+ implied, including, without limitation, any warranties or conditions
+ of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
+ PARTICULAR PURPOSE. You are solely responsible for determining the
+ appropriateness of using or redistributing the Work and assume any
+ risks associated with Your exercise of permissions under this License.
+
+ 8. Limitation of Liability. In no event and under no legal theory,
+ whether in tort (including negligence), contract, or otherwise,
+ unless required by applicable law (such as deliberate and grossly
+ negligent acts) or agreed to in writing, shall any Contributor be
+ liable to You for damages, including any direct, indirect, special,
+ incidental, or consequential damages of any character arising as a
+ result of this License or out of the use or inability to use the
+ Work (including but not limited to damages for loss of goodwill,
+ work stoppage, computer failure or malfunction, or any and all
+ other commercial damages or losses), even if such Contributor
+ has been advised of the possibility of such damages.
+
+ 9. Accepting Warranty or Additional Liability. While redistributing
+ the Work or Derivative Works thereof, You may choose to offer,
+ and charge a fee for, acceptance of support, warranty, indemnity,
+ or other liability obligations and/or rights consistent with this
+ License. However, in accepting such obligations, You may act only
+ on Your own behalf and on Your sole responsibility, not on behalf
+ of any other Contributor, and only if You agree to indemnify,
+ defend, and hold each Contributor harmless for any liability
+ incurred by, or claims asserted against, such Contributor by reason
+ of your accepting any such warranty or additional liability.
+
+ END OF TERMS AND CONDITIONS
+
+ APPENDIX: How to apply the Apache License to your work.
+
+ To apply the Apache License to your work, attach the following
+ boilerplate notice, with the fields enclosed by brackets "[]"
+ replaced with your own identifying information. (Don't include
+ the brackets!) The text should be enclosed in the appropriate
+ comment syntax for the file format. We also recommend that a
+ file or class name and description of purpose be included on the
+ same "printed page" as the copyright notice for easier
+ identification within third-party archives.
+
+ Copyright [yyyy] [name of copyright owner]
+
+ Licensed under the Apache License, Version 2.0 (the "License");
+ you may not use this file except in compliance with the License.
+ You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing, software
+ distributed under the License is distributed on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ See the License for the specific language governing permissions and
+ limitations under the License.
diff --git a/node_modules/@tensorflow/tfjs-core/README.md b/node_modules/@tensorflow/tfjs-core/README.md
new file mode 100644
index 0000000..1010a37
--- /dev/null
+++ b/node_modules/@tensorflow/tfjs-core/README.md
@@ -0,0 +1,45 @@
+
+
+
+
+# TensorFlow.js Core API
+
+A part of the TensorFlow.js ecosystem, this repo hosts `@tensorflow/tfjs-core`,
+the TensorFlow.js Core API, which provides low-level, hardware-accelerated
+linear algebra operations and an eager API for automatic differentiation.
+
+Check out [js.tensorflow.org](https://js.tensorflow.org) for more
+information about the library, tutorials and API docs.
+
+To keep track of issues we use the [tensorflow/tfjs](https://github.com/tensorflow/tfjs) Github repo.
+
+## Importing
+
+You can install TensorFlow.js via yarn or npm. We recommend using the
+[@tensorflow/tfjs](https://www.npmjs.com/package/@tensorflow/tfjs) npm package,
+which gives you both this Core API and the higher-level
+[Layers API](https://github.com/tensorflow/tfjs-layers):
+
+```js
+import * as tf from '@tensorflow/tfjs';
+// You have the Core API: tf.matMul(), tf.softmax(), ...
+// You also have Layers API: tf.model(), tf.layers.dense(), ...
+```
+
+On the other hand, if you care about the bundle size and you do not use the
+Layers API, you can import only the Core API:
+
+```js
+import * as tfc from '@tensorflow/tfjs-core';
+// You have the Core API: tfc.matMul(), tfc.softmax(), ...
+// No Layers API.
+```
+
+For info about development, check out [DEVELOPMENT.md](./DEVELOPMENT.md).
+
+## For more information
+
+- [TensorFlow.js API documentation](https://js.tensorflow.org/api/latest/)
+- [TensorFlow.js Tutorials](https://js.tensorflow.org/tutorials/)
+
+Thanks BrowserStack for providing testing support.
diff --git a/node_modules/@tensorflow/tfjs-core/dist/browser_util.d.ts b/node_modules/@tensorflow/tfjs-core/dist/browser_util.d.ts
new file mode 100644
index 0000000..2b112a5
--- /dev/null
+++ b/node_modules/@tensorflow/tfjs-core/dist/browser_util.d.ts
@@ -0,0 +1,2 @@
+declare function nextFrame(): Promise;
+export { nextFrame };
diff --git a/node_modules/@tensorflow/tfjs-core/dist/browser_util.js b/node_modules/@tensorflow/tfjs-core/dist/browser_util.js
new file mode 100644
index 0000000..0f3dcb7
--- /dev/null
+++ b/node_modules/@tensorflow/tfjs-core/dist/browser_util.js
@@ -0,0 +1,10 @@
+"use strict";
+Object.defineProperty(exports, "__esModule", { value: true });
+var delayCallback = typeof requestAnimationFrame !== 'undefined' ?
+ requestAnimationFrame :
+ setImmediate;
+function nextFrame() {
+ return new Promise(function (resolve) { return delayCallback(function () { return resolve(); }); });
+}
+exports.nextFrame = nextFrame;
+//# sourceMappingURL=browser_util.js.map
\ No newline at end of file
diff --git a/node_modules/@tensorflow/tfjs-core/dist/browser_util.js.map b/node_modules/@tensorflow/tfjs-core/dist/browser_util.js.map
new file mode 100644
index 0000000..b9f4f7f
--- /dev/null
+++ b/node_modules/@tensorflow/tfjs-core/dist/browser_util.js.map
@@ -0,0 +1 @@
+{"version":3,"file":"browser_util.js","sourceRoot":"","sources":["../src/browser_util.ts"],"names":[],"mappings":";;AAiBA,IAAM,aAAa,GAAG,OAAO,qBAAqB,KAAK,WAAW,CAAC,CAAC;IAChE,qBAAqB,CAAC,CAAC;IACvB,YAAY,CAAC;AAWjB;IACE,OAAO,IAAI,OAAO,CAAO,UAAA,OAAO,IAAI,OAAA,aAAa,CAAC,cAAM,OAAA,OAAO,EAAE,EAAT,CAAS,CAAC,EAA9B,CAA8B,CAAC,CAAC;AACtE,CAAC;AAEO,8BAAS"}
\ No newline at end of file
diff --git a/node_modules/@tensorflow/tfjs-core/dist/browser_util_test.d.ts b/node_modules/@tensorflow/tfjs-core/dist/browser_util_test.d.ts
new file mode 100644
index 0000000..cb0ff5c
--- /dev/null
+++ b/node_modules/@tensorflow/tfjs-core/dist/browser_util_test.d.ts
@@ -0,0 +1 @@
+export {};
diff --git a/node_modules/@tensorflow/tfjs-core/dist/browser_util_test.js b/node_modules/@tensorflow/tfjs-core/dist/browser_util_test.js
new file mode 100644
index 0000000..0883abf
--- /dev/null
+++ b/node_modules/@tensorflow/tfjs-core/dist/browser_util_test.js
@@ -0,0 +1,83 @@
+"use strict";
+var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
+ return new (P || (P = Promise))(function (resolve, reject) {
+ function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
+ function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
+ function step(result) { result.done ? resolve(result.value) : new P(function (resolve) { resolve(result.value); }).then(fulfilled, rejected); }
+ step((generator = generator.apply(thisArg, _arguments || [])).next());
+ });
+};
+var __generator = (this && this.__generator) || function (thisArg, body) {
+ var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;
+ return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
+ function verb(n) { return function (v) { return step([n, v]); }; }
+ function step(op) {
+ if (f) throw new TypeError("Generator is already executing.");
+ while (_) try {
+ if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;
+ if (y = 0, t) op = [op[0] & 2, t.value];
+ switch (op[0]) {
+ case 0: case 1: t = op; break;
+ case 4: _.label++; return { value: op[1], done: false };
+ case 5: _.label++; y = op[1]; op = [0]; continue;
+ case 7: op = _.ops.pop(); _.trys.pop(); continue;
+ default:
+ if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }
+ if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }
+ if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }
+ if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }
+ if (t[2]) _.ops.pop();
+ _.trys.pop(); continue;
+ }
+ op = body.call(thisArg, _);
+ } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }
+ if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };
+ }
+};
+var _this = this;
+Object.defineProperty(exports, "__esModule", { value: true });
+var tf = require("./index");
+var jasmine_util_1 = require("./jasmine_util");
+var test_util_1 = require("./test_util");
+jasmine_util_1.describeWithFlags('nextFrame', test_util_1.ALL_ENVS, function () {
+ it('basic usage', function () { return __awaiter(_this, void 0, void 0, function () {
+ var t0, t1;
+ return __generator(this, function (_a) {
+ switch (_a.label) {
+ case 0:
+ t0 = tf.util.now();
+ return [4, tf.nextFrame()];
+ case 1:
+ _a.sent();
+ t1 = tf.util.now();
+ expect(t1 > t0);
+ return [2];
+ }
+ });
+ }); });
+ it('does not block timers', function () { return __awaiter(_this, void 0, void 0, function () {
+ var flag, t0;
+ return __generator(this, function (_a) {
+ switch (_a.label) {
+ case 0:
+ flag = false;
+ setTimeout(function () {
+ flag = true;
+ }, 50);
+ t0 = tf.util.now();
+ expect(flag).toBe(false);
+ _a.label = 1;
+ case 1:
+ if (!(tf.util.now() - t0 < 1000 && !flag)) return [3, 3];
+ return [4, tf.nextFrame()];
+ case 2:
+ _a.sent();
+ return [3, 1];
+ case 3:
+ expect(flag).toBe(true);
+ return [2];
+ }
+ });
+ }); });
+});
+//# sourceMappingURL=browser_util_test.js.map
\ No newline at end of file
diff --git a/node_modules/@tensorflow/tfjs-core/dist/browser_util_test.js.map b/node_modules/@tensorflow/tfjs-core/dist/browser_util_test.js.map
new file mode 100644
index 0000000..5d035b6
--- /dev/null
+++ b/node_modules/@tensorflow/tfjs-core/dist/browser_util_test.js.map
@@ -0,0 +1 @@
+{"version":3,"file":"browser_util_test.js","sourceRoot":"","sources":["../src/browser_util_test.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAiBA,iBA0BA;;AA1BA,4BAA8B;AAC9B,+CAAiD;AACjD,yCAAqC;AAErC,gCAAiB,CAAC,WAAW,EAAE,oBAAQ,EAAE;IACvC,EAAE,CAAC,aAAa,EAAE;;;;;oBACV,EAAE,GAAG,EAAE,CAAC,IAAI,CAAC,GAAG,EAAE,CAAC;oBACzB,WAAM,EAAE,CAAC,SAAS,EAAE,EAAA;;oBAApB,SAAoB,CAAC;oBACf,EAAE,GAAG,EAAE,CAAC,IAAI,CAAC,GAAG,EAAE,CAAC;oBAEzB,MAAM,CAAC,EAAE,GAAG,EAAE,CAAC,CAAC;;;;SACjB,CAAC,CAAC;IAEH,EAAE,CAAC,uBAAuB,EAAE;;;;;oBACtB,IAAI,GAAG,KAAK,CAAC;oBACjB,UAAU,CAAC;wBACT,IAAI,GAAG,IAAI,CAAC;oBACd,CAAC,EAAE,EAAE,CAAC,CAAC;oBACD,EAAE,GAAG,EAAE,CAAC,IAAI,CAAC,GAAG,EAAE,CAAC;oBACzB,MAAM,CAAC,IAAI,CAAC,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC;;;yBAClB,CAAA,EAAE,CAAC,IAAI,CAAC,GAAG,EAAE,GAAG,EAAE,GAAG,IAAI,IAAI,CAAC,IAAI,CAAA;oBACvC,WAAM,EAAE,CAAC,SAAS,EAAE,EAAA;;oBAApB,SAAoB,CAAC;;;oBAEvB,MAAM,CAAC,IAAI,CAAC,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;;;;SACzB,CAAC,CAAC;AACL,CAAC,CAAC,CAAC"}
\ No newline at end of file
diff --git a/node_modules/@tensorflow/tfjs-core/dist/debug_mode_test.d.ts b/node_modules/@tensorflow/tfjs-core/dist/debug_mode_test.d.ts
new file mode 100644
index 0000000..cb0ff5c
--- /dev/null
+++ b/node_modules/@tensorflow/tfjs-core/dist/debug_mode_test.d.ts
@@ -0,0 +1 @@
+export {};
diff --git a/node_modules/@tensorflow/tfjs-core/dist/debug_mode_test.js b/node_modules/@tensorflow/tfjs-core/dist/debug_mode_test.js
new file mode 100644
index 0000000..04dd2f4
--- /dev/null
+++ b/node_modules/@tensorflow/tfjs-core/dist/debug_mode_test.js
@@ -0,0 +1,58 @@
+"use strict";
+Object.defineProperty(exports, "__esModule", { value: true });
+var tf = require("./index");
+var jasmine_util_1 = require("./jasmine_util");
+var tensor_util_env_1 = require("./tensor_util_env");
+var test_util_1 = require("./test_util");
+jasmine_util_1.describeWithFlags('debug on', test_util_1.ALL_ENVS, function () {
+ beforeAll(function () {
+ tf.ENV.set('DEBUG', true);
+ });
+ afterAll(function () {
+ tf.ENV.set('DEBUG', false);
+ });
+ it('debug mode does not error when no nans', function () {
+ var a = tf.tensor1d([2, -1, 0, 3]);
+ var res = tf.relu(a);
+ test_util_1.expectArraysClose(res, [2, 0, 0, 3]);
+ });
+ it('debug mode errors when there are nans, float32', function () {
+ var a = tf.tensor1d([2, NaN]);
+ var f = function () { return tf.relu(a); };
+ expect(f).toThrowError();
+ });
+ it('debug mode errors when nans in tensor construction, int32', function () {
+ var a = function () { return tf.tensor1d([2, NaN], 'int32'); };
+ expect(a).toThrowError();
+ });
+ it('debug mode errors when nans in oneHot op (tensorlike), int32', function () {
+ var f = function () { return tf.oneHot([2, NaN], 3); };
+ expect(f).toThrowError();
+ });
+ it('debug mode errors when nan in convertToTensor, int32', function () {
+ var a = function () { return tensor_util_env_1.convertToTensor(NaN, 'a', 'test', 'int32'); };
+ expect(a).toThrowError();
+ });
+ it('debug mode errors when nan in convertToTensor array input, int32', function () {
+ var a = function () { return tensor_util_env_1.convertToTensor([NaN], 'a', 'test', 'int32'); };
+ expect(a).toThrowError();
+ });
+ it('A x B', function () {
+ var a = tf.tensor2d([1, 2, 3, 4, 5, 6], [2, 3]);
+ var b = tf.tensor2d([0, 1, -3, 2, 2, 1], [3, 2]);
+ var c = tf.matMul(a, b);
+ expect(c.shape).toEqual([2, 2]);
+ test_util_1.expectArraysClose(c, [0, 8, -3, 20]);
+ });
+});
+jasmine_util_1.describeWithFlags('debug off', test_util_1.ALL_ENVS, function () {
+ beforeAll(function () {
+ tf.ENV.set('DEBUG', false);
+ });
+ it('no errors where there are nans, and debug mode is disabled', function () {
+ var a = tf.tensor1d([2, NaN]);
+ var res = tf.relu(a);
+ test_util_1.expectArraysClose(res, [2, NaN]);
+ });
+});
+//# sourceMappingURL=debug_mode_test.js.map
\ No newline at end of file
diff --git a/node_modules/@tensorflow/tfjs-core/dist/debug_mode_test.js.map b/node_modules/@tensorflow/tfjs-core/dist/debug_mode_test.js.map
new file mode 100644
index 0000000..b7f084b
--- /dev/null
+++ b/node_modules/@tensorflow/tfjs-core/dist/debug_mode_test.js.map
@@ -0,0 +1 @@
+{"version":3,"file":"debug_mode_test.js","sourceRoot":"","sources":["../src/debug_mode_test.ts"],"names":[],"mappings":";;AAiBA,4BAA8B;AAC9B,+CAAiD;AACjD,qDAAkD;AAClD,yCAAwD;AAExD,gCAAiB,CAAC,UAAU,EAAE,oBAAQ,EAAE;IACtC,SAAS,CAAC;QACR,EAAE,CAAC,GAAG,CAAC,GAAG,CAAC,OAAO,EAAE,IAAI,CAAC,CAAC;IAC5B,CAAC,CAAC,CAAC;IAEH,QAAQ,CAAC;QACP,EAAE,CAAC,GAAG,CAAC,GAAG,CAAC,OAAO,EAAE,KAAK,CAAC,CAAC;IAC7B,CAAC,CAAC,CAAC;IAEH,EAAE,CAAC,wCAAwC,EAAE;QAC3C,IAAM,CAAC,GAAG,EAAE,CAAC,QAAQ,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,EAAE,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC;QACrC,IAAM,GAAG,GAAG,EAAE,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;QACvB,6BAAiB,CAAC,GAAG,EAAE,CAAC,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC;IACvC,CAAC,CAAC,CAAC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diff --git a/node_modules/@tensorflow/tfjs-core/dist/device_util.d.ts b/node_modules/@tensorflow/tfjs-core/dist/device_util.d.ts
new file mode 100644
index 0000000..c2a6948
--- /dev/null
+++ b/node_modules/@tensorflow/tfjs-core/dist/device_util.d.ts
@@ -0,0 +1 @@
+export declare function isMobile(): boolean;
diff --git a/node_modules/@tensorflow/tfjs-core/dist/device_util.js b/node_modules/@tensorflow/tfjs-core/dist/device_util.js
new file mode 100644
index 0000000..6bf155e
--- /dev/null
+++ b/node_modules/@tensorflow/tfjs-core/dist/device_util.js
@@ -0,0 +1,11 @@
+"use strict";
+Object.defineProperty(exports, "__esModule", { value: true });
+function isMobile() {
+ var a = navigator.userAgent || navigator.vendor || window.opera;
+ 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(a) ||
+ /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(a.substr(0, 4));
+}
+exports.isMobile = isMobile;
+//# sourceMappingURL=device_util.js.map
\ No newline at end of file
diff --git a/node_modules/@tensorflow/tfjs-core/dist/device_util.js.map b/node_modules/@tensorflow/tfjs-core/dist/device_util.js.map
new file mode 100644
index 0000000..b6db30c
--- /dev/null
+++ b/node_modules/@tensorflow/tfjs-core/dist/device_util.js.map
@@ -0,0 +1 @@
+{"version":3,"file":"device_util.js","sourceRoot":"","sources":["../src/device_util.ts"],"names":[],"mappings":";;AAiBA;IAEE,IAAM,CAAC,GAAG,SAAS,CAAC,SAAS,IAAI,SAAS,CAAC,MAAM,IAAK,MAAc,CAAC,KAAK,CAAC;IAE3E,OAAO,0TAA0T;SACrT,IAAI,CAAC,CAAC,CAAC;QAEf,ykDAAykD;aACpkD,IAAI,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC;AAChC,CAAC;AATD,4BASC"}
\ No newline at end of file
diff --git a/node_modules/@tensorflow/tfjs-core/dist/engine.d.ts b/node_modules/@tensorflow/tfjs-core/dist/engine.d.ts
new file mode 100644
index 0000000..f804d07
--- /dev/null
+++ b/node_modules/@tensorflow/tfjs-core/dist/engine.d.ts
@@ -0,0 +1,73 @@
+import { BackendTimingInfo, KernelBackend } from './kernels/backend';
+import { DataId, Tensor, Tensor3D, Variable } from './tensor';
+import { NamedTensorMap, NamedVariableMap, TensorContainer } from './tensor_types';
+import { TypedArray } from './types';
+export declare type ForwardFunc = (backend: KernelBackend, save?: (tensor: S) => S) => T;
+export declare type CustomGradientFunc = (...args: Tensor[]) => {
+ value: T;
+ gradFunc: (dy: T) => Tensor | Tensor[];
+};
+export declare type MemoryInfo = {
+ numTensors: number;
+ numDataBuffers: number;
+ numBytes: number;
+ unreliable?: boolean;
+};
+export interface TimingInfo extends BackendTimingInfo {
+ wallMs: number;
+}
+export declare type ScopeFn = () => T;
+export interface TensorManager {
+ registerTensor(a: Tensor): void;
+ registerVariable(v: Variable): void;
+ disposeTensor(a: Tensor): void;
+ memory(): {
+ numDataBuffers: number;
+ numBytes: number;
+ };
+}
+export declare class Engine implements TensorManager {
+ private backend;
+ safeMode: boolean;
+ private debugMode;
+ registeredVariables: NamedVariableMap;
+ private refCounter;
+ private nextTapeNodeId;
+ private numBytes;
+ private numTensors;
+ private numDataBuffers;
+ private activeTape;
+ private gradientScopeCount;
+ private customGradientDepth;
+ private activeScope;
+ private scopeStack;
+ private keepTensors;
+ private profiler;
+ constructor(backend: KernelBackend, safeMode: boolean, debugMode: () => boolean);
+ tidy(nameOrFn: string | ScopeFn, fn?: ScopeFn, gradMode?: boolean): T;
+ private scopedRun;
+ runKernel(forwardFunc: ForwardFunc, inputs: I, backwardsFunc?: (dy: T, saved: Tensor[]) => {
+ [P in keyof I]: () => I[P];
+ }): T;
+ registerTensor(a: Tensor | Variable): void;
+ registerVariable(v: Variable): void;
+ disposeTensor(a: Tensor): void;
+ disposeVariables(): void;
+ memory(): MemoryInfo;
+ private shouldRecord;
+ private addTapeNode;
+ keep(result: T): T;
+ startScope(name?: string, gradientsMode?: boolean): void;
+ endScope(result?: TensorContainer, gradientsMode?: boolean): void;
+ gradients(f: () => T, xs: Tensor[], dy?: T, allowNoGradients?: boolean): {
+ value: T;
+ grads: Tensor[];
+ };
+ customGrad(f: CustomGradientFunc): (...args: Tensor[]) => T;
+ write(dataId: DataId, values: TypedArray): void;
+ readSync(dataId: DataId): TypedArray;
+ read(dataId: DataId): Promise;
+ fromPixels(pixels: ImageData | HTMLImageElement | HTMLCanvasElement | HTMLVideoElement, numChannels: number): Tensor3D;
+ time(query: () => void): Promise;
+ private track;
+}
diff --git a/node_modules/@tensorflow/tfjs-core/dist/engine.js b/node_modules/@tensorflow/tfjs-core/dist/engine.js
new file mode 100644
index 0000000..54adb70
--- /dev/null
+++ b/node_modules/@tensorflow/tfjs-core/dist/engine.js
@@ -0,0 +1,376 @@
+"use strict";
+var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
+ return new (P || (P = Promise))(function (resolve, reject) {
+ function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
+ function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
+ function step(result) { result.done ? resolve(result.value) : new P(function (resolve) { resolve(result.value); }).then(fulfilled, rejected); }
+ step((generator = generator.apply(thisArg, _arguments || [])).next());
+ });
+};
+var __generator = (this && this.__generator) || function (thisArg, body) {
+ var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;
+ return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
+ function verb(n) { return function (v) { return step([n, v]); }; }
+ function step(op) {
+ if (f) throw new TypeError("Generator is already executing.");
+ while (_) try {
+ if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;
+ if (y = 0, t) op = [op[0] & 2, t.value];
+ switch (op[0]) {
+ case 0: case 1: t = op; break;
+ case 4: _.label++; return { value: op[1], done: false };
+ case 5: _.label++; y = op[1]; op = [0]; continue;
+ case 7: op = _.ops.pop(); _.trys.pop(); continue;
+ default:
+ if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }
+ if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }
+ if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }
+ if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }
+ if (t[2]) _.ops.pop();
+ _.trys.pop(); continue;
+ }
+ op = body.call(thisArg, _);
+ } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }
+ if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };
+ }
+};
+Object.defineProperty(exports, "__esModule", { value: true });
+var profiler_1 = require("./profiler");
+var tape_1 = require("./tape");
+var tensor_1 = require("./tensor");
+var tensor_util_1 = require("./tensor_util");
+var util = require("./util");
+var util_1 = require("./util");
+var Engine = (function () {
+ function Engine(backend, safeMode, debugMode) {
+ this.backend = backend;
+ this.safeMode = safeMode;
+ this.debugMode = debugMode;
+ this.registeredVariables = {};
+ this.refCounter = new WeakMap();
+ this.nextTapeNodeId = 0;
+ this.numBytes = 0;
+ this.numTensors = 0;
+ this.numDataBuffers = 0;
+ this.gradientScopeCount = 0;
+ this.customGradientDepth = 0;
+ this.keepTensors = new Set();
+ this.activeScope = { track: [], name: 'default scope' };
+ this.scopeStack = [this.activeScope];
+ this.profiler = new profiler_1.Profiler(backend);
+ }
+ Engine.prototype.tidy = function (nameOrFn, fn, gradMode) {
+ var _this = this;
+ if (gradMode === void 0) { gradMode = false; }
+ var name = null;
+ if (fn == null) {
+ if (typeof nameOrFn !== 'function') {
+ throw new Error('Please provide a function to tidy()');
+ }
+ fn = nameOrFn;
+ }
+ else {
+ if (typeof nameOrFn !== 'string' && !(nameOrFn instanceof String)) {
+ throw new Error('When calling with two arguments, the first argument ' +
+ 'to tidy() must be a string');
+ }
+ if (typeof fn !== 'function') {
+ throw new Error('When calling with two arguments, the 2nd argument ' +
+ 'to tidy() must be a function');
+ }
+ name = nameOrFn;
+ }
+ var result;
+ return this.scopedRun(function () { return _this.startScope(name, gradMode); }, function () { return _this.endScope(result, gradMode); }, function () {
+ result = fn();
+ if (result instanceof Promise) {
+ console.error('Cannot return a Promise inside of tidy.');
+ }
+ return result;
+ });
+ };
+ Engine.prototype.scopedRun = function (start, end, f) {
+ start();
+ try {
+ var res = f();
+ end();
+ return res;
+ }
+ catch (ex) {
+ end();
+ throw ex;
+ }
+ };
+ Engine.prototype.runKernel = function (forwardFunc, inputs, backwardsFunc) {
+ var _this = this;
+ var result;
+ var saved = [];
+ var saveFunc = function (x) {
+ saved.push(x);
+ return x;
+ };
+ var scopeName = this.activeScope.name;
+ this.scopedRun(function () { return _this.customGradientDepth++; }, function () { return _this.customGradientDepth--; }, function () {
+ if (!_this.debugMode()) {
+ result = forwardFunc(_this.backend, saveFunc);
+ }
+ else {
+ result = _this.profiler.profileKernel(scopeName, function () { return forwardFunc(_this.backend, saveFunc); });
+ }
+ });
+ if (this.shouldRecord()) {
+ var tapeNode = {
+ id: this.nextTapeNodeId++,
+ name: scopeName,
+ inputs: inputs,
+ output: Array.isArray(result) ? result[0] : result
+ };
+ if (backwardsFunc != null) {
+ tapeNode.gradient =
+ (function (dy) { return backwardsFunc(dy, saved); });
+ }
+ this.activeTape.push(tapeNode);
+ }
+ return result;
+ };
+ Engine.prototype.registerTensor = function (a) {
+ var refCount = this.refCounter.has(a.dataId) ? this.refCounter.get(a.dataId) : 0;
+ this.numTensors++;
+ if (refCount === 0) {
+ this.numDataBuffers++;
+ this.numBytes +=
+ util.sizeFromShape(a.shape) * util.bytesPerElement(a.dtype);
+ this.backend.register(a.dataId, a.shape, a.dtype);
+ }
+ this.refCounter.set(a.dataId, refCount + 1);
+ if (!(a instanceof tensor_1.Variable)) {
+ this.track(a);
+ }
+ };
+ Engine.prototype.registerVariable = function (v) {
+ if (this.registeredVariables[v.name] != null) {
+ throw new Error("Variable with name " + v.name + " was already registered");
+ }
+ this.registeredVariables[v.name] = v;
+ };
+ Engine.prototype.disposeTensor = function (a) {
+ if (!this.refCounter.has(a.dataId)) {
+ return;
+ }
+ if (this.keepTensors.has(a.id)) {
+ this.keepTensors.delete(a.id);
+ }
+ this.numTensors--;
+ var refCount = this.refCounter.get(a.dataId);
+ if (refCount <= 1) {
+ this.refCounter.delete(a.dataId);
+ this.backend.disposeData(a.dataId);
+ this.numDataBuffers--;
+ this.numBytes -=
+ util.sizeFromShape(a.shape) * util.bytesPerElement(a.dtype);
+ }
+ else {
+ this.refCounter.set(a.dataId, refCount - 1);
+ }
+ };
+ Engine.prototype.disposeVariables = function () {
+ for (var varName in this.registeredVariables) {
+ var v = this.registeredVariables[varName];
+ this.disposeTensor(v);
+ delete this.registeredVariables[varName];
+ }
+ };
+ Engine.prototype.memory = function () {
+ var info = this.backend.memory();
+ info.numTensors = this.numTensors;
+ info.numDataBuffers = this.numDataBuffers;
+ info.numBytes = this.numBytes;
+ return info;
+ };
+ Engine.prototype.shouldRecord = function () {
+ return this.activeTape != null && this.customGradientDepth === 0;
+ };
+ Engine.prototype.addTapeNode = function (inputs, result, gradientsFunc) {
+ var inputsMap = {};
+ inputs.forEach(function (input, idx) {
+ inputsMap[idx] = input;
+ });
+ var gradient = function (dy) {
+ var res = gradientsFunc(dy);
+ var resMap = {};
+ res.forEach(function (r, idx) {
+ resMap[idx] = function () { return r; };
+ });
+ return resMap;
+ };
+ var tapeNode = {
+ id: this.nextTapeNodeId++,
+ name: this.activeScope.name,
+ inputs: inputsMap,
+ output: result,
+ gradient: gradient
+ };
+ this.activeTape.push(tapeNode);
+ };
+ Engine.prototype.keep = function (result) {
+ if (this.scopeStack.length === 1 && this.safeMode) {
+ throw new Error('Safe mode is ON. Enclose all tensor operations inside tf.tidy(): ' +
+ 'tf.tidy(() => {...}) to avoid memory leaks.');
+ }
+ this.keepTensors.add(result.id);
+ return result;
+ };
+ Engine.prototype.startScope = function (name, gradientsMode) {
+ if (gradientsMode === void 0) { gradientsMode = false; }
+ if (gradientsMode && this.gradientScopeCount === 0) {
+ this.activeTape = [];
+ }
+ if (gradientsMode) {
+ this.gradientScopeCount++;
+ }
+ var scopeInfo = { track: [], name: 'unnamed scope' };
+ if (name) {
+ scopeInfo.name = name;
+ }
+ this.scopeStack.push(scopeInfo);
+ this.activeScope = scopeInfo;
+ };
+ Engine.prototype.endScope = function (result, gradientsMode) {
+ var _this = this;
+ if (gradientsMode === void 0) { gradientsMode = false; }
+ if (gradientsMode) {
+ this.gradientScopeCount--;
+ if (this.gradientScopeCount === 0) {
+ this.activeTape = null;
+ }
+ }
+ var tensorsToKeep = new Set(this.keepTensors);
+ var tensorsToTrackInParent = tensor_util_1.getTensorsInContainer(result);
+ tensorsToTrackInParent.forEach(function (tensor) { return tensorsToKeep.add(tensor.id); });
+ for (var i = 0; i < this.activeScope.track.length; i++) {
+ var tensor = this.activeScope.track[i];
+ if (tensorsToKeep.has(tensor.id)) {
+ continue;
+ }
+ if (this.activeTape != null) {
+ tensorsToTrackInParent.push(tensor);
+ }
+ else {
+ tensor.dispose();
+ }
+ }
+ var oldScope = this.scopeStack.pop();
+ this.activeScope = this.scopeStack.length === 0 ?
+ { track: [], name: 'default scope' } :
+ this.scopeStack[this.scopeStack.length - 1];
+ tensorsToTrackInParent.forEach(function (tensor) {
+ if (!_this.keepTensors.has(tensor.id) &&
+ tensor_util_1.isTensorInList(tensor, oldScope.track)) {
+ _this.track(tensor);
+ }
+ });
+ };
+ Engine.prototype.gradients = function (f, xs, dy, allowNoGradients) {
+ var _this = this;
+ if (allowNoGradients === void 0) { allowNoGradients = false; }
+ util.assert(xs.length > 0, 'gradients() received an empty list of xs.');
+ return this.tidy('gradients', function () {
+ var y = f();
+ util.assert(y instanceof tensor_1.Tensor, 'The result y returned by f() must be a tensor.');
+ var filteredTape = tape_1.getFilteredNodesXToY(_this.activeTape, xs, y);
+ if (!allowNoGradients && filteredTape.length === 0 && xs.length > 0) {
+ throw new Error('Cannot compute gradient of y=f(x) with respect to x. Make sure ' +
+ 'that the f you passed encloses all operations that lead from x ' +
+ 'to y.');
+ }
+ var accumulatedGradientMap = {};
+ accumulatedGradientMap[y.id] = (dy == null) ? ones(y.shape) : dy;
+ tape_1.backpropagateGradients(accumulatedGradientMap, filteredTape);
+ var grads = xs.map(function (x) { return accumulatedGradientMap[x.id]; });
+ return { value: y, grads: grads };
+ }, true);
+ };
+ Engine.prototype.customGrad = function (f) {
+ var _this = this;
+ util.assert(util.isFunction(f), 'The f passed in customGrad(f) must be a function.');
+ return function () {
+ var inputs = [];
+ for (var _i = 0; _i < arguments.length; _i++) {
+ inputs[_i] = arguments[_i];
+ }
+ util.assert(inputs.every(function (t) { return t instanceof tensor_1.Tensor; }), 'The args passed in customGrad(f)(x1, x2,...) must all be tensors');
+ var gradientsFunc;
+ var result;
+ _this.scopedRun(function () { return _this.customGradientDepth++; }, function () { return _this.customGradientDepth--; }, function () {
+ var gradientsMode = true;
+ result = _this.tidy(f.name, function () {
+ var _a = f.apply(void 0, inputs), value = _a.value, gradFunc = _a.gradFunc;
+ util.assert(value instanceof tensor_1.Tensor, 'The function f passed in customGrad(f) must return an ' +
+ 'object where `obj.value` is a tensor');
+ util.assert(util.isFunction(gradFunc), 'The function f passed in customGrad(f) must return an ' +
+ 'object where `obj.gradFunc` is a function.');
+ gradientsFunc = gradFunc;
+ return value;
+ }, gradientsMode);
+ });
+ if (_this.shouldRecord()) {
+ var gradFunc = function (dy) {
+ var res = gradientsFunc(dy);
+ var grads = Array.isArray(res) ? res : [res];
+ util.assert(grads.length === inputs.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(...).');
+ util.assert(grads.every(function (t) { return t instanceof tensor_1.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.');
+ return grads;
+ };
+ _this.addTapeNode(inputs, result, gradFunc);
+ }
+ return result;
+ };
+ };
+ Engine.prototype.write = function (dataId, values) {
+ this.backend.write(dataId, values);
+ };
+ Engine.prototype.readSync = function (dataId) {
+ return this.backend.readSync(dataId);
+ };
+ Engine.prototype.read = function (dataId) {
+ return this.backend.read(dataId);
+ };
+ Engine.prototype.fromPixels = function (pixels, numChannels) {
+ return this.backend.fromPixels(pixels, numChannels);
+ };
+ Engine.prototype.time = function (query) {
+ return __awaiter(this, void 0, void 0, function () {
+ var start, timingInfo;
+ return __generator(this, function (_a) {
+ switch (_a.label) {
+ case 0:
+ start = util_1.now();
+ return [4, this.backend.time(query)];
+ case 1:
+ timingInfo = _a.sent();
+ timingInfo.wallMs = util_1.now() - start;
+ return [2, timingInfo];
+ }
+ });
+ });
+ };
+ Engine.prototype.track = function (result) {
+ if (this.scopeStack.length === 1 && this.safeMode) {
+ throw new Error('Safe mode is ON. Enclose all tensor operations inside tf.tidy(): ' +
+ 'tf.tidy(() => {op();...}); to avoid memory leaks.');
+ }
+ this.activeScope.track.push(result);
+ return result;
+ };
+ return Engine;
+}());
+exports.Engine = Engine;
+function ones(shape) {
+ var values = util_1.makeOnesTypedArray(util_1.sizeFromShape(shape), 'float32');
+ return tensor_1.Tensor.make(shape, { values: values });
+}
+//# sourceMappingURL=engine.js.map
\ No newline at end of file
diff --git a/node_modules/@tensorflow/tfjs-core/dist/engine.js.map b/node_modules/@tensorflow/tfjs-core/dist/engine.js.map
new file mode 100644
index 0000000..f315c3f
--- /dev/null
+++ b/node_modules/@tensorflow/tfjs-core/dist/engine.js.map
@@ -0,0 +1 @@
+{"version":3,"file":"engine.js","sourceRoot":"","sources":["../src/engine.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAkBA,uCAAoC;AACpC,+BAAgG;AAChG,mCAA4D;AAE5D,6CAAoE;AAEpE,6BAA+B;AAC/B,+BAA8D;AAyC9D;IAoBE,gBACY,OAAsB,EAAS,QAAiB,EAChD,SAAwB;QADxB,YAAO,GAAP,OAAO,CAAe;QAAS,aAAQ,GAAR,QAAQ,CAAS;QAChD,cAAS,GAAT,SAAS,CAAe;QApBpC,wBAAmB,GAAqB,EAAE,CAAC;QAEnC,eAAU,GAAG,IAAI,OAAO,EAAkB,CAAC;QAC3C,mBAAc,GAAG,CAAC,CAAC;QACnB,aAAQ,GAAG,CAAC,CAAC;QACb,eAAU,GAAG,CAAC,CAAC;QACf,mBAAc,GAAG,CAAC,CAAC;QAGnB,uBAAkB,GAAG,CAAC,CAAC;QACvB,wBAAmB,GAAG,CAAC,CAAC;QAKxB,gBAAW,GAAgB,IAAI,GAAG,EAAE,CAAC;QAO3C,IAAI,CAAC,WAAW,GAAG,EAAC,KAAK,EAAE,EAAE,EAAE,IAAI,EAAE,eAAe,EAAC,CAAC;QACtD,IAAI,CAAC,UAAU,GAAG,CAAC,IAAI,CAAC,WAAW,CAAC,CAAC;QACrC,IAAI,CAAC,QAAQ,GAAG,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IAAI,CAAC,UAAU,CAAC,MAAM,KAAK,CAAC,IAAI,IAAI,CAAC,QAAQ,EAAE;YACjD,MAAM,IAAI,KAAK,CACX,mEAAmE;gBACnE,mDAAmD,CAAC,CAAC;SAC1D;QACD,IAAI,CAAC,WAAW,CAAC,KAAK,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC;QACpC,OAAO,MAAM,CAAC;IAChB,CAAC;IACH,aAAC;AAAD,CAAC,AAtaD,IAsaC;AAtaY,wBAAM;AAwanB,cAAc,KAAe;IAC3B,IAAM,MAAM,GAAG,yBAAkB,CAAC,oBAAa,CAAC,KAAK,CAAC,EAAE,SAAS,CAAC,CAAC;IACnE,OAAO,eAAM,CAAC,IAAI,CAAC,KAAK,EAAE,EAAC,MAAM,QAAA,EAAC,CAAC,CAAC;AACtC,CAAC"}
\ No newline at end of file
diff --git a/node_modules/@tensorflow/tfjs-core/dist/engine_test.d.ts b/node_modules/@tensorflow/tfjs-core/dist/engine_test.d.ts
new file mode 100644
index 0000000..cb0ff5c
--- /dev/null
+++ b/node_modules/@tensorflow/tfjs-core/dist/engine_test.d.ts
@@ -0,0 +1 @@
+export {};
diff --git a/node_modules/@tensorflow/tfjs-core/dist/engine_test.js b/node_modules/@tensorflow/tfjs-core/dist/engine_test.js
new file mode 100644
index 0000000..39f0fcc
--- /dev/null
+++ b/node_modules/@tensorflow/tfjs-core/dist/engine_test.js
@@ -0,0 +1,275 @@
+"use strict";
+Object.defineProperty(exports, "__esModule", { value: true });
+var tf = require("./index");
+var jasmine_util_1 = require("./jasmine_util");
+var test_util_1 = require("./test_util");
+jasmine_util_1.describeWithFlags('fromPixels + regular math op', test_util_1.WEBGL_ENVS, function () {
+ it('debug mode does not error when no nans', function () {
+ var pixels = new ImageData(2, 2);
+ for (var i = 0; i < 8; i++) {
+ pixels.data[i] = 100;
+ }
+ for (var i = 8; i < 16; i++) {
+ pixels.data[i] = 250;
+ }
+ var a = tf.fromPixels(pixels, 4);
+ var b = tf.scalar(20, 'int32');
+ var res = tf.add(a, b);
+ test_util_1.expectArraysEqual(res, [
+ 120, 120, 120, 120, 120, 120, 120, 120, 270, 270, 270, 270, 270, 270, 270,
+ 270
+ ]);
+ });
+});
+jasmine_util_1.describeWithFlags('gradients', test_util_1.ALL_ENVS, function () {
+ it('matmul + relu', function () {
+ var a = tf.tensor2d([-1, 2, -3, 10, -20, 30], [2, 3]);
+ var b = tf.tensor2d([2, -3, 4, -1, 2, -3], [3, 2]);
+ var _a = tf.grads(function (a, b) {
+ var m = tf.matMul(a, b);
+ var y = tf.relu(m);
+ return tf.sum(y);
+ })([a, b]), da = _a[0], db = _a[1];
+ var dedm = tf.step(tf.matMul(a, b));
+ expect(da.shape).toEqual(a.shape);
+ var transposeA = false;
+ var transposeB = true;
+ test_util_1.expectArraysClose(da, tf.matMul(dedm, b, transposeA, transposeB));
+ expect(db.shape).toEqual(b.shape);
+ transposeA = true;
+ transposeB = false;
+ test_util_1.expectArraysClose(db, tf.matMul(a, dedm, transposeA, transposeB));
+ });
+ it('grad(f)', function () {
+ var grad = tf.grad(function (x) { return x.square(); });
+ var result = grad(tf.tensor1d([.1, .2]));
+ test_util_1.expectArraysClose(result, [.2, .4]);
+ });
+ it('calling grad(f) twice works', function () {
+ var grad = tf.grad(function (x) { return x.square(); });
+ var result = grad(tf.tensor1d([.1, .2]));
+ var result2 = grad(tf.tensor1d([.1, .4]));
+ test_util_1.expectArraysClose(result, [.2, .4]);
+ test_util_1.expectArraysClose(result2, [.2, .8]);
+ });
+ it('grads(f)', function () {
+ var grads = tf.grads(function (x) { return x.square(); });
+ var result = grads([tf.tensor1d([.1, .2])]);
+ test_util_1.expectArraysClose(result[0], [.2, .4]);
+ });
+ it('calling grads(f) twice works', function () {
+ var grads = tf.grads(function (x) { return x.square(); });
+ var result = grads([tf.tensor1d([.1, .2])]);
+ var result2 = grads([tf.tensor1d([.1, .4])]);
+ test_util_1.expectArraysClose(result[0], [.2, .4]);
+ test_util_1.expectArraysClose(result2[0], [.2, .8]);
+ });
+ it('works with reshape', function () {
+ var a = tf.tensor2d([1, 2, 3, 4], [2, 2]);
+ var exponent = tf.tensor1d([2, 2, 2, 2], 'int32');
+ var da = tf.grad(function (a) {
+ var b = a.flatten();
+ var m = tf.pow(b, exponent);
+ return tf.sum(m);
+ })(a);
+ expect(da.shape).toEqual([2, 2]);
+ test_util_1.expectArraysClose(da, [2, 4, 6, 8]);
+ });
+ it('reshape outside tf.grads() throws error', function () {
+ var a = tf.tensor2d([1, 2, 3, 4], [2, 2]);
+ var b = a.flatten();
+ var exponent = tf.tensor1d([2, 2, 2, 2], 'int32');
+ var f = function () {
+ tf.grads(function (a, b) {
+ var m = tf.pow(b, exponent);
+ return tf.sum(m);
+ })([a, b]);
+ };
+ expect(f).toThrowError();
+ });
+ it('does not error if irrelevant (pruned) ops are missing grads', function () {
+ var a = tf.tensor1d([true, true], 'bool');
+ var b = tf.tensor1d([false, true], 'bool');
+ var da = tf.grad(function (a) {
+ a.logicalAnd(b);
+ return a.sum();
+ })(a);
+ test_util_1.expectArraysClose(da, [1, 1]);
+ });
+ it('errors if relevant ops are missing grads', function () {
+ var a = tf.tensor1d([true, true], 'bool');
+ var b = tf.tensor1d([false, true], 'bool');
+ var dfda = tf.grad(function (a) {
+ return a.logicalAnd(b);
+ });
+ expect(function () { return dfda(a); }).toThrowError();
+ });
+ it('works with asType', function () {
+ var a = tf.tensor2d([1, 2, 3, 4], [2, 2], 'int32');
+ var exponent = tf.tensor2d([2, 2, 2, 2], [2, 2], 'int32');
+ var da = tf.grad(function (a) {
+ var b = a.toFloat();
+ var m = tf.pow(b, exponent);
+ return tf.sum(m);
+ })(a);
+ expect(da.shape).toEqual([2, 2]);
+ expect(da.dtype).toEqual('float32');
+ test_util_1.expectArraysClose(da, [2, 4, 6, 8]);
+ });
+ it('asType outside of tf.grads() throws error', function () {
+ var a = tf.tensor2d([1, 2, 3, 4], [2, 2], 'int32');
+ var b = a.toFloat();
+ var exponent = tf.tensor2d([2, 2, 2, 2], [2, 2], 'int32');
+ var f = function () {
+ tf.grad(function (a) {
+ var m = tf.pow(b, exponent);
+ return tf.sum(m);
+ })(a);
+ };
+ expect(f).toThrowError();
+ });
+});
+jasmine_util_1.describeWithFlags('valueAndGradients', test_util_1.ALL_ENVS, function () {
+ it('matmul + relu', function () {
+ var a = tf.tensor2d([-1, 2, -3, 10, -20, 30], [2, 3]);
+ var b = tf.tensor2d([2, -3, 4, -1, 2, -3], [3, 2]);
+ var _a = tf.valueAndGrads(function (a, b) {
+ var m = tf.matMul(a, b);
+ var y = tf.relu(m);
+ return tf.sum(y);
+ })([a, b]), value = _a.value, grads = _a.grads;
+ test_util_1.expectNumbersClose(value.get(), 10);
+ var dedm = tf.step(tf.matMul(a, b));
+ var da = grads[0], db = grads[1];
+ var transposeA = false;
+ var transposeB = true;
+ test_util_1.expectArraysClose(da, tf.matMul(dedm, b, transposeA, transposeB));
+ transposeA = true;
+ transposeB = false;
+ test_util_1.expectArraysClose(db, tf.matMul(a, dedm, transposeA, transposeB));
+ });
+ it('matmul + relu + inner tidy', function () {
+ var a = tf.tensor2d([-1, 2, -3, 10, -20, 30], [2, 3]);
+ var b = tf.tensor2d([2, -3, 4, -1, 2, -3], [3, 2]);
+ var _a = tf.valueAndGrads(function (a, b) {
+ var m = tf.matMul(a, b);
+ return tf.tidy(function () {
+ var y = tf.relu(m);
+ return tf.sum(y);
+ });
+ })([a, b]), value = _a.value, grads = _a.grads;
+ test_util_1.expectNumbersClose(value.get(), 10);
+ var dedm = tf.step(tf.matMul(a, b));
+ var da = grads[0], db = grads[1];
+ var transposeA = false;
+ var transposeB = true;
+ test_util_1.expectArraysClose(da, tf.matMul(dedm, b, transposeA, transposeB));
+ transposeA = true;
+ transposeB = false;
+ test_util_1.expectArraysClose(db, tf.matMul(a, dedm, transposeA, transposeB));
+ });
+});
+jasmine_util_1.describeWithFlags('higher-order gradients', test_util_1.ALL_ENVS, function () {
+ it('grad(grad(f))', function () {
+ var gradgrad = tf.grad(tf.grad(function (x) { return x.mul(x).mul(x); }));
+ var result = gradgrad(tf.tensor1d([.1, .2]));
+ test_util_1.expectArraysClose(result, [.6, 1.2]);
+ });
+ it('grads(grads(f))', function () {
+ var grads = tf.grads(function (x) { return x.mul(x).mul(x); });
+ var gradsgrads = tf.grads(function (x) { return grads([x])[0]; });
+ var result = gradsgrads([tf.tensor1d([.1, .2])]);
+ test_util_1.expectArraysClose(result[0], [.6, 1.2]);
+ });
+});
+jasmine_util_1.describeWithFlags('customGradient', test_util_1.ALL_ENVS, function () {
+ it('basic', function () {
+ var a = tf.scalar(3);
+ var b = tf.scalar(2, 'int32');
+ var dy = tf.scalar(4);
+ var customPow = tf.customGrad(function (a) {
+ var value = tf.pow(a, b);
+ var gradFunc = function (dy) { return dy.mul(tf.scalar(0.1)); };
+ return { value: value, gradFunc: gradFunc };
+ });
+ var _a = tf.valueAndGrad(function (a) { return customPow(a); })(a, dy), value = _a.value, grad = _a.grad;
+ expect(value.shape).toEqual(a.shape);
+ test_util_1.expectArraysClose(value, [9]);
+ expect(grad.shape).toEqual(a.shape);
+ test_util_1.expectArraysClose(grad, [.4]);
+ });
+ it('second order derivative through customGradient', function () {
+ var a = tf.scalar(3);
+ var b = tf.scalar(2, 'int32');
+ var dy = tf.scalar(5);
+ var customPow = tf.customGrad(function (a) {
+ var value = tf.pow(a, b);
+ var gradFunc = function (dy) { return dy.mul(a); };
+ return { value: value, gradFunc: gradFunc };
+ });
+ var dda = tf.grad(tf.grad(function (a) { return customPow(a); }))(a, dy);
+ expect(dda.shape).toEqual(a.shape);
+ test_util_1.expectArraysClose(dda, dy);
+ });
+ it('calling gradient of custom op twice works', function () {
+ var customOp = tf.customGrad(function (x) {
+ return { value: x.square(), gradFunc: function (dy) { return dy.mul(x.abs()); } };
+ });
+ var x = tf.tensor1d([-1, -2, 3]);
+ var grad = tf.grad(function (x) { return customOp(x); });
+ test_util_1.expectArraysClose(grad(x), [1, 2, 3]);
+ test_util_1.expectArraysClose(grad(x), [1, 2, 3]);
+ });
+});
+jasmine_util_1.describeWithFlags('memory', test_util_1.ALL_ENVS, function () {
+ it('Sum(float)', function () {
+ expect(tf.memory().numTensors).toBe(0);
+ expect(tf.memory().numBytes).toBe(0);
+ var sum = tf.tidy(function () {
+ var a = tf.tensor1d([1, 2, 3, 4]);
+ expect(tf.memory().numTensors).toBe(1);
+ expect(tf.memory().numBytes).toBe(4 * 4);
+ return a.sum();
+ });
+ expect(tf.memory().numTensors).toBe(1);
+ expect(tf.memory().numBytes).toBe(4);
+ test_util_1.expectArraysClose(sum, [1 + 2 + 3 + 4]);
+ });
+ it('Sum(bool)', function () {
+ var sum = tf.tidy(function () {
+ var a = tf.tensor1d([true, true, false, true], 'bool');
+ expect(tf.memory().numTensors).toBe(1);
+ expect(tf.memory().numBytes).toBe(4);
+ return a.sum();
+ });
+ expect(tf.memory().numTensors).toBe(1);
+ expect(tf.memory().numBytes).toBe(4);
+ expect(sum.dtype).toBe('int32');
+ test_util_1.expectArraysClose(sum, [1 + 1 + 0 + 1]);
+ });
+ it('Sum(int32)', function () {
+ var sum = tf.tidy(function () {
+ var a = tf.tensor1d([1, 1, 0, 1], 'int32');
+ expect(tf.memory().numTensors).toBe(1);
+ expect(tf.memory().numBytes).toBe(4 * 4);
+ return a.sum();
+ });
+ expect(tf.memory().numTensors).toBe(1);
+ expect(tf.memory().numBytes).toBe(4);
+ expect(sum.dtype).toBe('int32');
+ test_util_1.expectArraysClose(sum, [1 + 1 + 0 + 1]);
+ });
+});
+jasmine_util_1.describeWithFlags('disposeVariables', test_util_1.ALL_ENVS, function () {
+ it('reuse same name variable', function () {
+ tf.tensor1d([1, 2, 3]).variable(true, 'v1');
+ tf.tensor1d([1, 2, 3]).variable(true, 'v2');
+ expect(function () {
+ tf.tensor1d([1, 2, 3]).variable(true, 'v1');
+ }).toThrowError();
+ tf.disposeVariables();
+ tf.tensor1d([1, 2, 3]).variable(true, 'v1');
+ tf.tensor1d([1, 2, 3]).variable(true, 'v2');
+ });
+});
+//# sourceMappingURL=engine_test.js.map
\ No newline at end of file
diff --git a/node_modules/@tensorflow/tfjs-core/dist/engine_test.js.map b/node_modules/@tensorflow/tfjs-core/dist/engine_test.js.map
new file mode 100644
index 0000000..1a2c259
--- /dev/null
+++ b/node_modules/@tensorflow/tfjs-core/dist/engine_test.js.map
@@ -0,0 +1 @@
+{"version":3,"file":"engine_test.js","sourceRoot":"","sources":["../src/engine_test.ts"],"names":[],"mappings":";;AAiBA,4BAA8B;AAC9B,+CAAiD;AACjD,yCAA2G;AAE3G,gCAAiB,CAAC,8BAA8B,EAAE,sBAAU,EAAE;IAC5D,EAAE,CAAC,wCAAwC,EAAE;QAC3C,IAAM,MAAM,GAAG,IAAI,SAAS,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC;QACnC,KAAK,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,CAAC,EAAE,CAAC,EAAE,EAAE;YAC1B,MAAM,CAAC,IAAI,CAAC,CAAC,CAAC,GAAG,GAAG,CAAC;SACtB;QACD,KAAK,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,EAAE,EAAE,CAAC,EAAE,EAAE;YAC3B,MAAM,CAAC,IAAI,CAAC,CAAC,CAAC,GAAG,GAAG,CAAC;SACtB;QAED,IAAM,CAAC,GAAG,EAAE,CAAC,UAAU,CAAC,MAAM,EAAE,CAAC,CAAC,CAAC;QACnC,IAAM,CAAC,GAAG,EAAE,CAAC,MAAM,CAAC,EAAE,EAAE,OAAO,CAAC,CAAC;QAEjC,IAAM,GAAG,GAAG,EAAE,CAAC,GAAG,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC;QAEzB,6BAAiB,CAAC,GAAG,EAAE;YACrB,GAAG,EAAE,GAAG,EAAE,GAAG,EAAE,GAAG,EAAE,GAAG,EAAE,GAAG,EAAE,GAAG,EAAE,GAAG,EAAE,GAAG,EAAE,GAAG,EAAE,GAAG,EAAE,GAAG,EAAE,GAAG,EAAE,GAAG,EAAE,GAAG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CAAC;AACL,CAAC,CAAC,CAAC"}
\ No newline at end of file
diff --git a/node_modules/@tensorflow/tfjs-core/dist/environment.d.ts b/node_modules/@tensorflow/tfjs-core/dist/environment.d.ts
new file mode 100644
index 0000000..b7a032a
--- /dev/null
+++ b/node_modules/@tensorflow/tfjs-core/dist/environment.d.ts
@@ -0,0 +1,35 @@
+import { Engine, MemoryInfo, ScopeFn, TimingInfo } from './engine';
+import { Features } from './environment_util';
+import { KernelBackend } from './kernels/backend';
+import { Tensor, TensorTracker } from './tensor';
+import { TensorContainer } from './tensor_types';
+export declare class Environment {
+ private features;
+ private globalEngine;
+ private registry;
+ backendName: string;
+ backend: KernelBackend;
+ constructor(features?: Features);
+ static setBackend(backendName: string, safeMode?: boolean): void;
+ static getBackend(): string;
+ static disposeVariables(): void;
+ static memory(): MemoryInfo;
+ static tidy(nameOrFn: string | ScopeFn, fn?: ScopeFn, gradMode?: boolean): T;
+ static dispose(container: TensorContainer): void;
+ static keep(result: T): T;
+ static time(f: () => void): Promise;
+ get(feature: K): Features[K];
+ getFeatures(): Features;
+ set(feature: K, value: Features[K]): void;
+ private getBestBackendName;
+ private evaluateFeature;
+ setFeatures(features: Features): void;
+ reset(): void;
+ private initBackend;
+ findBackend(name: string): KernelBackend;
+ registerBackend(name: string, factory: () => KernelBackend, priority?: number, setTensorTrackerFn?: (f: () => TensorTracker) => void): boolean;
+ removeBackend(name: string): void;
+ readonly engine: Engine;
+ private initDefaultBackend;
+}
+export declare let ENV: Environment;
diff --git a/node_modules/@tensorflow/tfjs-core/dist/environment.js b/node_modules/@tensorflow/tfjs-core/dist/environment.js
new file mode 100644
index 0000000..2f60d1c
--- /dev/null
+++ b/node_modules/@tensorflow/tfjs-core/dist/environment.js
@@ -0,0 +1,233 @@
+"use strict";
+Object.defineProperty(exports, "__esModule", { value: true });
+var device_util = require("./device_util");
+var engine_1 = require("./engine");
+var environment_util_1 = require("./environment_util");
+var tensor_1 = require("./tensor");
+var tensor_util_1 = require("./tensor_util");
+var TEST_EPSILON_FLOAT32_ENABLED = 1e-3;
+var TEST_EPSILON_FLOAT32_DISABLED = 1e-1;
+var Environment = (function () {
+ function Environment(features) {
+ this.features = {};
+ this.registry = {};
+ if (features != null) {
+ this.features = features;
+ }
+ if (this.get('DEBUG')) {
+ 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.');
+ }
+ }
+ Environment.setBackend = function (backendName, safeMode) {
+ if (safeMode === void 0) { safeMode = false; }
+ if (!(backendName in exports.ENV.registry)) {
+ throw new Error("Backend name '" + backendName + "' not found in registry");
+ }
+ exports.ENV.initBackend(backendName, safeMode);
+ };
+ Environment.getBackend = function () {
+ exports.ENV.initDefaultBackend();
+ return exports.ENV.backendName;
+ };
+ Environment.disposeVariables = function () {
+ exports.ENV.engine.disposeVariables();
+ };
+ Environment.memory = function () {
+ return exports.ENV.engine.memory();
+ };
+ Environment.tidy = function (nameOrFn, fn, gradMode) {
+ if (gradMode === void 0) { gradMode = false; }
+ return exports.ENV.engine.tidy(nameOrFn, fn, gradMode);
+ };
+ Environment.dispose = function (container) {
+ var tensors = tensor_util_1.getTensorsInContainer(container);
+ tensors.forEach(function (tensor) { return tensor.dispose(); });
+ };
+ Environment.keep = function (result) {
+ return exports.ENV.engine.keep(result);
+ };
+ Environment.time = function (f) {
+ return exports.ENV.engine.time(f);
+ };
+ Environment.prototype.get = function (feature) {
+ if (feature in this.features) {
+ return this.features[feature];
+ }
+ this.features[feature] = this.evaluateFeature(feature);
+ return this.features[feature];
+ };
+ Environment.prototype.getFeatures = function () {
+ return this.features;
+ };
+ Environment.prototype.set = function (feature, value) {
+ this.features[feature] = value;
+ };
+ Environment.prototype.getBestBackendName = function () {
+ var _this = this;
+ if (Object.keys(this.registry).length === 0) {
+ throw new Error('No backend found in registry.');
+ }
+ var sortedBackends = Object.keys(this.registry)
+ .map(function (name) {
+ return { name: name, entry: _this.registry[name] };
+ })
+ .sort(function (a, b) {
+ return b.entry.priority - a.entry.priority;
+ });
+ return sortedBackends[0].name;
+ };
+ Environment.prototype.evaluateFeature = function (feature) {
+ if (feature === 'DEBUG') {
+ return false;
+ }
+ else if (feature === 'IS_BROWSER') {
+ return typeof window !== 'undefined';
+ }
+ else if (feature === 'IS_NODE') {
+ return (typeof process !== 'undefined') &&
+ (typeof process.versions.node !== 'undefined');
+ }
+ else if (feature === 'IS_CHROME') {
+ return environment_util_1.isChrome();
+ }
+ else if (feature === 'IS_TEST') {
+ return false;
+ }
+ else if (feature === 'BACKEND') {
+ return this.getBestBackendName();
+ }
+ else if (feature === 'WEBGL_DISJOINT_QUERY_TIMER_EXTENSION_VERSION') {
+ var webGLVersion = this.get('WEBGL_VERSION');
+ if (webGLVersion === 0) {
+ return 0;
+ }
+ if (webGLVersion > 0) {
+ return 0;
+ }
+ return environment_util_1.getWebGLDisjointQueryTimerVersion(webGLVersion, this.get('IS_BROWSER'));
+ }
+ else if (feature === 'WEBGL_DISJOINT_QUERY_TIMER_EXTENSION_RELIABLE') {
+ return this.get('WEBGL_DISJOINT_QUERY_TIMER_EXTENSION_VERSION') > 0 &&
+ !device_util.isMobile();
+ }
+ else if (feature === 'HAS_WEBGL') {
+ return this.get('WEBGL_VERSION') > 0;
+ }
+ else if (feature === 'WEBGL_VERSION') {
+ if (environment_util_1.isWebGLVersionEnabled(2, this.get('IS_BROWSER'))) {
+ return 2;
+ }
+ else if (environment_util_1.isWebGLVersionEnabled(1, this.get('IS_BROWSER'))) {
+ return 1;
+ }
+ return 0;
+ }
+ else if (feature === 'WEBGL_RENDER_FLOAT32_ENABLED') {
+ return environment_util_1.isRenderToFloatTextureEnabled(this.get('WEBGL_VERSION'), this.get('IS_BROWSER'));
+ }
+ else if (feature === 'WEBGL_DOWNLOAD_FLOAT_ENABLED') {
+ return environment_util_1.isDownloadFloatTextureEnabled(this.get('WEBGL_VERSION'), this.get('IS_BROWSER'));
+ }
+ else if (feature === 'WEBGL_FENCE_API_ENABLED') {
+ return environment_util_1.isWebGLFenceEnabled(this.get('WEBGL_VERSION'), this.get('IS_BROWSER'));
+ }
+ else if (feature === 'TEST_EPSILON') {
+ if (this.get('WEBGL_RENDER_FLOAT32_ENABLED')) {
+ return TEST_EPSILON_FLOAT32_ENABLED;
+ }
+ return TEST_EPSILON_FLOAT32_DISABLED;
+ }
+ throw new Error("Unknown feature " + feature + ".");
+ };
+ Environment.prototype.setFeatures = function (features) {
+ this.features = Object.assign({}, features);
+ };
+ Environment.prototype.reset = function () {
+ this.features = environment_util_1.getFeaturesFromURL();
+ if (this.globalEngine != null) {
+ this.globalEngine = null;
+ }
+ };
+ Environment.prototype.initBackend = function (backendName, safeMode) {
+ var _this = this;
+ if (safeMode === void 0) { safeMode = false; }
+ this.backendName = backendName;
+ this.backend = this.findBackend(backendName);
+ this.globalEngine =
+ new engine_1.Engine(this.backend, safeMode, function () { return _this.get('DEBUG'); });
+ };
+ Environment.prototype.findBackend = function (name) {
+ if (!(name in this.registry)) {
+ return null;
+ }
+ return this.registry[name].backend;
+ };
+ Environment.prototype.registerBackend = function (name, factory, priority, setTensorTrackerFn) {
+ var _this = this;
+ if (priority === void 0) { priority = 1; }
+ if (name in this.registry) {
+ console.warn(name + " backend was already registered. Reusing existing backend");
+ if (setTensorTrackerFn != null) {
+ setTensorTrackerFn(function () { return _this.engine; });
+ }
+ return false;
+ }
+ try {
+ var backend = factory();
+ this.registry[name] = { backend: backend, priority: priority };
+ return true;
+ }
+ catch (err) {
+ console.warn("Registration of backend " + name + " failed");
+ console.warn(err.stack || err.message);
+ return false;
+ }
+ };
+ Environment.prototype.removeBackend = function (name) {
+ if (!(name in this.registry)) {
+ throw new Error(name + " backend not found in registry");
+ }
+ this.registry[name].backend.dispose();
+ delete this.registry[name];
+ };
+ Object.defineProperty(Environment.prototype, "engine", {
+ get: function () {
+ this.initDefaultBackend();
+ return this.globalEngine;
+ },
+ enumerable: true,
+ configurable: true
+ });
+ Environment.prototype.initDefaultBackend = function () {
+ if (this.globalEngine == null) {
+ this.initBackend(this.get('BACKEND'), false);
+ }
+ };
+ return Environment;
+}());
+exports.Environment = Environment;
+function getGlobalNamespace() {
+ var ns;
+ if (typeof (window) !== 'undefined') {
+ ns = window;
+ }
+ else if (typeof (process) !== 'undefined') {
+ ns = process;
+ }
+ else {
+ throw new Error('Could not find a global object');
+ }
+ return ns;
+}
+function getOrMakeEnvironment() {
+ var ns = getGlobalNamespace();
+ if (ns.ENV == null) {
+ ns.ENV = new Environment(environment_util_1.getFeaturesFromURL());
+ tensor_1.setTensorTracker(function () { return ns.ENV.engine; });
+ }
+ return ns.ENV;
+}
+exports.ENV = getOrMakeEnvironment();
+//# sourceMappingURL=environment.js.map
\ No newline at end of file
diff --git a/node_modules/@tensorflow/tfjs-core/dist/environment.js.map b/node_modules/@tensorflow/tfjs-core/dist/environment.js.map
new file mode 100644
index 0000000..6e59cf5
--- /dev/null
+++ b/node_modules/@tensorflow/tfjs-core/dist/environment.js.map
@@ -0,0 +1 @@
+{"version":3,"file":"environment.js","sourceRoot":"","sources":["../src/environment.ts"],"names":[],"mappings":";;AAiBA,2CAA6C;AAC7C,mCAAiE;AACjE,uDAAuN;AAEvN,mCAAiE;AAEjE,6CAAoD;AAEpD,IAAM,4BAA4B,GAAG,IAAI,CAAC;AAC1C,IAAM,6BAA6B,GAAG,IAAI,CAAC;AAE3C;IAQE,qBAAY,QAAmB;QAPvB,aAAQ,GAAa,EAAE,CAAC;QAExB,aAAQ,GACiD,EAAE,CAAC;QAKlE,IAAI,QAAQ,IAAI,IAAI,EAAE;YACpB,IAAI,CAAC,QAAQ,GAAG,QAAQ,CAAC;SAC1B;QAED,IAAI,IAAI,CAAC,GAAG,CAAC,OAAO,CAAC,EAAE;YACrB,OAAO,CAAC,IAAI,CACR,2DAA2D;gBAC3D,6CAA6C;gBAC7C,yCAAyC,CAAC,CAAC;SAChD;IACH,CAAC;IAkBM,sBAAU,GAAjB,UAAkB,WAAmB,EAAE,QAAgB;QAAhB,yBAAA,EAA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\ No newline at end of file
diff --git a/node_modules/@tensorflow/tfjs-core/dist/environment_test.d.ts b/node_modules/@tensorflow/tfjs-core/dist/environment_test.d.ts
new file mode 100644
index 0000000..cb0ff5c
--- /dev/null
+++ b/node_modules/@tensorflow/tfjs-core/dist/environment_test.d.ts
@@ -0,0 +1 @@
+export {};
diff --git a/node_modules/@tensorflow/tfjs-core/dist/environment_test.js b/node_modules/@tensorflow/tfjs-core/dist/environment_test.js
new file mode 100644
index 0000000..85bdb0f
--- /dev/null
+++ b/node_modules/@tensorflow/tfjs-core/dist/environment_test.js
@@ -0,0 +1,219 @@
+"use strict";
+Object.defineProperty(exports, "__esModule", { value: true });
+var device_util = require("./device_util");
+var environment_1 = require("./environment");
+var environment_util_1 = require("./environment_util");
+var jasmine_util_1 = require("./jasmine_util");
+var backend_cpu_1 = require("./kernels/backend_cpu");
+var backend_webgl_1 = require("./kernels/backend_webgl");
+var test_util_1 = require("./test_util");
+jasmine_util_1.describeWithFlags('disjoint query timer enabled', test_util_1.WEBGL_ENVS, function () {
+ afterEach(function () {
+ environment_1.ENV.reset();
+ });
+ it('no webgl', function () {
+ environment_1.ENV.setFeatures({ 'WEBGL_VERSION': 0 });
+ expect(environment_1.ENV.get('WEBGL_DISJOINT_QUERY_TIMER_EXTENSION_VERSION')).toBe(0);
+ });
+ it('webgl 1', function () {
+ var features = { 'WEBGL_VERSION': 1 };
+ spyOn(document, 'createElement').and.returnValue({
+ getContext: function (context) {
+ if (context === 'webgl' || context === 'experimental-webgl') {
+ return {
+ getExtension: function (extensionName) {
+ if (extensionName === 'EXT_disjoint_timer_query') {
+ return {};
+ }
+ else if (extensionName === 'WEBGL_lose_context') {
+ return { loseContext: function () { } };
+ }
+ return null;
+ }
+ };
+ }
+ return null;
+ }
+ });
+ environment_1.ENV.setFeatures(features);
+ expect(environment_1.ENV.get('WEBGL_DISJOINT_QUERY_TIMER_EXTENSION_VERSION')).toBe(0);
+ });
+ it('webgl 2', function () {
+ var features = { 'WEBGL_VERSION': 2 };
+ spyOn(document, 'createElement').and.returnValue({
+ getContext: function (context) {
+ if (context === 'webgl2') {
+ return {
+ getExtension: function (extensionName) {
+ if (extensionName === 'EXT_disjoint_timer_query_webgl2') {
+ return {};
+ }
+ else if (extensionName === 'WEBGL_lose_context') {
+ return { loseContext: function () { } };
+ }
+ return null;
+ }
+ };
+ }
+ return null;
+ }
+ });
+ environment_1.ENV.setFeatures(features);
+ expect(environment_1.ENV.get('WEBGL_DISJOINT_QUERY_TIMER_EXTENSION_VERSION')).toBe(0);
+ });
+});
+jasmine_util_1.describeWithFlags('WEBGL_DISJOINT_QUERY_TIMER_EXTENSION_RELIABLE', test_util_1.WEBGL_ENVS, function () {
+ afterEach(function () {
+ environment_1.ENV.reset();
+ });
+ it('disjoint query timer disabled', function () {
+ var features = { 'WEBGL_DISJOINT_QUERY_TIMER_EXTENSION_VERSION': 0 };
+ var env = new environment_1.Environment(features);
+ expect(env.get('WEBGL_DISJOINT_QUERY_TIMER_EXTENSION_RELIABLE'))
+ .toBe(false);
+ });
+ it('disjoint query timer enabled, mobile', function () {
+ var features = { 'WEBGL_DISJOINT_QUERY_TIMER_EXTENSION_VERSION': 1 };
+ spyOn(device_util, 'isMobile').and.returnValue(true);
+ var env = new environment_1.Environment(features);
+ expect(env.get('WEBGL_DISJOINT_QUERY_TIMER_EXTENSION_RELIABLE'))
+ .toBe(false);
+ });
+ it('disjoint query timer enabled, not mobile', function () {
+ var features = { 'WEBGL_DISJOINT_QUERY_TIMER_EXTENSION_VERSION': 1 };
+ spyOn(device_util, 'isMobile').and.returnValue(false);
+ var env = new environment_1.Environment(features);
+ expect(env.get('WEBGL_DISJOINT_QUERY_TIMER_EXTENSION_RELIABLE'))
+ .toBe(true);
+ });
+});
+jasmine_util_1.describeWithFlags('WEBGL_FENCE_API_ENABLED', test_util_1.WEBGL_ENVS, function () {
+ afterEach(function () {
+ environment_1.ENV.reset();
+ });
+ beforeEach(function () {
+ spyOn(document, 'createElement').and.returnValue({
+ getContext: function (context) {
+ if (context === 'webgl2') {
+ return {
+ getExtension: function (extensionName) {
+ if (extensionName === 'WEBGL_get_buffer_sub_data_async') {
+ return {};
+ }
+ else if (extensionName === 'WEBGL_lose_context') {
+ return { loseContext: function () { } };
+ }
+ return null;
+ },
+ fenceSync: function () { return 1; }
+ };
+ }
+ return null;
+ }
+ });
+ });
+ it('WebGL 2 enabled', function () {
+ var features = { 'WEBGL_VERSION': 2 };
+ var env = new environment_1.Environment(features);
+ expect(env.get('WEBGL_FENCE_API_ENABLED')).toBe(true);
+ });
+ it('WebGL 1 disabled', function () {
+ var features = { 'WEBGL_VERSION': 1 };
+ var env = new environment_1.Environment(features);
+ expect(env.get('WEBGL_FENCE_API_ENABLED')).toBe(false);
+ });
+});
+jasmine_util_1.describeWithFlags('WebGL version', test_util_1.WEBGL_ENVS, function () {
+ afterEach(function () {
+ environment_1.ENV.reset();
+ });
+ it('webgl 1', function () {
+ spyOn(document, 'createElement').and.returnValue({
+ getContext: function (context) {
+ if (context === 'webgl') {
+ return {
+ getExtension: function (a) {
+ return { loseContext: function () { } };
+ }
+ };
+ }
+ return null;
+ }
+ });
+ var env = new environment_1.Environment();
+ expect(env.get('WEBGL_VERSION')).toBe(1);
+ });
+ it('webgl 2', function () {
+ spyOn(document, 'createElement').and.returnValue({
+ getContext: function (context) {
+ if (context === 'webgl2') {
+ return {
+ getExtension: function (a) {
+ return { loseContext: function () { } };
+ }
+ };
+ }
+ return null;
+ }
+ });
+ var env = new environment_1.Environment();
+ expect(env.get('WEBGL_VERSION')).toBe(2);
+ });
+ it('no webgl', function () {
+ spyOn(document, 'createElement').and.returnValue({
+ getContext: function (context) { return null; }
+ });
+ var env = new environment_1.Environment();
+ expect(env.get('WEBGL_VERSION')).toBe(0);
+ });
+});
+describe('Backend', function () {
+ beforeAll(function () {
+ spyOn(console, 'warn');
+ });
+ afterEach(function () {
+ environment_1.ENV.reset();
+ });
+ it('custom cpu registration', function () {
+ var backend;
+ environment_1.ENV.registerBackend('custom-cpu', function () {
+ backend = new backend_cpu_1.MathBackendCPU();
+ return backend;
+ });
+ expect(environment_1.ENV.findBackend('custom-cpu')).toBe(backend);
+ environment_1.Environment.setBackend('custom-cpu');
+ expect(environment_1.ENV.backend).toBe(backend);
+ environment_1.ENV.removeBackend('custom-cpu');
+ });
+ it('webgl not supported, falls back to cpu', function () {
+ environment_1.ENV.setFeatures({ 'WEBGL_VERSION': 0 });
+ var cpuBackend;
+ environment_1.ENV.registerBackend('custom-cpu', function () {
+ cpuBackend = new backend_cpu_1.MathBackendCPU();
+ return cpuBackend;
+ }, 103);
+ var success = environment_1.ENV.registerBackend('custom-webgl', function () { return new backend_webgl_1.MathBackendWebGL(); }, 104);
+ expect(success).toBe(false);
+ expect(environment_1.ENV.findBackend('custom-webgl') == null).toBe(true);
+ expect(environment_1.Environment.getBackend()).toBe('custom-cpu');
+ expect(environment_1.ENV.backend).toBe(cpuBackend);
+ environment_1.ENV.removeBackend('custom-cpu');
+ });
+ it('default custom background null', function () {
+ expect(environment_1.ENV.findBackend('custom')).toBeNull();
+ });
+ it('allow custom backend', function () {
+ var backend = new backend_cpu_1.MathBackendCPU();
+ var success = environment_1.ENV.registerBackend('custom', function () { return backend; });
+ expect(success).toBeTruthy();
+ expect(environment_1.ENV.findBackend('custom')).toEqual(backend);
+ environment_1.ENV.removeBackend('custom');
+ });
+});
+describe('environment_util.getQueryParams', function () {
+ it('basic', function () {
+ expect(environment_util_1.getQueryParams('?a=1&b=hi&f=animal'))
+ .toEqual({ 'a': '1', 'b': 'hi', 'f': 'animal' });
+ });
+});
+//# sourceMappingURL=environment_test.js.map
\ No newline at end of file
diff --git a/node_modules/@tensorflow/tfjs-core/dist/environment_test.js.map b/node_modules/@tensorflow/tfjs-core/dist/environment_test.js.map
new file mode 100644
index 0000000..3f4c815
--- /dev/null
+++ b/node_modules/@tensorflow/tfjs-core/dist/environment_test.js.map
@@ -0,0 +1 @@
+{"version":3,"file":"environment_test.js","sourceRoot":"","sources":["../src/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,MAAM,CAAC,iBAAG,CAAC,OAAO,CAAC,CAAC,IAAI,CAAC,UAAU,CAAC,CAAC;QAErC,iBAAG,CAAC,aAAa,CAAC,YAAY,CAAC,CAAC;IAClC,CAAC,CAAC,CAAC;IAEH,EAAE,CAAC,gCAAgC,EAAE;QACnC,MAAM,CAAC,iBAAG,CAAC,WAAW,CAAC,QAAQ,CAAC,CAAC,CAAC,QAAQ,EAAE,CAAC;IAC/C,CAAC,CAAC,CAAC;IAEH,EAAE,CAAC,sBAAsB,EAAE;QACzB,IAAM,OAAO,GAAG,IAAI,4BAAc,EAAE,CAAC;QACrC,IAAM,OAAO,GAAG,iBAAG,CAAC,eAAe,CAAC,QAAQ,EAAE,cAAM,OAAA,OAAO,EAAP,CAAO,CAAC,CAAC;QAC7D,MAAM,CAAC,OAAO,CAAC,CAAC,UAAU,EAAE,CAAC;QAC7B,MAAM,CAAC,iBAAG,CAAC,WAAW,CAAC,QAAQ,CAAC,CAAC,CAAC,OAAO,CAAC,OAAO,CAAC,CAAC;QACnD,iBAAG,CAAC,aAAa,CAAC,QAAQ,CAAC,CAAC;IAC9B,CAAC,CAAC,CAAC;AACL,CAAC,CAAC,CAAC;AAEH,QAAQ,CAAC,iCAAiC,EAAE;IAC1C,EAAE,CAAC,OAAO,EAAE;QACV,MAAM,CAAC,iCAAc,CAAC,oBAAoB,CAAC,CAAC;aACvC,OAAO,CAAC,EAAC,GAAG,EAAE,GAAG,EAAE,GAAG,EAAE,IAAI,EAAE,GAAG,EAAE,QAAQ,EAAC,CAAC,CAAC;IACrD,CAAC,CAAC,CAAC;AACL,CAAC,CAAC,CAAC"}
\ No newline at end of file
diff --git a/node_modules/@tensorflow/tfjs-core/dist/environment_util.d.ts b/node_modules/@tensorflow/tfjs-core/dist/environment_util.d.ts
new file mode 100644
index 0000000..0097622
--- /dev/null
+++ b/node_modules/@tensorflow/tfjs-core/dist/environment_util.d.ts
@@ -0,0 +1,36 @@
+export interface Features {
+ 'DEBUG'?: boolean;
+ 'IS_BROWSER'?: boolean;
+ 'IS_NODE'?: boolean;
+ 'WEBGL_DISJOINT_QUERY_TIMER_EXTENSION_VERSION'?: number;
+ 'WEBGL_DISJOINT_QUERY_TIMER_EXTENSION_RELIABLE'?: boolean;
+ 'WEBGL_VERSION'?: number;
+ 'HAS_WEBGL'?: boolean;
+ 'WEBGL_RENDER_FLOAT32_ENABLED'?: boolean;
+ 'WEBGL_DOWNLOAD_FLOAT_ENABLED'?: boolean;
+ 'WEBGL_FENCE_API_ENABLED'?: boolean;
+ 'BACKEND'?: string;
+ 'TEST_EPSILON'?: number;
+ 'IS_CHROME'?: boolean;
+ 'IS_TEST'?: boolean;
+}
+export declare enum Type {
+ NUMBER = 0,
+ BOOLEAN = 1,
+ STRING = 2
+}
+export declare const URL_PROPERTIES: URLProperty[];
+export interface URLProperty {
+ name: keyof Features;
+ type: Type;
+}
+export declare function isWebGLVersionEnabled(webGLVersion: 1 | 2, isBrowser: boolean): boolean;
+export declare function getWebGLDisjointQueryTimerVersion(webGLVersion: number, isBrowser: boolean): number;
+export declare function isRenderToFloatTextureEnabled(webGLVersion: number, isBrowser: boolean): boolean;
+export declare function isDownloadFloatTextureEnabled(webGLVersion: number, isBrowser: boolean): boolean;
+export declare function isWebGLFenceEnabled(webGLVersion: number, isBrowser: boolean): boolean;
+export declare function isChrome(): boolean;
+export declare function getFeaturesFromURL(): Features;
+export declare function getQueryParams(queryString: string): {
+ [key: string]: string;
+};
diff --git a/node_modules/@tensorflow/tfjs-core/dist/environment_util.js b/node_modules/@tensorflow/tfjs-core/dist/environment_util.js
new file mode 100644
index 0000000..73ebb5d
--- /dev/null
+++ b/node_modules/@tensorflow/tfjs-core/dist/environment_util.js
@@ -0,0 +1,200 @@
+"use strict";
+Object.defineProperty(exports, "__esModule", { value: true });
+var Type;
+(function (Type) {
+ Type[Type["NUMBER"] = 0] = "NUMBER";
+ Type[Type["BOOLEAN"] = 1] = "BOOLEAN";
+ Type[Type["STRING"] = 2] = "STRING";
+})(Type = exports.Type || (exports.Type = {}));
+exports.URL_PROPERTIES = [
+ { name: 'DEBUG', type: Type.BOOLEAN }, { name: 'IS_BROWSER', type: Type.BOOLEAN },
+ { name: 'WEBGL_DISJOINT_QUERY_TIMER_EXTENSION_VERSION', type: Type.NUMBER },
+ { name: 'WEBGL_DISJOINT_QUERY_TIMER_EXTENSION_RELIABLE', type: Type.BOOLEAN },
+ { name: 'WEBGL_VERSION', type: Type.NUMBER },
+ { name: 'WEBGL_RENDER_FLOAT32_ENABLED', type: Type.BOOLEAN },
+ { name: 'WEBGL_DOWNLOAD_FLOAT_ENABLED', type: Type.BOOLEAN },
+ { name: 'WEBGL_FENCE_API_ENABLED', type: Type.BOOLEAN },
+ { name: 'BACKEND', type: Type.STRING }
+];
+function isWebGLVersionEnabled(webGLVersion, isBrowser) {
+ var gl;
+ try {
+ gl = getWebGLRenderingContext(webGLVersion, isBrowser);
+ }
+ catch (e) {
+ return false;
+ }
+ if (gl != null) {
+ loseContext(gl);
+ return true;
+ }
+ return false;
+}
+exports.isWebGLVersionEnabled = isWebGLVersionEnabled;
+function getWebGLDisjointQueryTimerVersion(webGLVersion, isBrowser) {
+ if (webGLVersion === 0) {
+ return 0;
+ }
+ var queryTimerVersion;
+ var gl = getWebGLRenderingContext(webGLVersion, isBrowser);
+ if (hasExtension(gl, 'EXT_disjoint_timer_query_webgl2') &&
+ webGLVersion === 2) {
+ queryTimerVersion = 2;
+ }
+ else if (hasExtension(gl, 'EXT_disjoint_timer_query')) {
+ queryTimerVersion = 1;
+ }
+ else {
+ queryTimerVersion = 0;
+ }
+ if (gl != null) {
+ loseContext(gl);
+ }
+ return queryTimerVersion;
+}
+exports.getWebGLDisjointQueryTimerVersion = getWebGLDisjointQueryTimerVersion;
+function isRenderToFloatTextureEnabled(webGLVersion, isBrowser) {
+ if (webGLVersion === 0) {
+ return false;
+ }
+ var gl = getWebGLRenderingContext(webGLVersion, isBrowser);
+ if (webGLVersion === 1) {
+ if (!hasExtension(gl, 'OES_texture_float')) {
+ return false;
+ }
+ }
+ else {
+ if (!hasExtension(gl, 'EXT_color_buffer_float')) {
+ return false;
+ }
+ }
+ createFloatTextureAndBindToFramebuffer(gl, webGLVersion);
+ var isFrameBufferComplete = gl.checkFramebufferStatus(gl.FRAMEBUFFER) === gl.FRAMEBUFFER_COMPLETE;
+ loseContext(gl);
+ return isFrameBufferComplete;
+}
+exports.isRenderToFloatTextureEnabled = isRenderToFloatTextureEnabled;
+function isDownloadFloatTextureEnabled(webGLVersion, isBrowser) {
+ if (webGLVersion === 0) {
+ return false;
+ }
+ var gl = getWebGLRenderingContext(webGLVersion, isBrowser);
+ if (webGLVersion === 1) {
+ if (!hasExtension(gl, 'OES_texture_float')) {
+ return false;
+ }
+ }
+ else {
+ if (!hasExtension(gl, 'EXT_color_buffer_float')) {
+ return false;
+ }
+ }
+ createFloatTextureAndBindToFramebuffer(gl, webGLVersion);
+ gl.readPixels(0, 0, 1, 1, gl.RGBA, gl.FLOAT, new Float32Array(4));
+ var readPixelsNoError = gl.getError() === gl.NO_ERROR;
+ loseContext(gl);
+ return readPixelsNoError;
+}
+exports.isDownloadFloatTextureEnabled = isDownloadFloatTextureEnabled;
+function isWebGLFenceEnabled(webGLVersion, isBrowser) {
+ if (webGLVersion !== 2) {
+ return false;
+ }
+ var gl = getWebGLRenderingContext(webGLVersion, isBrowser);
+ var isEnabled = gl.fenceSync != null;
+ loseContext(gl);
+ return isEnabled;
+}
+exports.isWebGLFenceEnabled = isWebGLFenceEnabled;
+function isChrome() {
+ return typeof navigator !== 'undefined' && navigator != null &&
+ navigator.userAgent != null && /Chrome/.test(navigator.userAgent) &&
+ /Google Inc/.test(navigator.vendor);
+}
+exports.isChrome = isChrome;
+var TENSORFLOWJS_FLAGS_PREFIX = 'tfjsflags';
+function getFeaturesFromURL() {
+ var features = {};
+ if (typeof window === 'undefined' || typeof window.location === 'undefined') {
+ return features;
+ }
+ var urlParams = getQueryParams(window.location.search);
+ if (TENSORFLOWJS_FLAGS_PREFIX in urlParams) {
+ var urlFlags_1 = {};
+ var keyValues = urlParams[TENSORFLOWJS_FLAGS_PREFIX].split(',');
+ keyValues.forEach(function (keyValue) {
+ var _a = keyValue.split(':'), key = _a[0], value = _a[1];
+ urlFlags_1[key] = value;
+ });
+ exports.URL_PROPERTIES.forEach(function (urlProperty) {
+ if (urlProperty.name in urlFlags_1) {
+ console.log("Setting feature override from URL " + urlProperty.name + ": " +
+ ("" + urlFlags_1[urlProperty.name]));
+ if (urlProperty.type === Type.NUMBER) {
+ features[urlProperty.name] = +urlFlags_1[urlProperty.name];
+ }
+ else if (urlProperty.type === Type.BOOLEAN) {
+ features[urlProperty.name] = urlFlags_1[urlProperty.name] === 'true';
+ }
+ else if (urlProperty.type === Type.STRING) {
+ features[urlProperty.name] = urlFlags_1[urlProperty.name];
+ }
+ else {
+ console.warn("Unknown URL param: " + urlProperty.name + ".");
+ }
+ }
+ });
+ }
+ return features;
+}
+exports.getFeaturesFromURL = getFeaturesFromURL;
+function hasExtension(gl, extensionName) {
+ var ext = gl.getExtension(extensionName);
+ return ext != null;
+}
+function getWebGLRenderingContext(webGLVersion, isBrowser) {
+ if (webGLVersion === 0 || !isBrowser) {
+ throw new Error('Cannot get WebGL rendering context, WebGL is disabled.');
+ }
+ var tempCanvas = document.createElement('canvas');
+ if (webGLVersion === 1) {
+ return (tempCanvas.getContext('webgl') ||
+ tempCanvas.getContext('experimental-webgl'));
+ }
+ return tempCanvas.getContext('webgl2');
+}
+function loseContext(gl) {
+ if (gl != null) {
+ var loseContextExtension = gl.getExtension('WEBGL_lose_context');
+ if (loseContextExtension == null) {
+ throw new Error('Extension WEBGL_lose_context not supported on this browser.');
+ }
+ loseContextExtension.loseContext();
+ }
+}
+function createFloatTextureAndBindToFramebuffer(gl, webGLVersion) {
+ var frameBuffer = gl.createFramebuffer();
+ var texture = gl.createTexture();
+ gl.bindTexture(gl.TEXTURE_2D, texture);
+ var internalFormat = webGLVersion === 2 ? gl.RGBA32F : gl.RGBA;
+ gl.texImage2D(gl.TEXTURE_2D, 0, internalFormat, 1, 1, 0, gl.RGBA, gl.FLOAT, null);
+ gl.bindFramebuffer(gl.FRAMEBUFFER, frameBuffer);
+ gl.framebufferTexture2D(gl.FRAMEBUFFER, gl.COLOR_ATTACHMENT0, gl.TEXTURE_2D, texture, 0);
+}
+function getQueryParams(queryString) {
+ var params = {};
+ queryString.replace(/[?&]([^=?&]+)(?:=([^&]*))?/g, function (s) {
+ var t = [];
+ for (var _i = 1; _i < arguments.length; _i++) {
+ t[_i - 1] = arguments[_i];
+ }
+ decodeParam(params, t[0], t[1]);
+ return t.join('=');
+ });
+ return params;
+}
+exports.getQueryParams = getQueryParams;
+function decodeParam(params, name, value) {
+ params[decodeURIComponent(name)] = decodeURIComponent(value || '');
+}
+//# sourceMappingURL=environment_util.js.map
\ No newline at end of file
diff --git a/node_modules/@tensorflow/tfjs-core/dist/environment_util.js.map b/node_modules/@tensorflow/tfjs-core/dist/environment_util.js.map
new file mode 100644
index 0000000..032419f
--- /dev/null
+++ b/node_modules/@tensorflow/tfjs-core/dist/environment_util.js.map
@@ -0,0 +1 @@
+{"version":3,"file":"environment_util.js","sourceRoot":"","sources":["../src/environment_util.ts"],"names":[],"mappings":";;AAuDA,IAAY,IAIX;AAJD,WAAY,IAAI;IACd,mCAAM,CAAA;IACN,qCAAO,CAAA;IACP,mCAAM,CAAA;AACR,CAAC,EAJW,IAAI,GAAJ,YAAI,KAAJ,YAAI,QAIf;AAEY,QAAA,cAAc,GAAkB;IAC3C,EAAC,IAAI,EAAE,OAAO,EAAE,IAAI,EAAE,IAAI,CAAC,OAAO,EAAC,EAAE,EAAC,IAAI,EAAE,YAAY,EAAE,IAAI,EAAE,IAAI,CAAC,OAAO,EAAC;IAC7E,EAAC,IAAI,EAAE,8CAA8C,EAAE,IAAI,EAAE,IAAI,CAAC,MAAM,EAAC;IACzE,EAAC,IAAI,EAAE,+CAA+C,EAAE,IAAI,EAAE,IAAI,CAAC,OAAO,EA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AI,EAAE,EAAE,CAAC,KAAK,EAAE,IAAI,CAAC,CAAC;IAExE,EAAE,CAAC,eAAe,CAAC,EAAE,CAAC,WAAW,EAAE,WAAW,CAAC,CAAC;IAChD,EAAE,CAAC,oBAAoB,CACnB,EAAE,CAAC,WAAW,EAAE,EAAE,CAAC,iBAAiB,EAAE,EAAE,CAAC,UAAU,EAAE,OAAO,EAAE,CAAC,CAAC,CAAC;AACvE,CAAC;AAED,wBAA+B,WAAmB;IAChD,IAAM,MAAM,GAAG,EAAE,CAAC;IAClB,WAAW,CAAC,OAAO,CAAC,6BAA6B,EAAE,UAAC,CAAC;QAAE,WAAI;aAAJ,UAAI,EAAJ,qBAAI,EAAJ,IAAI;YAAJ,0BAAI;;QACzD,WAAW,CAAC,MAAM,EAAE,CAAC,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;QAChC,OAAO,CAAC,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;IACrB,CAAC,CAAC,CAAC;IACH,OAAO,MAAM,CAAC;AAChB,CAAC;AAPD,wCAOC;AAED,qBACI,MAA+B,EAAE,IAAY,EAAE,KAAc;IAC/D,MAAM,CAAC,kBAAkB,CAAC,IAAI,CAAC,CAAC,GAAG,kBAAkB,CAAC,KAAK,IAAI,EAAE,CAAC,CAAC;AACrE,CAAC"}
\ No newline at end of file
diff --git a/node_modules/@tensorflow/tfjs-core/dist/globals.d.ts b/node_modules/@tensorflow/tfjs-core/dist/globals.d.ts
new file mode 100644
index 0000000..a603763
--- /dev/null
+++ b/node_modules/@tensorflow/tfjs-core/dist/globals.d.ts
@@ -0,0 +1,6 @@
+import { Environment } from './environment';
+export { customGrad, grad, grads, valueAndGrad, valueAndGrads, variableGrads } from './gradients';
+export declare const tidy: typeof Environment.tidy;
+export declare const keep: typeof Environment.keep;
+export declare const dispose: typeof Environment.dispose;
+export declare const time: typeof Environment.time;
diff --git a/node_modules/@tensorflow/tfjs-core/dist/globals.js b/node_modules/@tensorflow/tfjs-core/dist/globals.js
new file mode 100644
index 0000000..578bfa2
--- /dev/null
+++ b/node_modules/@tensorflow/tfjs-core/dist/globals.js
@@ -0,0 +1,15 @@
+"use strict";
+Object.defineProperty(exports, "__esModule", { value: true });
+var environment_1 = require("./environment");
+var gradients_1 = require("./gradients");
+exports.customGrad = gradients_1.customGrad;
+exports.grad = gradients_1.grad;
+exports.grads = gradients_1.grads;
+exports.valueAndGrad = gradients_1.valueAndGrad;
+exports.valueAndGrads = gradients_1.valueAndGrads;
+exports.variableGrads = gradients_1.variableGrads;
+exports.tidy = environment_1.Environment.tidy;
+exports.keep = environment_1.Environment.keep;
+exports.dispose = environment_1.Environment.dispose;
+exports.time = environment_1.Environment.time;
+//# sourceMappingURL=globals.js.map
\ No newline at end of file
diff --git a/node_modules/@tensorflow/tfjs-core/dist/globals.js.map b/node_modules/@tensorflow/tfjs-core/dist/globals.js.map
new file mode 100644
index 0000000..55dbd3e
--- /dev/null
+++ b/node_modules/@tensorflow/tfjs-core/dist/globals.js.map
@@ -0,0 +1 @@
+{"version":3,"file":"globals.js","sourceRoot":"","sources":["../src/globals.ts"],"names":[],"mappings":";;AAiBA,6CAA0C;AAC1C,yCAAgG;AAAxF,iCAAA,UAAU,CAAA;AAAE,2BAAA,IAAI,CAAA;AAAE,4BAAA,KAAK,CAAA;AAAE,mCAAA,YAAY,CAAA;AAAE,oCAAA,aAAa,CAAA;AAAE,oCAAA,aAAa,CAAA;AAE9D,QAAA,IAAI,GAAG,yBAAW,CAAC,IAAI,CAAC;AACxB,QAAA,IAAI,GAAG,yBAAW,CAAC,IAAI,CAAC;AACxB,QAAA,OAAO,GAAG,yBAAW,CAAC,OAAO,CAAC;AAC9B,QAAA,IAAI,GAAG,yBAAW,CAAC,IAAI,CAAC"}
\ No newline at end of file
diff --git a/node_modules/@tensorflow/tfjs-core/dist/gradients.d.ts b/node_modules/@tensorflow/tfjs-core/dist/gradients.d.ts
new file mode 100644
index 0000000..9198615
--- /dev/null
+++ b/node_modules/@tensorflow/tfjs-core/dist/gradients.d.ts
@@ -0,0 +1,20 @@
+import { CustomGradientFunc, ScopeFn } from './engine';
+import { Scalar, Tensor, Variable } from './tensor';
+import { NamedTensorMap, TensorContainer } from './tensor_types';
+declare function gradScope(nameOrScopeFn: string | ScopeFn, scopeFn?: ScopeFn): T;
+declare function grad(f: (x: I) => O): (x: I, dy?: O) => I;
+declare function grads(f: (...args: Tensor[]) => O): (args: Tensor[], dy?: O) => Tensor[];
+declare function valueAndGrad(f: (x: I) => O): (x: I, dy?: O) => {
+ value: O;
+ grad: I;
+};
+declare function valueAndGrads(f: (...args: Tensor[]) => O): (args: Tensor[], dy?: O) => {
+ grads: Tensor[];
+ value: O;
+};
+declare function variableGrads(f: () => Scalar, varList?: Variable[]): {
+ value: Scalar;
+ grads: NamedTensorMap;
+};
+declare function customGrad(f: CustomGradientFunc): (...args: Tensor[]) => T;
+export { gradScope, customGrad, variableGrads, valueAndGrad, valueAndGrads, grad, grads, };
diff --git a/node_modules/@tensorflow/tfjs-core/dist/gradients.js b/node_modules/@tensorflow/tfjs-core/dist/gradients.js
new file mode 100644
index 0000000..d74545a
--- /dev/null
+++ b/node_modules/@tensorflow/tfjs-core/dist/gradients.js
@@ -0,0 +1,112 @@
+"use strict";
+Object.defineProperty(exports, "__esModule", { value: true });
+var environment_1 = require("./environment");
+var tensor_1 = require("./tensor");
+var util = require("./util");
+function gradScope(nameOrScopeFn, scopeFn) {
+ return environment_1.ENV.engine.tidy(nameOrScopeFn, scopeFn, true);
+}
+exports.gradScope = gradScope;
+function grad(f) {
+ util.assert(util.isFunction(f), 'The f passed in grad(f) must be a function');
+ return function (x, dy) {
+ util.assert(x instanceof tensor_1.Tensor, 'The x passed in grad(f)(x) must be a tensor');
+ util.assert(dy == null || dy instanceof tensor_1.Tensor, 'The dy passed in grad(f)(x, dy) must be a tensor');
+ return environment_1.ENV.engine.tidy(function () {
+ var _a = environment_1.ENV.engine.gradients(function () { return f(x); }, [x], dy), value = _a.value, grads = _a.grads;
+ if (dy != null) {
+ util.assertShapesMatch(value.shape, dy.shape, 'The shape of dy passed in grad(f)(x, dy) must match the shape ' +
+ 'returned by f(x)');
+ }
+ checkGrads(grads);
+ return grads[0];
+ });
+ };
+}
+exports.grad = grad;
+function grads(f) {
+ util.assert(util.isFunction(f), 'The f passed in grads(f) must be a function');
+ return function (args, dy) {
+ util.assert(Array.isArray(args) && args.every(function (arg) { return arg instanceof tensor_1.Tensor; }), 'The args passed in grads(f)(args) must be an array of tensors');
+ util.assert(dy == null || dy instanceof tensor_1.Tensor, 'The dy passed in grads(f)(args, dy) must be a tensor');
+ return environment_1.ENV.engine.tidy(function () {
+ var _a = environment_1.ENV.engine.gradients(function () { return f.apply(void 0, args); }, args, dy), value = _a.value, grads = _a.grads;
+ if (dy != null) {
+ util.assertShapesMatch(value.shape, dy.shape, 'The shape of dy passed in grads(f)([x1,...], dy) must ' +
+ 'match the shape returned by f([x1,...])');
+ }
+ checkGrads(grads);
+ return grads;
+ });
+ };
+}
+exports.grads = grads;
+function valueAndGrad(f) {
+ util.assert(util.isFunction(f), 'The f passed in valueAndGrad(f) must be a function');
+ return function (x, dy) {
+ util.assert(x instanceof tensor_1.Tensor, 'The x passed in valueAndGrad(f)(x) must be a tensor');
+ util.assert(dy == null || dy instanceof tensor_1.Tensor, 'The dy passed in valueAndGrad(f)(x, dy) must be a tensor');
+ var _a = environment_1.ENV.engine.gradients(function () { return f(x); }, [x], dy), grads = _a.grads, value = _a.value;
+ checkGrads(grads);
+ return { grad: grads[0], value: value };
+ };
+}
+exports.valueAndGrad = valueAndGrad;
+function valueAndGrads(f) {
+ util.assert(util.isFunction(f), 'The f passed in valueAndGrads(f) must be a function');
+ return function (args, dy) {
+ util.assert(Array.isArray(args) && args.every(function (arg) { return arg instanceof tensor_1.Tensor; }), 'The args passed in valueAndGrads(f)(args) must be array of tensors');
+ util.assert(dy == null || dy instanceof tensor_1.Tensor, 'The dy passed in valueAndGrads(f)(args, dy) must be a tensor');
+ var res = environment_1.ENV.engine.gradients(function () { return f.apply(void 0, args); }, args, dy);
+ if (dy != null) {
+ util.assertShapesMatch(res.value.shape, dy.shape, 'The shape of dy passed in valueAndGrads(f)([x1,...], dy) must ' +
+ 'match the shape returned by f([x1,...])');
+ }
+ checkGrads(res.grads);
+ return res;
+ };
+}
+exports.valueAndGrads = valueAndGrads;
+function variableGrads(f, varList) {
+ util.assert(util.isFunction(f), 'The f passed in variableGrads(f) must be a function');
+ util.assert(varList == null ||
+ Array.isArray(varList) && varList.every(function (v) { return v instanceof tensor_1.Variable; }), 'The varList passed in variableGrads(f, varList) must be an array ' +
+ 'of variables');
+ if (varList == null) {
+ varList = [];
+ for (var varName in environment_1.ENV.engine.registeredVariables) {
+ varList.push(environment_1.ENV.engine.registeredVariables[varName]);
+ }
+ }
+ var originalVarCount = varList.length;
+ varList = varList.filter(function (variable) { return variable.trainable; });
+ util.assert(varList.length > 0, "variableGrads() expects at least one of the input variables to be " +
+ ("trainable, but none of the " + originalVarCount + " variables is ") +
+ "trainable.");
+ var allowNoGradients = true;
+ var _a = environment_1.ENV.engine.gradients(f, varList, null, allowNoGradients), value = _a.value, grads = _a.grads;
+ util.assert(grads.some(function (g) { return g != null; }), 'Cannot find a connection between any variable and the result of the ' +
+ 'loss function y=f(x). Please make sure the operations that use ' +
+ 'variables are inside the function f passed to minimize().');
+ util.assert(value.rank === 0, "The f passed in variableGrads(f) must return a scalar, but it " +
+ ("returned a rank-" + value.rank + " tensor"));
+ var namedGrads = {};
+ varList.forEach(function (v, i) {
+ if (grads[i] != null) {
+ namedGrads[v.name] = grads[i];
+ }
+ });
+ return { value: value, grads: namedGrads };
+}
+exports.variableGrads = variableGrads;
+function customGrad(f) {
+ return environment_1.ENV.engine.customGrad(f);
+}
+exports.customGrad = customGrad;
+function checkGrads(grads) {
+ var numNullGradients = grads.filter(function (g) { return g == null; }).length;
+ if (numNullGradients > 0) {
+ throw new Error("Cannot compute gradient of y=f(x) with respect to x. Make sure that\n the f you passed encloses all operations that lead from x to y.");
+ }
+}
+//# sourceMappingURL=gradients.js.map
\ No newline at end of file
diff --git a/node_modules/@tensorflow/tfjs-core/dist/gradients.js.map b/node_modules/@tensorflow/tfjs-core/dist/gradients.js.map
new file mode 100644
index 0000000..6d35893
--- /dev/null
+++ b/node_modules/@tensorflow/tfjs-core/dist/gradients.js.map
@@ -0,0 +1 @@
+{"version":3,"file":"gradients.js","sourceRoot":"","sources":["../src/gradients.ts"],"names":[],"mappings":";;AAkBA,6CAAkC;AAClC,mCAAkD;AAElD,6BAA+B;AAa/B,mBACI,aAAgC,EAAE,OAAoB;IACxD,OAAO,iBAAG,CAAC,MAAM,CAAC,IAAI,CAAC,aAAa,EAAE,OAAO,EAAE,IAAI,CAAiB,CAAC;AACvE,CAAC;AAuUC,8BAAS;AApSX,cAAkD,CAAc;IAE9D,IAAI,CAAC,MAAM,CAAC,IAAI,CAAC,UAAU,CAAC,CAAC,CAAC,EAAE,4CAA4C,CAAC,CAAC;IAC9E,OAAO,UAAC,CAAI,EAAE,EAAM;QAClB,IAAI,CAAC,MAAM,CACP,CAAC,YAAY,eAAM,EAAE,6CAA6C,CAAC,CAAC;QACxE,IAAI,CAAC,MAAM,CACP,EAAE,IAAI,IAAI,IAAI,EAAE,YAAY,eAAM,EAClC,kDAAkD,CAAC,CAAC;QACxD,OAAO,iBAAG,CAAC,MAAM,CAAC,IAAI,CAAC;YACf,IAAA,8EAA0D,EAAzD,gBAAK,EAAE,gBAAK,CAA8C;YACjE,IAAI,EAAE,IAAI,IAAI,EAAE;gBACd,IAAI,CAAC,iBAAiB,CAClB,KAAK,CAAC,KAAK,EAAE,EAAE,CAAC,KAAK,EACrB,gEAAgE;oBAC5D,kBAAkB,CAAC,CAAC;aAC7B;YACD,UAAU,CAAC,KAAK,CAAC,CAAC;YAClB,OAAO,KAAK,CAAC,CAAC,CAAM,CAAC;QACvB,CAAC,CAAC,CAAC;IACL,CAAC,CAAC;AACJ,CAAC;AAoRC,oB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AAC,IAAI,CAAC,GAAG,KAAK,CAAC,CAAC,CAAC,CAAC;SAC/B;IACH,CAAC,CAAC,CAAC;IACH,OAAO,EAAC,KAAK,OAAA,EAAE,KAAK,EAAE,UAAU,EAAC,CAAC;AACpC,CAAC;AAgDC,sCAAa;AAjBf,oBAAsC,CAAwB;IAE5D,OAAO,iBAAG,CAAC,MAAM,CAAC,UAAU,CAAC,CAAC,CAAC,CAAC;AAClC,CAAC;AAaC,gCAAU;AAXZ,oBAAoB,KAAe;IACjC,IAAM,gBAAgB,GAAG,KAAK,CAAC,MAAM,CAAC,UAAA,CAAC,IAAI,OAAA,CAAC,IAAI,IAAI,EAAT,CAAS,CAAC,CAAC,MAAM,CAAC;IAC7D,IAAI,gBAAgB,GAAG,CAAC,EAAE;QACxB,MAAM,IAAI,KAAK,CACX,0IAC4D,CAAC,CAAC;KACnE;AACH,CAAC"}
\ No newline at end of file
diff --git a/node_modules/@tensorflow/tfjs-core/dist/index.d.ts b/node_modules/@tensorflow/tfjs-core/dist/index.d.ts
new file mode 100644
index 0000000..cb0ca49
--- /dev/null
+++ b/node_modules/@tensorflow/tfjs-core/dist/index.d.ts
@@ -0,0 +1,38 @@
+import './kernels/backend_webgl';
+import './kernels/backend_cpu';
+import { nextFrame } from './browser_util';
+import * as environment from './environment';
+import * as io from './io/io';
+import * as serialization from './serialization';
+import * as test_util from './test_util';
+import * as util from './util';
+import { version } from './version';
+import * as webgl from './webgl';
+export { InferenceModel, ModelPredictConfig } from './model_types';
+export { AdadeltaOptimizer } from './optimizers/adadelta_optimizer';
+export { AdagradOptimizer } from './optimizers/adagrad_optimizer';
+export { AdamOptimizer } from './optimizers/adam_optimizer';
+export { AdamaxOptimizer } from './optimizers/adamax_optimizer';
+export { MomentumOptimizer } from './optimizers/momentum_optimizer';
+export { Optimizer } from './optimizers/optimizer';
+export { RMSPropOptimizer } from './optimizers/rmsprop_optimizer';
+export { SGDOptimizer } from './optimizers/sgd_optimizer';
+export { Scalar, Tensor, Tensor1D, Tensor2D, Tensor3D, Tensor4D, TensorBuffer, variable, Variable } from './tensor';
+export { NamedTensorMap } from './tensor_types';
+export { DataType, Rank, ShapeMap } from './types';
+export * from './ops/ops';
+export { LSTMCellFunc } from './ops/lstm';
+export { Reduction } from './ops/loss_ops';
+export * from './train';
+export * from './globals';
+export { Features } from './environment_util';
+export { TimingInfo } from './engine';
+export { ENV, Environment } from './environment';
+export declare const setBackend: typeof environment.Environment.setBackend;
+export declare const getBackend: typeof environment.Environment.getBackend;
+export declare const disposeVariables: typeof environment.Environment.disposeVariables;
+export declare const memory: typeof environment.Environment.memory;
+export { version as version_core };
+export { nextFrame };
+export { environment, io, serialization, test_util, util, webgl };
+export { KernelBackend, BackendTimingInfo } from './kernels/backend';
diff --git a/node_modules/@tensorflow/tfjs-core/dist/index.js b/node_modules/@tensorflow/tfjs-core/dist/index.js
new file mode 100644
index 0000000..338637a
--- /dev/null
+++ b/node_modules/@tensorflow/tfjs-core/dist/index.js
@@ -0,0 +1,63 @@
+"use strict";
+function __export(m) {
+ for (var p in m) if (!exports.hasOwnProperty(p)) exports[p] = m[p];
+}
+Object.defineProperty(exports, "__esModule", { value: true });
+require("./kernels/backend_webgl");
+require("./kernels/backend_cpu");
+var browser_util_1 = require("./browser_util");
+exports.nextFrame = browser_util_1.nextFrame;
+var environment = require("./environment");
+exports.environment = environment;
+var environment_1 = require("./environment");
+var io = require("./io/io");
+exports.io = io;
+var serialization = require("./serialization");
+exports.serialization = serialization;
+var tensor_1 = require("./tensor");
+var test_util = require("./test_util");
+exports.test_util = test_util;
+var util = require("./util");
+exports.util = util;
+var version_1 = require("./version");
+exports.version_core = version_1.version;
+var webgl = require("./webgl");
+exports.webgl = webgl;
+var adadelta_optimizer_1 = require("./optimizers/adadelta_optimizer");
+exports.AdadeltaOptimizer = adadelta_optimizer_1.AdadeltaOptimizer;
+var adagrad_optimizer_1 = require("./optimizers/adagrad_optimizer");
+exports.AdagradOptimizer = adagrad_optimizer_1.AdagradOptimizer;
+var adam_optimizer_1 = require("./optimizers/adam_optimizer");
+exports.AdamOptimizer = adam_optimizer_1.AdamOptimizer;
+var adamax_optimizer_1 = require("./optimizers/adamax_optimizer");
+exports.AdamaxOptimizer = adamax_optimizer_1.AdamaxOptimizer;
+var momentum_optimizer_1 = require("./optimizers/momentum_optimizer");
+exports.MomentumOptimizer = momentum_optimizer_1.MomentumOptimizer;
+var optimizer_1 = require("./optimizers/optimizer");
+exports.Optimizer = optimizer_1.Optimizer;
+var rmsprop_optimizer_1 = require("./optimizers/rmsprop_optimizer");
+exports.RMSPropOptimizer = rmsprop_optimizer_1.RMSPropOptimizer;
+var sgd_optimizer_1 = require("./optimizers/sgd_optimizer");
+exports.SGDOptimizer = sgd_optimizer_1.SGDOptimizer;
+var tensor_2 = require("./tensor");
+exports.Tensor = tensor_2.Tensor;
+exports.TensorBuffer = tensor_2.TensorBuffer;
+exports.variable = tensor_2.variable;
+exports.Variable = tensor_2.Variable;
+var types_1 = require("./types");
+exports.Rank = types_1.Rank;
+__export(require("./ops/ops"));
+var loss_ops_1 = require("./ops/loss_ops");
+exports.Reduction = loss_ops_1.Reduction;
+__export(require("./train"));
+__export(require("./globals"));
+var environment_2 = require("./environment");
+exports.ENV = environment_2.ENV;
+exports.Environment = environment_2.Environment;
+exports.setBackend = environment_1.Environment.setBackend;
+exports.getBackend = environment_1.Environment.getBackend;
+exports.disposeVariables = environment_1.Environment.disposeVariables;
+exports.memory = environment_1.Environment.memory;
+var ops = require("./ops/ops");
+tensor_1.setOpHandler(ops);
+//# sourceMappingURL=index.js.map
\ No newline at end of file
diff --git a/node_modules/@tensorflow/tfjs-core/dist/index.js.map b/node_modules/@tensorflow/tfjs-core/dist/index.js.map
new file mode 100644
index 0000000..489d543
--- /dev/null
+++ b/node_modules/@tensorflow/tfjs-core/dist/index.js.map
@@ -0,0 +1 @@
+{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";;;;;AAoBA,mCAAiC;AACjC,i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AAC"}
\ No newline at end of file
diff --git a/node_modules/@tensorflow/tfjs-core/dist/io/browser_files.d.ts b/node_modules/@tensorflow/tfjs-core/dist/io/browser_files.d.ts
new file mode 100644
index 0000000..384ec0e
--- /dev/null
+++ b/node_modules/@tensorflow/tfjs-core/dist/io/browser_files.d.ts
@@ -0,0 +1,14 @@
+import { IORouter } from './router_registry';
+import { IOHandler, ModelArtifacts, SaveResult } from './types';
+export declare class BrowserDownloads implements IOHandler {
+ private readonly modelTopologyFileName;
+ private readonly weightDataFileName;
+ private readonly jsonAnchor;
+ private readonly weightDataAnchor;
+ static readonly URL_SCHEME: string;
+ constructor(fileNamePrefix?: string);
+ save(modelArtifacts: ModelArtifacts): Promise;
+}
+export declare const browserDownloadsRouter: IORouter;
+export declare function browserDownloads(fileNamePrefix?: string): IOHandler;
+export declare function browserFiles(files: File[]): IOHandler;
diff --git a/node_modules/@tensorflow/tfjs-core/dist/io/browser_files.js b/node_modules/@tensorflow/tfjs-core/dist/io/browser_files.js
new file mode 100644
index 0000000..3345b4f
--- /dev/null
+++ b/node_modules/@tensorflow/tfjs-core/dist/io/browser_files.js
@@ -0,0 +1,240 @@
+"use strict";
+var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
+ return new (P || (P = Promise))(function (resolve, reject) {
+ function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
+ function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
+ function step(result) { result.done ? resolve(result.value) : new P(function (resolve) { resolve(result.value); }).then(fulfilled, rejected); }
+ step((generator = generator.apply(thisArg, _arguments || [])).next());
+ });
+};
+var __generator = (this && this.__generator) || function (thisArg, body) {
+ var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;
+ return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
+ function verb(n) { return function (v) { return step([n, v]); }; }
+ function step(op) {
+ if (f) throw new TypeError("Generator is already executing.");
+ while (_) try {
+ if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;
+ if (y = 0, t) op = [op[0] & 2, t.value];
+ switch (op[0]) {
+ case 0: case 1: t = op; break;
+ case 4: _.label++; return { value: op[1], done: false };
+ case 5: _.label++; y = op[1]; op = [0]; continue;
+ case 7: op = _.ops.pop(); _.trys.pop(); continue;
+ default:
+ if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }
+ if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }
+ if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }
+ if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }
+ if (t[2]) _.ops.pop();
+ _.trys.pop(); continue;
+ }
+ op = body.call(thisArg, _);
+ } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }
+ if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };
+ }
+};
+Object.defineProperty(exports, "__esModule", { value: true });
+var environment_1 = require("../environment");
+var io_utils_1 = require("./io_utils");
+var router_registry_1 = require("./router_registry");
+var DEFAULT_FILE_NAME_PREFIX = 'model';
+var DEFAULT_JSON_EXTENSION_NAME = '.json';
+var DEFAULT_WEIGHT_DATA_EXTENSION_NAME = '.weights.bin';
+var BrowserDownloads = (function () {
+ function BrowserDownloads(fileNamePrefix) {
+ if (!environment_1.ENV.get('IS_BROWSER')) {
+ throw new Error('triggerDownloads() cannot proceed because the current environment ' +
+ 'is not a browser.');
+ }
+ if (fileNamePrefix.startsWith(BrowserDownloads.URL_SCHEME)) {
+ fileNamePrefix = fileNamePrefix.slice(BrowserDownloads.URL_SCHEME.length);
+ }
+ if (fileNamePrefix == null || fileNamePrefix.length === 0) {
+ fileNamePrefix = DEFAULT_FILE_NAME_PREFIX;
+ }
+ this.modelTopologyFileName = fileNamePrefix + DEFAULT_JSON_EXTENSION_NAME;
+ this.weightDataFileName =
+ fileNamePrefix + DEFAULT_WEIGHT_DATA_EXTENSION_NAME;
+ }
+ BrowserDownloads.prototype.save = function (modelArtifacts) {
+ return __awaiter(this, void 0, void 0, function () {
+ var weightsURL, weightsManifest, modelTopologyAndWeightManifest, modelTopologyAndWeightManifestURL, jsonAnchor, weightDataAnchor;
+ return __generator(this, function (_a) {
+ weightsURL = window.URL.createObjectURL(new Blob([modelArtifacts.weightData], { type: 'application/octet-stream' }));
+ if (modelArtifacts.modelTopology instanceof ArrayBuffer) {
+ throw new Error('DownloadTrigger.save() does not support saving model topology ' +
+ 'in binary formats yet.');
+ }
+ else {
+ weightsManifest = [{
+ paths: ['./' + this.weightDataFileName],
+ weights: modelArtifacts.weightSpecs
+ }];
+ modelTopologyAndWeightManifest = {
+ modelTopology: modelArtifacts.modelTopology,
+ weightsManifest: weightsManifest
+ };
+ modelTopologyAndWeightManifestURL = window.URL.createObjectURL(new Blob([JSON.stringify(modelTopologyAndWeightManifest)], { type: 'application/json' }));
+ jsonAnchor = this.jsonAnchor == null ? document.createElement('a') :
+ this.jsonAnchor;
+ jsonAnchor.download = this.modelTopologyFileName;
+ jsonAnchor.href = modelTopologyAndWeightManifestURL;
+ jsonAnchor.click();
+ if (modelArtifacts.weightData != null) {
+ weightDataAnchor = this.weightDataAnchor == null ?
+ document.createElement('a') :
+ this.weightDataAnchor;
+ weightDataAnchor.download = this.weightDataFileName;
+ weightDataAnchor.href = weightsURL;
+ weightDataAnchor.click();
+ }
+ return [2, { modelArtifactsInfo: io_utils_1.getModelArtifactsInfoForJSON(modelArtifacts) }];
+ }
+ return [2];
+ });
+ });
+ };
+ BrowserDownloads.URL_SCHEME = 'downloads://';
+ return BrowserDownloads;
+}());
+exports.BrowserDownloads = BrowserDownloads;
+var BrowserFiles = (function () {
+ function BrowserFiles(files) {
+ if (files == null || files.length < 1) {
+ throw new Error("When calling browserFiles, at least 1 file is required, " +
+ ("but received " + files));
+ }
+ this.files = files;
+ }
+ BrowserFiles.prototype.load = function () {
+ return __awaiter(this, void 0, void 0, function () {
+ var jsonFile, weightFiles;
+ var _this = this;
+ return __generator(this, function (_a) {
+ jsonFile = this.files[0];
+ weightFiles = this.files.slice(1);
+ return [2, new Promise(function (resolve, reject) {
+ var jsonReader = new FileReader();
+ jsonReader.onload = function (event) {
+ var modelJSON = JSON.parse(event.target.result);
+ var modelTopology = modelJSON.modelTopology;
+ if (modelTopology == null) {
+ reject(new Error("modelTopology field is missing from file " + jsonFile.name));
+ return;
+ }
+ if (weightFiles.length === 0) {
+ resolve({ modelTopology: modelTopology });
+ }
+ var weightsManifest = modelJSON.weightsManifest;
+ if (weightsManifest == null) {
+ reject(new Error("weightManifest field is missing from file " + jsonFile.name));
+ return;
+ }
+ var pathToFile;
+ try {
+ pathToFile =
+ _this.checkManifestAndWeightFiles(weightsManifest, weightFiles);
+ }
+ catch (err) {
+ reject(err);
+ return;
+ }
+ var weightSpecs = [];
+ var paths = [];
+ var perFileBuffers = [];
+ weightsManifest.forEach(function (weightsGroup) {
+ weightsGroup.paths.forEach(function (path) {
+ paths.push(path);
+ perFileBuffers.push(null);
+ });
+ weightSpecs.push.apply(weightSpecs, weightsGroup.weights);
+ });
+ weightsManifest.forEach(function (weightsGroup) {
+ weightsGroup.paths.forEach(function (path) {
+ var weightFileReader = new FileReader();
+ weightFileReader.onload = function (event) {
+ var weightData = event.target.result;
+ var index = paths.indexOf(path);
+ perFileBuffers[index] = weightData;
+ if (perFileBuffers.indexOf(null) === -1) {
+ resolve({
+ modelTopology: modelTopology,
+ weightSpecs: weightSpecs,
+ weightData: io_utils_1.concatenateArrayBuffers(perFileBuffers),
+ });
+ }
+ };
+ weightFileReader.onerror = function (error) {
+ reject("Failed to weights data from file of path '" + path + "'.");
+ return;
+ };
+ weightFileReader.readAsArrayBuffer(pathToFile[path]);
+ });
+ });
+ };
+ jsonReader.onerror = function (error) {
+ reject("Failed to read model topology and weights manifest JSON " +
+ ("from file '" + jsonFile.name + "'. BrowserFiles supports loading ") +
+ "Keras-style tf.Model artifacts only.");
+ return;
+ };
+ jsonReader.readAsText(jsonFile);
+ })];
+ });
+ });
+ };
+ BrowserFiles.prototype.checkManifestAndWeightFiles = function (manifest, files) {
+ var basenames = [];
+ var fileNames = files.map(function (file) { return io_utils_1.basename(file.name); });
+ var pathToFile = {};
+ for (var _i = 0, manifest_1 = manifest; _i < manifest_1.length; _i++) {
+ var group = manifest_1[_i];
+ group.paths.forEach(function (path) {
+ var pathBasename = io_utils_1.basename(path);
+ if (basenames.indexOf(pathBasename) !== -1) {
+ throw new Error("Duplicate file basename found in weights manifest: " +
+ ("'" + pathBasename + "'"));
+ }
+ basenames.push(pathBasename);
+ if (fileNames.indexOf(pathBasename) === -1) {
+ throw new Error("Weight file with basename '" + pathBasename + "' is not provided.");
+ }
+ else {
+ pathToFile[path] = files[fileNames.indexOf(pathBasename)];
+ }
+ });
+ }
+ if (basenames.length !== files.length) {
+ throw new Error("Mismatch in the number of files in weights manifest " +
+ ("(" + basenames.length + ") and the number of weight files provided ") +
+ ("(" + files.length + ")."));
+ }
+ return pathToFile;
+ };
+ return BrowserFiles;
+}());
+exports.browserDownloadsRouter = function (url) {
+ if (!environment_1.ENV.get('IS_BROWSER')) {
+ return null;
+ }
+ else {
+ if (url.startsWith(BrowserDownloads.URL_SCHEME)) {
+ return browserDownloads(url.slice(BrowserDownloads.URL_SCHEME.length));
+ }
+ else {
+ return null;
+ }
+ }
+};
+router_registry_1.IORouterRegistry.registerSaveRouter(exports.browserDownloadsRouter);
+function browserDownloads(fileNamePrefix) {
+ if (fileNamePrefix === void 0) { fileNamePrefix = 'model'; }
+ return new BrowserDownloads(fileNamePrefix);
+}
+exports.browserDownloads = browserDownloads;
+function browserFiles(files) {
+ return new BrowserFiles(files);
+}
+exports.browserFiles = browserFiles;
+//# sourceMappingURL=browser_files.js.map
\ No newline at end of file
diff --git a/node_modules/@tensorflow/tfjs-core/dist/io/browser_files.js.map b/node_modules/@tensorflow/tfjs-core/dist/io/browser_files.js.map
new file mode 100644
index 0000000..a9d4068
--- /dev/null
+++ b/node_modules/@tensorflow/tfjs-core/dist/io/browser_files.js.map
@@ -0,0 +1 @@
+{"version":3,"file":"browser_files.js","sourceRoot":"","sources":["../../src/io/browser_files.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAsBA,8CAAmC;AACnC,uCAA2F;AAC3F,qDAA6D;AAG7D,IAAM,wBAAwB,GAAG,OAAO,CAAC;AACzC,IAAM,2BAA2B,GAAG,OAAO,CAAC;AAC5C,IAAM,kCAAkC,GAAG,cAAc,CAAC;AAE1D;IAQE,0BAAY,cAAuB;QACjC,IAAI,CAAC,iBAAG,CAAC,GAAG,CAAC,YAAY,CAAC,EAAE;YAG1B,MAAM,IAAI,KAAK,CACX,oEAAoE;gBACpE,mBAAmB,CAAC,CAAC;SAC1B;QAED,IAAI,cAAc,CAAC,UAAU,CAAC,gBAAgB,CAAC,UAAU,CAAC,EAAE;YAC1D,cAAc,GAAG,cAAc,CAAC,KAAK,CAAC,gBAAgB,CAAC,UAAU,CAAC,MAAM,CAAC,CAAC;SAC3E;QACD,IAAI,cAAc,IAAI,IAAI,IAAI,cAAc,CAAC,MAAM,KAAK,CAAC,EAAE;YACzD,cAAc,GAAG,wBAAwB,CAAC;SAC3C;QAED,IAAI,CAAC,qBAAqB,GAAG,cAAc,GAAG,2BAA2B,CAAC;QAC1E,IAAI,CAAC,kBAAkB;YACnB,cAAc,GAAG,kCAAkC,CAAC;IAC1D,CAAC;IAEK,+BAAI,GAAV,UAAW,cAA8B;;;;gBACjC,UAAU,GAAG,MAAM,CAAC,GAAG,CAAC,eAAe,CAAC,IAAI,IAAI,CAClD,CAAC,cAAc,CAAC,UAAU,CAAC,EAAE,EAAC,IAAI,EAAE,0BAA0B,EAAC,CAAC,CAAC,C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,CAAC;AAFD,oCAEC"}
\ No newline at end of file
diff --git a/node_modules/@tensorflow/tfjs-core/dist/io/browser_files_test.d.ts b/node_modules/@tensorflow/tfjs-core/dist/io/browser_files_test.d.ts
new file mode 100644
index 0000000..cb0ff5c
--- /dev/null
+++ b/node_modules/@tensorflow/tfjs-core/dist/io/browser_files_test.d.ts
@@ -0,0 +1 @@
+export {};
diff --git a/node_modules/@tensorflow/tfjs-core/dist/io/browser_files_test.js b/node_modules/@tensorflow/tfjs-core/dist/io/browser_files_test.js
new file mode 100644
index 0000000..d0219ae
--- /dev/null
+++ b/node_modules/@tensorflow/tfjs-core/dist/io/browser_files_test.js
@@ -0,0 +1,689 @@
+"use strict";
+var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
+ return new (P || (P = Promise))(function (resolve, reject) {
+ function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
+ function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
+ function step(result) { result.done ? resolve(result.value) : new P(function (resolve) { resolve(result.value); }).then(fulfilled, rejected); }
+ step((generator = generator.apply(thisArg, _arguments || [])).next());
+ });
+};
+var __generator = (this && this.__generator) || function (thisArg, body) {
+ var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;
+ return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
+ function verb(n) { return function (v) { return step([n, v]); }; }
+ function step(op) {
+ if (f) throw new TypeError("Generator is already executing.");
+ while (_) try {
+ if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;
+ if (y = 0, t) op = [op[0] & 2, t.value];
+ switch (op[0]) {
+ case 0: case 1: t = op; break;
+ case 4: _.label++; return { value: op[1], done: false };
+ case 5: _.label++; y = op[1]; op = [0]; continue;
+ case 7: op = _.ops.pop(); _.trys.pop(); continue;
+ default:
+ if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }
+ if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }
+ if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }
+ if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }
+ if (t[2]) _.ops.pop();
+ _.trys.pop(); continue;
+ }
+ op = body.call(thisArg, _);
+ } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }
+ if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };
+ }
+};
+var _this = this;
+Object.defineProperty(exports, "__esModule", { value: true });
+var tf = require("../index");
+var jasmine_util_1 = require("../jasmine_util");
+var test_util_1 = require("../test_util");
+var browser_files_1 = require("./browser_files");
+var modelTopology1 = {
+ 'class_name': 'Sequential',
+ 'keras_version': '2.1.4',
+ 'config': [{
+ 'class_name': 'Dense',
+ 'config': {
+ 'kernel_initializer': {
+ 'class_name': 'VarianceScaling',
+ 'config': {
+ 'distribution': 'uniform',
+ 'scale': 1.0,
+ 'seed': null,
+ 'mode': 'fan_avg'
+ }
+ },
+ 'name': 'dense',
+ 'kernel_constraint': null,
+ 'bias_regularizer': null,
+ 'bias_constraint': null,
+ 'dtype': 'float32',
+ 'activation': 'linear',
+ 'trainable': true,
+ 'kernel_regularizer': null,
+ 'bias_initializer': { 'class_name': 'Zeros', 'config': {} },
+ 'units': 1,
+ 'batch_input_shape': [null, 3],
+ 'use_bias': true,
+ 'activity_regularizer': null
+ }
+ }],
+ 'backend': 'tensorflow'
+};
+var weightSpecs1 = [
+ {
+ name: 'dense/kernel',
+ shape: [3, 1],
+ dtype: 'float32',
+ },
+ {
+ name: 'dense/bias',
+ shape: [1],
+ dtype: 'float32',
+ }
+];
+var weightData1 = new ArrayBuffer(16);
+var artifacts1 = {
+ modelTopology: modelTopology1,
+ weightSpecs: weightSpecs1,
+ weightData: weightData1,
+};
+jasmine_util_1.describeWithFlags('browserDownloads', test_util_1.BROWSER_ENVS, function () {
+ var FakeHTMLAnchorElement = (function () {
+ function FakeHTMLAnchorElement() {
+ this.clicked = 0;
+ }
+ FakeHTMLAnchorElement.prototype.click = function () {
+ this.clicked++;
+ };
+ return FakeHTMLAnchorElement;
+ }());
+ var fakeAnchors = [];
+ var fakeAnchorCount = 0;
+ beforeEach(function () {
+ fakeAnchorCount = 0;
+ fakeAnchors = [new FakeHTMLAnchorElement(), new FakeHTMLAnchorElement()];
+ spyOn(document, 'createElement').and.callFake(function (tag) {
+ return fakeAnchors[fakeAnchorCount++];
+ });
+ });
+ it('Explicit file name prefix, with existing anchors', function (done) {
+ var testStartDate = new Date();
+ var downloadTrigger = tf.io.getSaveHandlers('downloads://test-model')[0];
+ downloadTrigger.save(artifacts1)
+ .then(function (saveResult) { return __awaiter(_this, void 0, void 0, function () {
+ var artifactsInfo, jsonAnchor, weightDataAnchor, jsonContent, modelTopologyAndWeightsManifest, _a, _b, weightsManifest, weightsContent, fileReader, _c, _d;
+ return __generator(this, function (_e) {
+ switch (_e.label) {
+ case 0:
+ expect(saveResult.errors).toEqual(undefined);
+ artifactsInfo = saveResult.modelArtifactsInfo;
+ expect(artifactsInfo.dateSaved.getTime())
+ .toBeGreaterThanOrEqual(testStartDate.getTime());
+ expect(saveResult.modelArtifactsInfo.modelTopologyBytes)
+ .toEqual(JSON.stringify(modelTopology1).length);
+ expect(saveResult.modelArtifactsInfo.weightSpecsBytes)
+ .toEqual(JSON.stringify(weightSpecs1).length);
+ expect(saveResult.modelArtifactsInfo.weightDataBytes).toEqual(16);
+ jsonAnchor = fakeAnchors[0];
+ weightDataAnchor = fakeAnchors[1];
+ expect(jsonAnchor.download).toEqual('test-model.json');
+ expect(weightDataAnchor.download).toEqual('test-model.weights.bin');
+ return [4, fetch(jsonAnchor.href)];
+ case 1:
+ jsonContent = _e.sent();
+ _b = (_a = JSON).parse;
+ return [4, jsonContent.text()];
+ case 2:
+ modelTopologyAndWeightsManifest = _b.apply(_a, [_e.sent()]);
+ expect(modelTopologyAndWeightsManifest.modelTopology)
+ .toEqual(modelTopology1);
+ weightsManifest = modelTopologyAndWeightsManifest.weightsManifest;
+ expect(weightsManifest.length).toEqual(1);
+ expect(weightsManifest[0].paths).toEqual([
+ './test-model.weights.bin'
+ ]);
+ expect(weightsManifest[0].weights).toEqual(weightSpecs1);
+ return [4, fetch(weightDataAnchor.href)];
+ case 3:
+ weightsContent = _e.sent();
+ fileReader = new FileReader();
+ fileReader.onload = function (event) {
+ var buffer = event.target.result;
+ expect(buffer).toEqual(weightData1);
+ done();
+ };
+ _d = (_c = fileReader).readAsArrayBuffer;
+ return [4, weightsContent.blob()];
+ case 4:
+ _d.apply(_c, [_e.sent()]);
+ expect(jsonAnchor.clicked).toEqual(1);
+ expect(weightDataAnchor.clicked).toEqual(1);
+ return [2];
+ }
+ });
+ }); })
+ .catch(function (err) {
+ done.fail(err.stack);
+ });
+ });
+ it('URL scheme in explicit name gets stripped', function (done) {
+ var testStartDate = new Date();
+ var downloadTrigger = browser_files_1.browserDownloads('downloads://test-model');
+ downloadTrigger.save(artifacts1)
+ .then(function (saveResult) { return __awaiter(_this, void 0, void 0, function () {
+ var artifactsInfo, jsonAnchor, weightDataAnchor, jsonContent, modelTopologyAndWeightsManifest, _a, _b, weightsManifest, weightsContent, fileReader, _c, _d;
+ return __generator(this, function (_e) {
+ switch (_e.label) {
+ case 0:
+ expect(saveResult.errors).toEqual(undefined);
+ artifactsInfo = saveResult.modelArtifactsInfo;
+ expect(artifactsInfo.dateSaved.getTime())
+ .toBeGreaterThanOrEqual(testStartDate.getTime());
+ expect(saveResult.modelArtifactsInfo.modelTopologyBytes)
+ .toEqual(JSON.stringify(modelTopology1).length);
+ expect(saveResult.modelArtifactsInfo.weightSpecsBytes)
+ .toEqual(JSON.stringify(weightSpecs1).length);
+ expect(saveResult.modelArtifactsInfo.weightDataBytes).toEqual(16);
+ jsonAnchor = fakeAnchors[0];
+ weightDataAnchor = fakeAnchors[1];
+ expect(jsonAnchor.download).toEqual('test-model.json');
+ expect(weightDataAnchor.download).toEqual('test-model.weights.bin');
+ return [4, fetch(jsonAnchor.href)];
+ case 1:
+ jsonContent = _e.sent();
+ _b = (_a = JSON).parse;
+ return [4, jsonContent.text()];
+ case 2:
+ modelTopologyAndWeightsManifest = _b.apply(_a, [_e.sent()]);
+ expect(modelTopologyAndWeightsManifest.modelTopology)
+ .toEqual(modelTopology1);
+ weightsManifest = modelTopologyAndWeightsManifest.weightsManifest;
+ expect(weightsManifest.length).toEqual(1);
+ expect(weightsManifest[0].paths).toEqual([
+ './test-model.weights.bin'
+ ]);
+ expect(weightsManifest[0].weights).toEqual(weightSpecs1);
+ return [4, fetch(weightDataAnchor.href)];
+ case 3:
+ weightsContent = _e.sent();
+ fileReader = new FileReader();
+ fileReader.onload = function (event) {
+ var buffer = event.target.result;
+ expect(buffer).toEqual(weightData1);
+ done();
+ };
+ _d = (_c = fileReader).readAsArrayBuffer;
+ return [4, weightsContent.blob()];
+ case 4:
+ _d.apply(_c, [_e.sent()]);
+ expect(jsonAnchor.clicked).toEqual(1);
+ expect(weightDataAnchor.clicked).toEqual(1);
+ return [2];
+ }
+ });
+ }); })
+ .catch(function (err) {
+ done.fail(err.stack);
+ });
+ });
+ it('No file name provided, with existing anchors', function (done) {
+ var testStartDate = new Date();
+ var downloadTrigger = browser_files_1.browserDownloads();
+ downloadTrigger.save(artifacts1)
+ .then(function (saveResult) { return __awaiter(_this, void 0, void 0, function () {
+ var artifactsInfo, jsonAnchor, weightDataAnchor, jsonContent, modelTopologyAndWeightsManifest, _a, _b, weightsManifest, weightsContent, fileReader, _c, _d;
+ return __generator(this, function (_e) {
+ switch (_e.label) {
+ case 0:
+ expect(saveResult.errors).toEqual(undefined);
+ artifactsInfo = saveResult.modelArtifactsInfo;
+ expect(artifactsInfo.dateSaved.getTime())
+ .toBeGreaterThanOrEqual(testStartDate.getTime());
+ expect(saveResult.modelArtifactsInfo.modelTopologyBytes)
+ .toEqual(JSON.stringify(modelTopology1).length);
+ expect(saveResult.modelArtifactsInfo.weightSpecsBytes)
+ .toEqual(JSON.stringify(weightSpecs1).length);
+ expect(saveResult.modelArtifactsInfo.weightDataBytes).toEqual(16);
+ jsonAnchor = fakeAnchors[0];
+ weightDataAnchor = fakeAnchors[1];
+ expect(jsonAnchor.download).toEqual('model.json');
+ expect(weightDataAnchor.download).toEqual('model.weights.bin');
+ return [4, fetch(jsonAnchor.href)];
+ case 1:
+ jsonContent = _e.sent();
+ _b = (_a = JSON).parse;
+ return [4, jsonContent.text()];
+ case 2:
+ modelTopologyAndWeightsManifest = _b.apply(_a, [_e.sent()]);
+ expect(modelTopologyAndWeightsManifest.modelTopology)
+ .toEqual(modelTopology1);
+ weightsManifest = modelTopologyAndWeightsManifest.weightsManifest;
+ expect(weightsManifest.length).toEqual(1);
+ expect(weightsManifest[0].paths).toEqual(['./model.weights.bin']);
+ expect(weightsManifest[0].weights).toEqual(weightSpecs1);
+ return [4, fetch(weightDataAnchor.href)];
+ case 3:
+ weightsContent = _e.sent();
+ fileReader = new FileReader();
+ fileReader.onload = function (event) {
+ var buffer = event.target.result;
+ expect(buffer).toEqual(weightData1);
+ done();
+ };
+ _d = (_c = fileReader).readAsArrayBuffer;
+ return [4, weightsContent.blob()];
+ case 4:
+ _d.apply(_c, [_e.sent()]);
+ return [2];
+ }
+ });
+ }); })
+ .catch(function (err) {
+ done.fail(err.stack);
+ });
+ });
+ it('Download only model topology', function (done) {
+ var testStartDate = new Date();
+ var downloadTrigger = browser_files_1.browserDownloads();
+ var modelTopologyOnlyArtifacts = {
+ modelTopology: modelTopology1,
+ };
+ downloadTrigger.save(modelTopologyOnlyArtifacts)
+ .then(function (saveResult) { return __awaiter(_this, void 0, void 0, function () {
+ var artifactsInfo, jsonAnchor, weightDataAnchor, jsonContent, modelTopologyAndWeightsManifest, _a, _b;
+ return __generator(this, function (_c) {
+ switch (_c.label) {
+ case 0:
+ expect(saveResult.errors).toEqual(undefined);
+ artifactsInfo = saveResult.modelArtifactsInfo;
+ expect(artifactsInfo.dateSaved.getTime())
+ .toBeGreaterThanOrEqual(testStartDate.getTime());
+ expect(saveResult.modelArtifactsInfo.modelTopologyBytes)
+ .toEqual(JSON.stringify(modelTopology1).length);
+ expect(saveResult.modelArtifactsInfo.weightSpecsBytes).toEqual(0);
+ expect(saveResult.modelArtifactsInfo.weightDataBytes).toEqual(0);
+ jsonAnchor = fakeAnchors[0];
+ weightDataAnchor = fakeAnchors[1];
+ expect(jsonAnchor.download).toEqual('model.json');
+ expect(jsonAnchor.clicked).toEqual(1);
+ expect(weightDataAnchor.download).toEqual(undefined);
+ expect(weightDataAnchor.clicked).toEqual(0);
+ return [4, fetch(jsonAnchor.href)];
+ case 1:
+ jsonContent = _c.sent();
+ _b = (_a = JSON).parse;
+ return [4, jsonContent.text()];
+ case 2:
+ modelTopologyAndWeightsManifest = _b.apply(_a, [_c.sent()]);
+ expect(modelTopologyAndWeightsManifest.modelTopology)
+ .toEqual(modelTopology1);
+ done();
+ return [2];
+ }
+ });
+ }); })
+ .catch(function (err) {
+ done.fail(err.stack);
+ });
+ });
+ it('browserDownloadsRouter', function () {
+ expect(browser_files_1.browserDownloadsRouter('downloads://foo') instanceof browser_files_1.BrowserDownloads)
+ .toEqual(true);
+ expect(browser_files_1.browserDownloadsRouter('invaliddownloads://foo')).toBeNull();
+ expect(browser_files_1.browserDownloadsRouter('foo')).toBeNull();
+ });
+});
+jasmine_util_1.describeWithFlags('browserFiles', test_util_1.BROWSER_ENVS, function () {
+ var weightsBlob = new Blob([weightData1], { type: 'application/octet-stream' });
+ var weightsFile = new File([weightsBlob], 'model.weights.bin', { type: 'application/octet-stream' });
+ it('One group, one path', function (done) {
+ var weightsManifest = [{
+ paths: ['./model.weights.bin'],
+ weights: weightSpecs1,
+ }];
+ var weightsTopologyAndManifest = {
+ modelTopology: modelTopology1,
+ weightsManifest: weightsManifest,
+ };
+ var jsonBlob = new Blob([JSON.stringify(weightsTopologyAndManifest)], { type: 'application/json' });
+ var jsonFile = new File([jsonBlob], 'model.json', { type: 'application/json' });
+ var filesHandler = tf.io.browserFiles([jsonFile, weightsFile]);
+ filesHandler.load()
+ .then(function (modelArtifacts) {
+ expect(modelArtifacts.modelTopology).toEqual(modelTopology1);
+ expect(modelArtifacts.weightSpecs).toEqual(weightSpecs1);
+ expect(new Uint8Array(modelArtifacts.weightData))
+ .toEqual(new Uint8Array(weightData1));
+ done();
+ })
+ .catch(function (err) {
+ done.fail(err.stack);
+ });
+ });
+ it("One group, two paths", function (done) {
+ var weightSpecs = [
+ {
+ name: 'foo',
+ shape: [1, 1],
+ dtype: 'float32',
+ },
+ {
+ name: 'bar',
+ shape: [1, 1],
+ dtype: 'float32',
+ }
+ ];
+ var weightsManifest = [{
+ paths: ['./dir1/model.weights.1.bin', './dir2/model.weights.2.bin'],
+ weights: weightSpecs,
+ }];
+ var weightsTopologyAndManifest = {
+ modelTopology: modelTopology1,
+ weightsManifest: weightsManifest,
+ };
+ var weightsBlob1 = new Blob([new Uint8Array([1, 2, 3, 4]).buffer], { type: 'application/octet-stream' });
+ var weightsFile1 = new File([weightsBlob1], 'model.weights.1.bin', { type: 'application/octet-stream' });
+ var weightsBlob2 = new Blob([new Uint8Array([10, 20, 30, 40]).buffer], { type: 'application/octet-stream' });
+ var weightsFile2 = new File([weightsBlob2], 'model.weights.2.bin', { type: 'application/octet-stream' });
+ var jsonBlob = new Blob([JSON.stringify(weightsTopologyAndManifest)], { type: 'application/json' });
+ var jsonFile = new File([jsonBlob], 'model.json', { type: 'application/json' });
+ var filesHandler = tf.io.browserFiles([jsonFile, weightsFile1, weightsFile2]);
+ filesHandler.load()
+ .then(function (modelArtifacts) {
+ expect(modelArtifacts.modelTopology).toEqual(modelTopology1);
+ expect(modelArtifacts.weightSpecs).toEqual(weightSpecs);
+ expect(new Uint8Array(modelArtifacts.weightData))
+ .toEqual(new Uint8Array([1, 2, 3, 4, 10, 20, 30, 40]));
+ done();
+ })
+ .catch(function (err) {
+ done.fail(err.stack);
+ });
+ });
+ it("Two groups, four paths, reverseOrder=false", function (done) {
+ var weightSpecs1 = [
+ {
+ name: 'foo',
+ shape: [1, 1],
+ dtype: 'float32',
+ },
+ {
+ name: 'bar',
+ shape: [1, 1],
+ dtype: 'float32',
+ }
+ ];
+ var weightSpecs2 = [
+ {
+ name: 'baz',
+ shape: [1, 1],
+ dtype: 'float32',
+ },
+ {
+ name: 'qux',
+ shape: [1, 1],
+ dtype: 'float32',
+ }
+ ];
+ var weightsManifest = [
+ {
+ paths: ['./model.weights.1.bin', './model.weights.2.bin'],
+ weights: weightSpecs1,
+ },
+ {
+ paths: ['./model.weights.3.bin', './model.weights.4.bin'],
+ weights: weightSpecs2,
+ }
+ ];
+ var weightsTopologyAndManifest = {
+ modelTopology: modelTopology1,
+ weightsManifest: weightsManifest,
+ };
+ var weightsBlob1 = new Blob([new Uint8Array([1, 3, 5, 7]).buffer], { type: 'application/octet-stream' });
+ var weightsFile1 = new File([weightsBlob1], 'model.weights.1.bin', { type: 'application/octet-stream' });
+ var weightsBlob2 = new Blob([new Uint8Array([10, 30, 50, 70]).buffer], { type: 'application/octet-stream' });
+ var weightsFile2 = new File([weightsBlob2], 'model.weights.2.bin', { type: 'application/octet-stream' });
+ var weightsBlob3 = new Blob([new Uint8Array([2, 4, 6, 8]).buffer], { type: 'application/octet-stream' });
+ var weightsFile3 = new File([weightsBlob3], 'model.weights.3.bin', { type: 'application/octet-stream' });
+ var weightsBlob4 = new Blob([new Uint8Array([20, 40, 60, 80]).buffer], { type: 'application/octet-stream' });
+ var weightsFile4 = new File([weightsBlob4], 'model.weights.4.bin', { type: 'application/octet-stream' });
+ var jsonBlob = new Blob([JSON.stringify(weightsTopologyAndManifest)], { type: 'application/json' });
+ var jsonFile = new File([jsonBlob], 'model.json', { type: 'application/json' });
+ var filesHandler = tf.io.browserFiles([jsonFile, weightsFile1, weightsFile2, weightsFile3, weightsFile4]);
+ filesHandler.load()
+ .then(function (modelArtifacts) {
+ expect(modelArtifacts.modelTopology).toEqual(modelTopology1);
+ expect(modelArtifacts.weightSpecs)
+ .toEqual(weightSpecs1.concat(weightSpecs2));
+ expect(new Uint8Array(modelArtifacts.weightData))
+ .toEqual(new Uint8Array([1, 3, 5, 7, 10, 30, 50, 70, 2, 4, 6, 8, 20, 40, 60, 80]));
+ done();
+ })
+ .catch(function (err) {
+ done.fail(err.stack);
+ });
+ });
+ it("Two groups, four paths, reverseOrder=true", function (done) {
+ var weightSpecs1 = [
+ {
+ name: 'foo',
+ shape: [1, 1],
+ dtype: 'float32',
+ },
+ {
+ name: 'bar',
+ shape: [1, 1],
+ dtype: 'float32',
+ }
+ ];
+ var weightSpecs2 = [
+ {
+ name: 'baz',
+ shape: [1, 1],
+ dtype: 'float32',
+ },
+ {
+ name: 'qux',
+ shape: [1, 1],
+ dtype: 'float32',
+ }
+ ];
+ var weightsManifest = [
+ {
+ paths: ['./model.weights.1.bin', './model.weights.2.bin'],
+ weights: weightSpecs1,
+ },
+ {
+ paths: ['./model.weights.3.bin', './model.weights.4.bin'],
+ weights: weightSpecs2,
+ }
+ ];
+ var weightsTopologyAndManifest = {
+ modelTopology: modelTopology1,
+ weightsManifest: weightsManifest,
+ };
+ var weightsBlob1 = new Blob([new Uint8Array([1, 3, 5, 7]).buffer], { type: 'application/octet-stream' });
+ var weightsFile1 = new File([weightsBlob1], 'model.weights.1.bin', { type: 'application/octet-stream' });
+ var weightsBlob2 = new Blob([new Uint8Array([10, 30, 50, 70]).buffer], { type: 'application/octet-stream' });
+ var weightsFile2 = new File([weightsBlob2], 'model.weights.2.bin', { type: 'application/octet-stream' });
+ var weightsBlob3 = new Blob([new Uint8Array([2, 4, 6, 8]).buffer], { type: 'application/octet-stream' });
+ var weightsFile3 = new File([weightsBlob3], 'model.weights.3.bin', { type: 'application/octet-stream' });
+ var weightsBlob4 = new Blob([new Uint8Array([20, 40, 60, 80]).buffer], { type: 'application/octet-stream' });
+ var weightsFile4 = new File([weightsBlob4], 'model.weights.4.bin', { type: 'application/octet-stream' });
+ var jsonBlob = new Blob([JSON.stringify(weightsTopologyAndManifest)], { type: 'application/json' });
+ var jsonFile = new File([jsonBlob], 'model.json', { type: 'application/json' });
+ var filesHandler = tf.io.browserFiles([jsonFile, weightsFile4, weightsFile3, weightsFile2, weightsFile1]);
+ filesHandler.load()
+ .then(function (modelArtifacts) {
+ expect(modelArtifacts.modelTopology).toEqual(modelTopology1);
+ expect(modelArtifacts.weightSpecs)
+ .toEqual(weightSpecs1.concat(weightSpecs2));
+ expect(new Uint8Array(modelArtifacts.weightData))
+ .toEqual(new Uint8Array([1, 3, 5, 7, 10, 30, 50, 70, 2, 4, 6, 8, 20, 40, 60, 80]));
+ done();
+ })
+ .catch(function (err) {
+ done.fail(err.stack);
+ });
+ });
+ it('Upload model topology only', function (done) {
+ var weightsManifest = [{
+ paths: ['./model.weights.bin'],
+ weights: weightSpecs1,
+ }];
+ var weightsTopologyAndManifest = {
+ modelTopology: modelTopology1,
+ weightsManifest: weightsManifest,
+ };
+ var jsonBlob = new Blob([JSON.stringify(weightsTopologyAndManifest)], { type: 'application/json' });
+ var jsonFile = new File([jsonBlob], 'model.json', { type: 'application/json' });
+ var filesHandler = tf.io.browserFiles([jsonFile]);
+ filesHandler.load()
+ .then(function (modelArtifacts) {
+ expect(modelArtifacts.modelTopology).toEqual(modelTopology1);
+ expect(modelArtifacts.weightSpecs).toEqual(undefined);
+ done();
+ })
+ .catch(function (err) {
+ done.fail(err.stack);
+ });
+ });
+ it('Mismatch in number of paths and number of files', function (done) {
+ var weightsManifest = [{
+ paths: ['./model.weights.1.bin'],
+ weights: weightSpecs1,
+ }];
+ var weightsTopologyAndManifest = {
+ modelTopology: weightSpecs1,
+ weightsManifest: weightsManifest,
+ };
+ var weightsBlob1 = new Blob([new Uint8Array([1, 2, 3, 4]).buffer], { type: 'application/octet-stream' });
+ var weightsFile1 = new File([weightsBlob1], 'model.weights.1.bin', { type: 'application/octet-stream' });
+ var weightsBlob2 = new Blob([new Uint8Array([10, 20, 30, 40]).buffer], { type: 'application/octet-stream' });
+ var weightsFile2 = new File([weightsBlob2], 'model.weights.2.bin', { type: 'application/octet-stream' });
+ var jsonBlob = new Blob([JSON.stringify(weightsTopologyAndManifest)], { type: 'application/json' });
+ var jsonFile = new File([jsonBlob], 'model.json', { type: 'application/json' });
+ var filesHandler = tf.io.browserFiles([jsonFile, weightsFile2, weightsFile1]);
+ filesHandler.load()
+ .then(function (modelArtifacts) {
+ done.fail('Loading with mismatch in number of paths and number of files ' +
+ 'succeeded unexpectedly.');
+ })
+ .catch(function (err) {
+ expect(err.message)
+ .toEqual('Mismatch in the number of files in weights manifest (1) ' +
+ 'and the number of weight files provided (2).');
+ done();
+ });
+ });
+ it('Mismatch in manifest paths and file names', function (done) {
+ var weightSpecs = [
+ {
+ name: 'foo',
+ shape: [1, 1],
+ dtype: 'float32',
+ },
+ {
+ name: 'bar',
+ shape: [1, 1],
+ dtype: 'float32',
+ }
+ ];
+ var weightsManifest = [{
+ paths: ['./model.weights.1.bin', './model.weights.2.bin'],
+ weights: weightSpecs,
+ }];
+ var weightsTopologyAndManifest = {
+ modelTopology: modelTopology1,
+ weightsManifest: weightsManifest,
+ };
+ var weightsBlob1 = new Blob([new Uint8Array([1, 2, 3, 4]).buffer], { type: 'application/octet-stream' });
+ var weightsFile1 = new File([weightsBlob1], 'model.weights.1.bin', { type: 'application/octet-stream' });
+ var weightsBlob2 = new Blob([new Uint8Array([10, 20, 30, 40]).buffer], { type: 'application/octet-stream' });
+ var weightsFile2 = new File([weightsBlob2], 'model.weights.3.bin', { type: 'application/octet-stream' });
+ var jsonBlob = new Blob([JSON.stringify(weightsTopologyAndManifest)], { type: 'application/json' });
+ var jsonFile = new File([jsonBlob], 'model.json', { type: 'application/json' });
+ var filesHandler = tf.io.browserFiles([jsonFile, weightsFile1, weightsFile2]);
+ filesHandler.load()
+ .then(function (modelArtifacts) {
+ done.fail('Loading with mismatching paths and file names ' +
+ 'succeeded unexpectedly.');
+ })
+ .catch(function (err) {
+ expect(err.message)
+ .toEqual('Weight file with basename \'model.weights.2.bin\' is not ' +
+ 'provided.');
+ done();
+ });
+ });
+ it('Duplicate basenames in paths fails', function (done) {
+ var weightSpecs = [
+ {
+ name: 'foo',
+ shape: [1, 1],
+ dtype: 'float32',
+ },
+ {
+ name: 'bar',
+ shape: [1, 1],
+ dtype: 'float32',
+ }
+ ];
+ var weightsManifest = [{
+ paths: ['./dir1/model.weights.1.bin', './dir2/model.weights.1.bin'],
+ weights: weightSpecs,
+ }];
+ var weightsTopologyAndManifest = {
+ modelTopology: modelTopology1,
+ weightsManifest: weightsManifest,
+ };
+ var weightsBlob1 = new Blob([new Uint8Array([1, 2, 3, 4]).buffer], { type: 'application/octet-stream' });
+ var weightsFile1 = new File([weightsBlob1], 'model.weights.1.bin', { type: 'application/octet-stream' });
+ var weightsBlob2 = new Blob([new Uint8Array([10, 20, 30, 40]).buffer], { type: 'application/octet-stream' });
+ var weightsFile2 = new File([weightsBlob2], 'model.weights.2.bin', { type: 'application/octet-stream' });
+ var jsonBlob = new Blob([JSON.stringify(weightsTopologyAndManifest)], { type: 'application/json' });
+ var jsonFile = new File([jsonBlob], 'model.json', { type: 'application/json' });
+ var filesHandler = tf.io.browserFiles([jsonFile, weightsFile1, weightsFile2]);
+ filesHandler.load()
+ .then(function (modelArtifacts) {
+ done.fail('Loading with duplicate basenames in paths ' +
+ 'succeeded unexpectedly.');
+ })
+ .catch(function (err) {
+ expect(err.message)
+ .toEqual('Duplicate file basename found in weights manifest: ' +
+ '\'model.weights.1.bin\'');
+ done();
+ });
+ });
+ it('Missing modelTopology from JSON leads to Error', function (done) {
+ var weightsManifest = [{
+ paths: ['./model.weights.bin'],
+ weights: weightSpecs1,
+ }];
+ var weightsTopologyAndManifest = {
+ weightsManifest: weightsManifest,
+ };
+ var jsonBlob = new Blob([JSON.stringify(weightsTopologyAndManifest)], { type: 'application/json' });
+ var jsonFile = new File([jsonBlob], 'model.json', { type: 'application/json' });
+ var filesHandler = tf.io.browserFiles([jsonFile, weightsFile]);
+ filesHandler.load()
+ .then(function (modelArtifacts) {
+ done.fail('Loading with Files IOHandler with missing modelTopology ' +
+ 'succeeded unexpectedly.');
+ })
+ .catch(function (err) {
+ expect(err.message)
+ .toMatch(/modelTopology field is missing from file model\.json/);
+ done();
+ });
+ });
+ it('Incorrect number of files leads to Error', function () {
+ expect(function () { return tf.io.browserFiles(null); }).toThrowError(/at least 1 file/);
+ expect(function () { return tf.io.browserFiles([]); }).toThrowError(/at least 1 file/);
+ });
+});
+//# sourceMappingURL=browser_files_test.js.map
\ No newline at end of file
diff --git a/node_modules/@tensorflow/tfjs-core/dist/io/browser_files_test.js.map b/node_modules/@tensorflow/tfjs-core/dist/io/browser_files_test.js.map
new file mode 100644
index 0000000..8799dee
--- /dev/null
+++ b/node_modules/@tensorflow/tfjs-core/dist/io/browser_files_test.js.map
@@ -0,0 +1 @@
+{"version":3,"file":"browser_files_test.js","sourceRoot":"","sources":["../../src/io/browser_files_test.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAqBA,iBA+wBA;;AA/wBA,6BAA+B;AAC/B,gDAAkD;AAClD,0CAA0C;AAC1C,iDAA2F;AAG3F,IAAM,cAAc,GAAO;IACzB,YAAY,EAAE,YAAY;IAC1B,eAAe,EAAE,OAAO;IACxB,QAAQ,EAAE,CAAC;YACT,YAAY,EAAE,OAAO;YACrB,QAAQ,EAAE;gBACR,oBAAoB,EAAE;oBACpB,YAAY,EAAE,iBAAiB;oBAC/B,QAAQ,EAAE;wBACR,cAAc,EAAE,SAAS;wBACzB,OAAO,EAAE,GAAG;wBACZ,MAAM,EAAE,IAAI;wBACZ,MAAM,EAAE,SAAS;qBAClB;iBACF;gBACD,MAAM,EAAE,OAAO;gBACf,mBAAmB,EAAE,IAAI;gBACzB,kBAAkB,EAAE,IAAI;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AC,OAAO,CAAC;iBACd,OAAO,CAAC,sDAAsD,CAAC,CAAC;YACrE,IAAI,EAAE,CAAC;QACT,CAAC,CAAC,CAAC;IACT,CAAC,CAAC,CAAC;IAEH,EAAE,CAAC,0CAA0C,EAAE;QAC7C,MAAM,CAAC,cAAM,OAAA,EAAE,CAAC,EAAE,CAAC,YAAY,CAAC,IAAI,CAAC,EAAxB,CAAwB,CAAC,CAAC,YAAY,CAAC,iBAAiB,CAAC,CAAC;QACvE,MAAM,CAAC,cAAM,OAAA,EAAE,CAAC,EAAE,CAAC,YAAY,CAAC,EAAE,CAAC,EAAtB,CAAsB,CAAC,CAAC,YAAY,CAAC,iBAAiB,CAAC,CAAC;IACvE,CAAC,CAAC,CAAC;AACL,CAAC,CAAC,CAAC"}
\ No newline at end of file
diff --git a/node_modules/@tensorflow/tfjs-core/dist/io/browser_http.d.ts b/node_modules/@tensorflow/tfjs-core/dist/io/browser_http.d.ts
new file mode 100644
index 0000000..3c32af5
--- /dev/null
+++ b/node_modules/@tensorflow/tfjs-core/dist/io/browser_http.d.ts
@@ -0,0 +1,13 @@
+import { IORouter } from './router_registry';
+import { IOHandler, ModelArtifacts, SaveResult } from './types';
+export declare class BrowserHTTPRequest implements IOHandler {
+ protected readonly path: string;
+ protected readonly requestInit: RequestInit;
+ readonly DEFAULT_METHOD: string;
+ static readonly URL_SCHEMES: string[];
+ constructor(path: string, requestInit?: RequestInit);
+ save(modelArtifacts: ModelArtifacts): Promise;
+ load(): Promise;
+}
+export declare const httpRequestRouter: IORouter;
+export declare function browserHTTPRequest(path: string, requestInit?: RequestInit): IOHandler;
diff --git a/node_modules/@tensorflow/tfjs-core/dist/io/browser_http.js b/node_modules/@tensorflow/tfjs-core/dist/io/browser_http.js
new file mode 100644
index 0000000..c7c449b
--- /dev/null
+++ b/node_modules/@tensorflow/tfjs-core/dist/io/browser_http.js
@@ -0,0 +1,166 @@
+"use strict";
+var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
+ return new (P || (P = Promise))(function (resolve, reject) {
+ function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
+ function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
+ function step(result) { result.done ? resolve(result.value) : new P(function (resolve) { resolve(result.value); }).then(fulfilled, rejected); }
+ step((generator = generator.apply(thisArg, _arguments || [])).next());
+ });
+};
+var __generator = (this && this.__generator) || function (thisArg, body) {
+ var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;
+ return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
+ function verb(n) { return function (v) { return step([n, v]); }; }
+ function step(op) {
+ if (f) throw new TypeError("Generator is already executing.");
+ while (_) try {
+ if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;
+ if (y = 0, t) op = [op[0] & 2, t.value];
+ switch (op[0]) {
+ case 0: case 1: t = op; break;
+ case 4: _.label++; return { value: op[1], done: false };
+ case 5: _.label++; y = op[1]; op = [0]; continue;
+ case 7: op = _.ops.pop(); _.trys.pop(); continue;
+ default:
+ if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }
+ if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }
+ if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }
+ if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }
+ if (t[2]) _.ops.pop();
+ _.trys.pop(); continue;
+ }
+ op = body.call(thisArg, _);
+ } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }
+ if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };
+ }
+};
+Object.defineProperty(exports, "__esModule", { value: true });
+var util_1 = require("../util");
+var io_utils_1 = require("./io_utils");
+var router_registry_1 = require("./router_registry");
+var weights_loader_1 = require("./weights_loader");
+var BrowserHTTPRequest = (function () {
+ function BrowserHTTPRequest(path, requestInit) {
+ this.DEFAULT_METHOD = 'POST';
+ if (typeof fetch === 'undefined') {
+ throw new Error('browserHTTPRequest is not supported outside the web browser without a fetch polyfill.');
+ }
+ util_1.assert(path != null && path.length > 0, 'URL path for browserHTTPRequest must not be null, undefined or ' +
+ 'empty.');
+ this.path = path;
+ if (requestInit != null && requestInit.body != null) {
+ throw new Error('requestInit is expected to have no pre-existing body, but has one.');
+ }
+ this.requestInit = requestInit || {};
+ }
+ BrowserHTTPRequest.prototype.save = function (modelArtifacts) {
+ return __awaiter(this, void 0, void 0, function () {
+ var init, weightsManifest, modelTopologyAndWeightManifest, response;
+ return __generator(this, function (_a) {
+ switch (_a.label) {
+ case 0:
+ if (modelArtifacts.modelTopology instanceof ArrayBuffer) {
+ throw new Error('BrowserHTTPRequest.save() does not support saving model topology ' +
+ 'in binary formats yet.');
+ }
+ init = Object.assign({ method: this.DEFAULT_METHOD }, this.requestInit);
+ init.body = new FormData();
+ weightsManifest = [{
+ paths: ['./model.weights.bin'],
+ weights: modelArtifacts.weightSpecs,
+ }];
+ modelTopologyAndWeightManifest = {
+ modelTopology: modelArtifacts.modelTopology,
+ weightsManifest: weightsManifest
+ };
+ init.body.append('model.json', new Blob([JSON.stringify(modelTopologyAndWeightManifest)], { type: 'application/json' }), 'model.json');
+ if (modelArtifacts.weightData != null) {
+ init.body.append('model.weights.bin', new Blob([modelArtifacts.weightData], { type: 'application/octet-stream' }), 'model.weights.bin');
+ }
+ return [4, fetch(this.path, init)];
+ case 1:
+ response = _a.sent();
+ if (response.status === 200) {
+ return [2, {
+ modelArtifactsInfo: io_utils_1.getModelArtifactsInfoForJSON(modelArtifacts),
+ responses: [response],
+ }];
+ }
+ else {
+ throw new Error("BrowserHTTPRequest.save() failed due to HTTP response status " +
+ (response.status + "."));
+ }
+ return [2];
+ }
+ });
+ });
+ };
+ BrowserHTTPRequest.prototype.load = function () {
+ return __awaiter(this, void 0, void 0, function () {
+ var modelConfigRequest, modelConfig, modelTopology, weightsManifest, weightSpecs, weightData, weightsManifest_2, _i, weightsManifest_1, entry, pathPrefix_1, fetchURLs_1, _a;
+ return __generator(this, function (_b) {
+ switch (_b.label) {
+ case 0: return [4, fetch(this.path, this.requestInit)];
+ case 1:
+ modelConfigRequest = _b.sent();
+ return [4, modelConfigRequest.json()];
+ case 2:
+ modelConfig = _b.sent();
+ modelTopology = modelConfig['modelTopology'];
+ weightsManifest = modelConfig['weightsManifest'];
+ if (modelTopology == null && weightsManifest == null) {
+ throw new Error("The JSON from HTTP path " + this.path + " contains neither model " +
+ "topology or manifest for weights.");
+ }
+ if (!(weightsManifest != null)) return [3, 4];
+ weightsManifest_2 = modelConfig['weightsManifest'];
+ weightSpecs = [];
+ for (_i = 0, weightsManifest_1 = weightsManifest_2; _i < weightsManifest_1.length; _i++) {
+ entry = weightsManifest_1[_i];
+ weightSpecs.push.apply(weightSpecs, entry.weights);
+ }
+ pathPrefix_1 = this.path.substring(0, this.path.lastIndexOf('/'));
+ if (!pathPrefix_1.endsWith('/')) {
+ pathPrefix_1 = pathPrefix_1 + '/';
+ }
+ fetchURLs_1 = [];
+ weightsManifest_2.forEach(function (weightsGroup) {
+ weightsGroup.paths.forEach(function (path) {
+ fetchURLs_1.push(pathPrefix_1 + path);
+ });
+ });
+ _a = io_utils_1.concatenateArrayBuffers;
+ return [4, weights_loader_1.loadWeightsAsArrayBuffer(fetchURLs_1, this.requestInit)];
+ case 3:
+ weightData = _a.apply(void 0, [_b.sent()]);
+ _b.label = 4;
+ case 4: return [2, { modelTopology: modelTopology, weightSpecs: weightSpecs, weightData: weightData }];
+ }
+ });
+ });
+ };
+ BrowserHTTPRequest.URL_SCHEMES = ['http://', 'https://'];
+ return BrowserHTTPRequest;
+}());
+exports.BrowserHTTPRequest = BrowserHTTPRequest;
+exports.httpRequestRouter = function (url) {
+ if (typeof fetch === 'undefined') {
+ return null;
+ }
+ else {
+ for (var _i = 0, _a = BrowserHTTPRequest.URL_SCHEMES; _i < _a.length; _i++) {
+ var scheme = _a[_i];
+ if (url.startsWith(scheme)) {
+ return browserHTTPRequest(url);
+ }
+ }
+ return null;
+ }
+};
+router_registry_1.IORouterRegistry.registerSaveRouter(exports.httpRequestRouter);
+router_registry_1.IORouterRegistry.registerLoadRouter(exports.httpRequestRouter);
+function browserHTTPRequest(path, requestInit) {
+ return new BrowserHTTPRequest(path, requestInit);
+}
+exports.browserHTTPRequest = browserHTTPRequest;
+//# sourceMappingURL=browser_http.js.map
\ No newline at end of file
diff --git a/node_modules/@tensorflow/tfjs-core/dist/io/browser_http.js.map b/node_modules/@tensorflow/tfjs-core/dist/io/browser_http.js.map
new file mode 100644
index 0000000..6a82867
--- /dev/null
+++ b/node_modules/@tensorflow/tfjs-core/dist/io/browser_http.js.map
@@ -0,0 +1 @@
+{"version":3,"file":"browser_http.js","sourceRoot":"","sources":["../../src/io/browser_http.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAuBA,gCAA+B;AAC/B,uCAAiF;AACjF,qDAA6D;AAE7D,mDAA0D;AAE1D;IAQE,4BAAY,IAAY,EAAE,WAAyB;QAJ1C,mBAAc,GAAG,MAAM,CAAC;QAK/B,IAAI,OAAO,KAAK,KAAK,WAAW,EAAE;YAChC,MAAM,IAAI,KAAK,CAEX,uFAAuF,CAAC,CAAC;SAC9F;QAED,aAAM,CACF,IAAI,IAAI,IAAI,IAAI,IAAI,CAAC,MAAM,GAAG,CAAC,EAC/B,iEAAiE;YAC7D,QAAQ,CAAC,CAAC;QAClB,IAAI,CAAC,IAAI,GAAG,IAAI,CAAC;QAEjB,IAAI,WAAW,IAAI,IAAI,IAAI,WAAW,CAAC,IAAI,IAAI,IAAI,EAAE;YACnD,MAAM,IAAI,KAAK,CACX,oEAAoE,CAAC,CAAC;SAC3E;QACD,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ts b/node_modules/@tensorflow/tfjs-core/dist/io/browser_http_test.d.ts
new file mode 100644
index 0000000..cb0ff5c
--- /dev/null
+++ b/node_modules/@tensorflow/tfjs-core/dist/io/browser_http_test.d.ts
@@ -0,0 +1 @@
+export {};
diff --git a/node_modules/@tensorflow/tfjs-core/dist/io/browser_http_test.js b/node_modules/@tensorflow/tfjs-core/dist/io/browser_http_test.js
new file mode 100644
index 0000000..6a60279
--- /dev/null
+++ b/node_modules/@tensorflow/tfjs-core/dist/io/browser_http_test.js
@@ -0,0 +1,576 @@
+"use strict";
+Object.defineProperty(exports, "__esModule", { value: true });
+var tf = require("../index");
+var jasmine_util_1 = require("../jasmine_util");
+var test_util_1 = require("../test_util");
+var browser_http_1 = require("./browser_http");
+var modelTopology1 = {
+ 'class_name': 'Sequential',
+ 'keras_version': '2.1.4',
+ 'config': [{
+ 'class_name': 'Dense',
+ 'config': {
+ 'kernel_initializer': {
+ 'class_name': 'VarianceScaling',
+ 'config': {
+ 'distribution': 'uniform',
+ 'scale': 1.0,
+ 'seed': null,
+ 'mode': 'fan_avg'
+ }
+ },
+ 'name': 'dense',
+ 'kernel_constraint': null,
+ 'bias_regularizer': null,
+ 'bias_constraint': null,
+ 'dtype': 'float32',
+ 'activation': 'linear',
+ 'trainable': true,
+ 'kernel_regularizer': null,
+ 'bias_initializer': { 'class_name': 'Zeros', 'config': {} },
+ 'units': 1,
+ 'batch_input_shape': [null, 3],
+ 'use_bias': true,
+ 'activity_regularizer': null
+ }
+ }],
+ 'backend': 'tensorflow'
+};
+jasmine_util_1.describeWithFlags('browserHTTPRequest-load fetch-polyfill', test_util_1.NODE_ENVS, function () {
+ var requestInits;
+ beforeEach(function () {
+ global.fetch = function () { };
+ requestInits = [];
+ });
+ afterAll(function () {
+ delete global.fetch;
+ });
+ var fakeResponse = function (body) { return ({
+ json: function () {
+ return Promise.resolve(JSON.parse(body));
+ },
+ arrayBuffer: function () {
+ var buf = body.buffer ?
+ body.buffer :
+ body;
+ return Promise.resolve(buf);
+ }
+ }); };
+ var setupFakeWeightFiles = function (fileBufferMap) {
+ spyOn(global, 'fetch')
+ .and.callFake(function (path, init) {
+ requestInits.push(init);
+ return fakeResponse(fileBufferMap[path]);
+ });
+ };
+ it('1 group, 2 weights, 1 path', function (done) {
+ var weightManifest1 = [{
+ paths: ['weightfile0'],
+ weights: [
+ {
+ name: 'dense/kernel',
+ shape: [3, 1],
+ dtype: 'float32',
+ },
+ {
+ name: 'dense/bias',
+ shape: [2],
+ dtype: 'float32',
+ }
+ ]
+ }];
+ var floatData = new Float32Array([1, 3, 3, 7, 4]);
+ setupFakeWeightFiles({
+ './model.json': JSON.stringify({ modelTopology: modelTopology1, weightsManifest: weightManifest1 }),
+ './weightfile0': floatData,
+ });
+ var handler = tf.io.browserHTTPRequest('./model.json');
+ handler.load()
+ .then(function (modelArtifacts) {
+ expect(modelArtifacts.modelTopology).toEqual(modelTopology1);
+ expect(modelArtifacts.weightSpecs)
+ .toEqual(weightManifest1[0].weights);
+ expect(new Float32Array(modelArtifacts.weightData))
+ .toEqual(floatData);
+ expect(requestInits).toEqual([{}, {}]);
+ done();
+ })
+ .catch(function (err) { return done.fail(err.stack); });
+ });
+ it('throw exception if no fetch polyfill', function () {
+ delete global.fetch;
+ try {
+ tf.io.browserHTTPRequest('./model.json');
+ }
+ catch (err) {
+ expect(err.message)
+ .toMatch(/not supported outside the web browser without a fetch polyfill/);
+ }
+ });
+});
+jasmine_util_1.describeWithFlags('browserHTTPRequest-save', test_util_1.CHROME_ENVS, function () {
+ var weightSpecs1 = [
+ {
+ name: 'dense/kernel',
+ shape: [3, 1],
+ dtype: 'float32',
+ },
+ {
+ name: 'dense/bias',
+ shape: [1],
+ dtype: 'float32',
+ }
+ ];
+ var weightData1 = new ArrayBuffer(16);
+ var artifacts1 = {
+ modelTopology: modelTopology1,
+ weightSpecs: weightSpecs1,
+ weightData: weightData1,
+ };
+ var requestInits = [];
+ beforeEach(function () {
+ requestInits = [];
+ spyOn(window, 'fetch').and.callFake(function (path, init) {
+ if (path === 'model-upload-test' || path === 'http://model-upload-test') {
+ requestInits.push(init);
+ return new Response(null, { status: 200 });
+ }
+ else {
+ return new Response(null, { status: 404 });
+ }
+ });
+ });
+ it('Save topology and weights, default POST method', function (done) {
+ var testStartDate = new Date();
+ var handler = tf.io.getSaveHandlers('http://model-upload-test')[0];
+ handler.save(artifacts1)
+ .then(function (saveResult) {
+ expect(saveResult.modelArtifactsInfo.dateSaved.getTime())
+ .toBeGreaterThanOrEqual(testStartDate.getTime());
+ expect(saveResult.modelArtifactsInfo.modelTopologyBytes)
+ .toEqual(JSON.stringify(modelTopology1).length);
+ expect(saveResult.modelArtifactsInfo.weightSpecsBytes)
+ .toEqual(JSON.stringify(weightSpecs1).length);
+ expect(saveResult.modelArtifactsInfo.weightDataBytes)
+ .toEqual(weightData1.byteLength);
+ expect(requestInits.length).toEqual(1);
+ var init = requestInits[0];
+ expect(init.method).toEqual('POST');
+ var body = init.body;
+ var jsonFile = body.get('model.json');
+ var jsonFileReader = new FileReader();
+ jsonFileReader.onload = function (event) {
+ var modelJSON = JSON.parse(event.target.result);
+ expect(modelJSON.modelTopology).toEqual(modelTopology1);
+ expect(modelJSON.weightsManifest.length).toEqual(1);
+ expect(modelJSON.weightsManifest[0].weights).toEqual(weightSpecs1);
+ var weightsFile = body.get('model.weights.bin');
+ var weightsFileReader = new FileReader();
+ weightsFileReader.onload = function (event) {
+ var weightData = event.target.result;
+ expect(new Uint8Array(weightData))
+ .toEqual(new Uint8Array(weightData1));
+ done();
+ };
+ weightsFileReader.onerror = function (error) {
+ done.fail(error.target.error.message);
+ };
+ weightsFileReader.readAsArrayBuffer(weightsFile);
+ };
+ jsonFileReader.onerror = function (error) {
+ done.fail(error.target.error.message);
+ };
+ jsonFileReader.readAsText(jsonFile);
+ })
+ .catch(function (err) {
+ done.fail(err.stack);
+ });
+ });
+ it('Save topology only, default POST method', function (done) {
+ var testStartDate = new Date();
+ var handler = tf.io.getSaveHandlers('http://model-upload-test')[0];
+ var topologyOnlyArtifacts = { modelTopology: modelTopology1 };
+ handler.save(topologyOnlyArtifacts)
+ .then(function (saveResult) {
+ expect(saveResult.modelArtifactsInfo.dateSaved.getTime())
+ .toBeGreaterThanOrEqual(testStartDate.getTime());
+ expect(saveResult.modelArtifactsInfo.modelTopologyBytes)
+ .toEqual(JSON.stringify(modelTopology1).length);
+ expect(saveResult.modelArtifactsInfo.weightSpecsBytes).toEqual(0);
+ expect(saveResult.modelArtifactsInfo.weightDataBytes).toEqual(0);
+ expect(requestInits.length).toEqual(1);
+ var init = requestInits[0];
+ expect(init.method).toEqual('POST');
+ var body = init.body;
+ var jsonFile = body.get('model.json');
+ var jsonFileReader = new FileReader();
+ jsonFileReader.onload = function (event) {
+ var modelJSON = JSON.parse(event.target.result);
+ expect(modelJSON.modelTopology).toEqual(modelTopology1);
+ expect(body.get('model.weights.bin')).toEqual(null);
+ done();
+ };
+ jsonFileReader.onerror = function (error) {
+ done.fail(error.target.error.message);
+ };
+ jsonFileReader.readAsText(jsonFile);
+ })
+ .catch(function (err) {
+ done.fail(err.stack);
+ });
+ });
+ it('Save topology and weights, PUT method, extra headers', function (done) {
+ var testStartDate = new Date();
+ var handler = tf.io.browserHTTPRequest('model-upload-test', {
+ method: 'PUT',
+ headers: {
+ 'header_key_1': 'header_value_1',
+ 'header_key_2': 'header_value_2'
+ }
+ });
+ handler.save(artifacts1)
+ .then(function (saveResult) {
+ expect(saveResult.modelArtifactsInfo.dateSaved.getTime())
+ .toBeGreaterThanOrEqual(testStartDate.getTime());
+ expect(saveResult.modelArtifactsInfo.modelTopologyBytes)
+ .toEqual(JSON.stringify(modelTopology1).length);
+ expect(saveResult.modelArtifactsInfo.weightSpecsBytes)
+ .toEqual(JSON.stringify(weightSpecs1).length);
+ expect(saveResult.modelArtifactsInfo.weightDataBytes)
+ .toEqual(weightData1.byteLength);
+ expect(requestInits.length).toEqual(1);
+ var init = requestInits[0];
+ expect(init.method).toEqual('PUT');
+ expect(init.headers).toEqual({
+ 'header_key_1': 'header_value_1',
+ 'header_key_2': 'header_value_2'
+ });
+ var body = init.body;
+ var jsonFile = body.get('model.json');
+ var jsonFileReader = new FileReader();
+ jsonFileReader.onload = function (event) {
+ var modelJSON = JSON.parse(event.target.result);
+ expect(modelJSON.modelTopology).toEqual(modelTopology1);
+ expect(modelJSON.weightsManifest.length).toEqual(1);
+ expect(modelJSON.weightsManifest[0].weights).toEqual(weightSpecs1);
+ var weightsFile = body.get('model.weights.bin');
+ var weightsFileReader = new FileReader();
+ weightsFileReader.onload = function (event) {
+ var weightData = event.target.result;
+ expect(new Uint8Array(weightData))
+ .toEqual(new Uint8Array(weightData1));
+ done();
+ };
+ weightsFileReader.onerror = function (error) {
+ done.fail(error.target.error.message);
+ };
+ weightsFileReader.readAsArrayBuffer(weightsFile);
+ };
+ jsonFileReader.onerror = function (error) {
+ done.fail(error.target.error.message);
+ };
+ jsonFileReader.readAsText(jsonFile);
+ })
+ .catch(function (err) {
+ done.fail(err.stack);
+ });
+ });
+ it('404 response causes Error', function (done) {
+ var handler = tf.io.getSaveHandlers('http://invalid/path')[0];
+ handler.save(artifacts1)
+ .then(function (saveResult) {
+ done.fail('Calling browserHTTPRequest at invalid URL succeeded ' +
+ 'unexpectedly');
+ })
+ .catch(function (err) {
+ done();
+ });
+ });
+ it('Existing body leads to Error', function () {
+ expect(function () { return tf.io.browserHTTPRequest('model-upload-test', {
+ body: 'existing body'
+ }); }).toThrowError(/requestInit is expected to have no pre-existing body/);
+ });
+ it('Empty, null or undefined URL paths lead to Error', function () {
+ expect(function () { return tf.io.browserHTTPRequest(null); })
+ .toThrowError(/must not be null, undefined or empty/);
+ expect(function () { return tf.io.browserHTTPRequest(undefined); })
+ .toThrowError(/must not be null, undefined or empty/);
+ expect(function () { return tf.io.browserHTTPRequest(''); })
+ .toThrowError(/must not be null, undefined or empty/);
+ });
+ it('router', function () {
+ expect(browser_http_1.httpRequestRouter('http://bar/foo') instanceof browser_http_1.BrowserHTTPRequest)
+ .toEqual(true);
+ expect(browser_http_1.httpRequestRouter('https://localhost:5000/upload') instanceof
+ browser_http_1.BrowserHTTPRequest)
+ .toEqual(true);
+ expect(browser_http_1.httpRequestRouter('localhost://foo')).toBeNull();
+ expect(browser_http_1.httpRequestRouter('foo:5000/bar')).toBeNull();
+ });
+});
+jasmine_util_1.describeWithFlags('browserHTTPRequest-load', test_util_1.BROWSER_ENVS, function () {
+ var requestInits;
+ var setupFakeWeightFiles = function (fileBufferMap) {
+ spyOn(window, 'fetch').and.callFake(function (path, init) {
+ requestInits.push(init);
+ return new Response(fileBufferMap[path]);
+ });
+ };
+ beforeEach(function () {
+ requestInits = [];
+ });
+ it('1 group, 2 weights, 1 path', function (done) {
+ var weightManifest1 = [{
+ paths: ['weightfile0'],
+ weights: [
+ {
+ name: 'dense/kernel',
+ shape: [3, 1],
+ dtype: 'float32',
+ },
+ {
+ name: 'dense/bias',
+ shape: [2],
+ dtype: 'float32',
+ }
+ ]
+ }];
+ var floatData = new Float32Array([1, 3, 3, 7, 4]);
+ setupFakeWeightFiles({
+ './model.json': JSON.stringify({ modelTopology: modelTopology1, weightsManifest: weightManifest1 }),
+ './weightfile0': floatData,
+ });
+ var handler = tf.io.browserHTTPRequest('./model.json');
+ handler.load()
+ .then(function (modelArtifacts) {
+ expect(modelArtifacts.modelTopology).toEqual(modelTopology1);
+ expect(modelArtifacts.weightSpecs)
+ .toEqual(weightManifest1[0].weights);
+ expect(new Float32Array(modelArtifacts.weightData))
+ .toEqual(floatData);
+ expect(requestInits).toEqual([{}, {}]);
+ done();
+ })
+ .catch(function (err) { return done.fail(err.stack); });
+ });
+ it('1 group, 2 weights, 1 path, with requestInit', function (done) {
+ var weightManifest1 = [{
+ paths: ['weightfile0'],
+ weights: [
+ {
+ name: 'dense/kernel',
+ shape: [3, 1],
+ dtype: 'float32',
+ },
+ {
+ name: 'dense/bias',
+ shape: [2],
+ dtype: 'float32',
+ }
+ ]
+ }];
+ var floatData = new Float32Array([1, 3, 3, 7, 4]);
+ setupFakeWeightFiles({
+ './model.json': JSON.stringify({ modelTopology: modelTopology1, weightsManifest: weightManifest1 }),
+ './weightfile0': floatData,
+ });
+ var handler = tf.io.browserHTTPRequest('./model.json', { headers: { 'header_key_1': 'header_value_1' } });
+ handler.load()
+ .then(function (modelArtifacts) {
+ expect(modelArtifacts.modelTopology).toEqual(modelTopology1);
+ expect(modelArtifacts.weightSpecs)
+ .toEqual(weightManifest1[0].weights);
+ expect(new Float32Array(modelArtifacts.weightData))
+ .toEqual(floatData);
+ expect(requestInits).toEqual([
+ { headers: { 'header_key_1': 'header_value_1' } },
+ { headers: { 'header_key_1': 'header_value_1' } }
+ ]);
+ done();
+ })
+ .catch(function (err) { return done.fail(err.stack); });
+ });
+ it('1 group, 2 weight, 2 paths', function (done) {
+ var weightManifest1 = [{
+ paths: ['weightfile0', 'weightfile1'],
+ weights: [
+ {
+ name: 'dense/kernel',
+ shape: [3, 1],
+ dtype: 'float32',
+ },
+ {
+ name: 'dense/bias',
+ shape: [2],
+ dtype: 'float32',
+ }
+ ]
+ }];
+ var floatData1 = new Float32Array([1, 3, 3]);
+ var floatData2 = new Float32Array([7, 4]);
+ setupFakeWeightFiles({
+ './model.json': JSON.stringify({ modelTopology: modelTopology1, weightsManifest: weightManifest1 }),
+ './weightfile0': floatData1,
+ './weightfile1': floatData2,
+ });
+ var handler = tf.io.browserHTTPRequest('./model.json');
+ handler.load()
+ .then(function (modelArtifacts) {
+ expect(modelArtifacts.modelTopology).toEqual(modelTopology1);
+ expect(modelArtifacts.weightSpecs)
+ .toEqual(weightManifest1[0].weights);
+ expect(new Float32Array(modelArtifacts.weightData))
+ .toEqual(new Float32Array([1, 3, 3, 7, 4]));
+ done();
+ })
+ .catch(function (err) { return done.fail(err.stack); });
+ });
+ it('2 groups, 2 weight, 2 paths', function (done) {
+ var weightsManifest = [
+ {
+ paths: ['weightfile0'],
+ weights: [{
+ name: 'dense/kernel',
+ shape: [3, 1],
+ dtype: 'float32',
+ }]
+ },
+ {
+ paths: ['weightfile1'],
+ weights: [{
+ name: 'dense/bias',
+ shape: [2],
+ dtype: 'float32',
+ }],
+ }
+ ];
+ var floatData1 = new Float32Array([1, 3, 3]);
+ var floatData2 = new Float32Array([7, 4]);
+ setupFakeWeightFiles({
+ './model.json': JSON.stringify({ modelTopology: modelTopology1, weightsManifest: weightsManifest }),
+ './weightfile0': floatData1,
+ './weightfile1': floatData2,
+ });
+ var handler = tf.io.browserHTTPRequest('./model.json');
+ handler.load()
+ .then(function (modelArtifacts) {
+ expect(modelArtifacts.modelTopology).toEqual(modelTopology1);
+ expect(modelArtifacts.weightSpecs)
+ .toEqual(weightsManifest[0].weights.concat(weightsManifest[1].weights));
+ expect(new Float32Array(modelArtifacts.weightData))
+ .toEqual(new Float32Array([1, 3, 3, 7, 4]));
+ done();
+ })
+ .catch(function (err) { return done.fail(err.stack); });
+ });
+ it('2 groups, 2 weight, 2 paths, Int32 and Uint8 Data', function (done) {
+ var weightsManifest = [
+ {
+ paths: ['weightfile0'],
+ weights: [{
+ name: 'fooWeight',
+ shape: [3, 1],
+ dtype: 'int32',
+ }]
+ },
+ {
+ paths: ['weightfile1'],
+ weights: [{
+ name: 'barWeight',
+ shape: [2],
+ dtype: 'bool',
+ }],
+ }
+ ];
+ var floatData1 = new Int32Array([1, 3, 3]);
+ var floatData2 = new Uint8Array([7, 4]);
+ setupFakeWeightFiles({
+ 'path1/model.json': JSON.stringify({ modelTopology: modelTopology1, weightsManifest: weightsManifest }),
+ 'path1/weightfile0': floatData1,
+ 'path1/weightfile1': floatData2,
+ });
+ var handler = tf.io.browserHTTPRequest('path1/model.json');
+ handler.load()
+ .then(function (modelArtifacts) {
+ expect(modelArtifacts.modelTopology).toEqual(modelTopology1);
+ expect(modelArtifacts.weightSpecs)
+ .toEqual(weightsManifest[0].weights.concat(weightsManifest[1].weights));
+ expect(new Int32Array(modelArtifacts.weightData.slice(0, 12)))
+ .toEqual(new Int32Array([1, 3, 3]));
+ expect(new Uint8Array(modelArtifacts.weightData.slice(12, 14)))
+ .toEqual(new Uint8Array([7, 4]));
+ done();
+ })
+ .catch(function (err) { return done.fail(err.stack); });
+ });
+ it('topology only', function (done) {
+ setupFakeWeightFiles({
+ './model.json': JSON.stringify({ modelTopology: modelTopology1 }),
+ });
+ var handler = tf.io.browserHTTPRequest('./model.json');
+ handler.load()
+ .then(function (modelArtifacts) {
+ expect(modelArtifacts.modelTopology).toEqual(modelTopology1);
+ expect(modelArtifacts.weightSpecs).toBeUndefined();
+ expect(modelArtifacts.weightData).toBeUndefined();
+ done();
+ })
+ .catch(function (err) { return done.fail(err.stack); });
+ });
+ it('weights only', function (done) {
+ var weightsManifest = [
+ {
+ paths: ['weightfile0'],
+ weights: [{
+ name: 'fooWeight',
+ shape: [3, 1],
+ dtype: 'int32',
+ }]
+ },
+ {
+ paths: ['weightfile1'],
+ weights: [{
+ name: 'barWeight',
+ shape: [2],
+ dtype: 'float32',
+ }],
+ }
+ ];
+ var floatData1 = new Int32Array([1, 3, 3]);
+ var floatData2 = new Float32Array([-7, -4]);
+ setupFakeWeightFiles({
+ 'path1/model.json': JSON.stringify({ weightsManifest: weightsManifest }),
+ 'path1/weightfile0': floatData1,
+ 'path1/weightfile1': floatData2,
+ });
+ var handler = tf.io.browserHTTPRequest('path1/model.json');
+ handler.load()
+ .then(function (modelArtifacts) {
+ expect(modelArtifacts.modelTopology).toBeUndefined();
+ expect(modelArtifacts.weightSpecs)
+ .toEqual(weightsManifest[0].weights.concat(weightsManifest[1].weights));
+ expect(new Int32Array(modelArtifacts.weightData.slice(0, 12)))
+ .toEqual(new Int32Array([1, 3, 3]));
+ expect(new Float32Array(modelArtifacts.weightData.slice(12, 20)))
+ .toEqual(new Float32Array([-7, -4]));
+ done();
+ })
+ .catch(function (err) { return done.fail(err.stack); });
+ });
+ it('Missing modelTopology and weightsManifest leads to error', function (done) {
+ setupFakeWeightFiles({ 'path1/model.json': JSON.stringify({}) });
+ var handler = tf.io.browserHTTPRequest('path1/model.json');
+ handler.load()
+ .then(function (modelTopology1) {
+ done.fail('Loading from missing modelTopology and weightsManifest ' +
+ 'succeeded expectedly.');
+ })
+ .catch(function (err) {
+ expect(err.message)
+ .toMatch(/contains neither model topology or manifest/);
+ done();
+ });
+ });
+});
+//# sourceMappingURL=browser_http_test.js.map
\ No newline at end of file
diff --git a/node_modules/@tensorflow/tfjs-core/dist/io/browser_http_test.js.map b/node_modules/@tensorflow/tfjs-core/dist/io/browser_http_test.js.map
new file mode 100644
index 0000000..2e8d614
--- /dev/null
+++ b/node_modules/@tensorflow/tfjs-core/dist/io/browser_http_test.js.map
@@ -0,0 +1 @@
+{"version":3,"file":"browser_http_test.js","sourceRoot":"","sources":["../../src/io/browser_http_test.ts"],"names":[],"mappings":";;AAqBA,6BAA+B;AAC/B,gDAAkD;AAClD,0CAAkE;AAElE,+CAAqE;AAGrE,IAAM,cAAc,GAAO;IACzB,YAAY,EAAE,YAAY;IAC1B,eAAe,EAAE,OAAO;IACxB,QAAQ,EAAE,CAAC;YACT,YAAY,EAAE,OAAO;YACrB,QAAQ,EAAE;gBACR,oBAAoB,EAAE;oBACpB,YAAY,EAAE,iBAAiB;oBAC/B,QAAQ,EAAE;wBACR,cAAc,EAAE,SAAS;wBACzB,OAAO,EAAE,GAAG;wBACZ,MAAM,EAAE,IAAI;wBACZ,MAAM,EAAE,SAAS;qBAClB;iBACF;gBACD,MAAM,EAAE,OAAO;gBACf,mBAAmB,EAAE,IAAI;gBACzB,kBAAkB,EAAE,IAAI;gBACxB,iBAAiB,EAAE,IAAI;gBACvB,OAAO,EAAE,SAAS;gBAClB,YAAY,EAAE,QAAQ;gBACtB,WAAW,EAAE,IAAI;gBACjB,oBAAoB,EAAE,IAAI;gBAC1B,kBAAkB,EAAE,EAAC,YAAY,EAAE,OAAO,EAAE,QAAQ,EAAE,EAAE,EAAC;gBACzD,OAAO,EAAE,CAAC;gBACV,mBAAmB,EAAE,CAAC,IAAI,EAAE,CAAC,CAAC;gBAC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AC,GAAG,CAAC,OAAO,CAAC;iBACd,OAAO,CAAC,6CAA6C,CAAC,CAAC;YAC5D,IAAI,EAAE,CAAC;QACT,CAAC,CAAC,CAAC;IACT,CAAC,CAAC,CAAC;AACL,CAAC,CAAC,CAAC"}
\ No newline at end of file
diff --git a/node_modules/@tensorflow/tfjs-core/dist/io/indexed_db.d.ts b/node_modules/@tensorflow/tfjs-core/dist/io/indexed_db.d.ts
new file mode 100644
index 0000000..52354fb
--- /dev/null
+++ b/node_modules/@tensorflow/tfjs-core/dist/io/indexed_db.d.ts
@@ -0,0 +1,22 @@
+import { IORouter } from './router_registry';
+import { IOHandler, ModelArtifacts, ModelArtifactsInfo, ModelStoreManager, SaveResult } from './types';
+export declare function deleteDatabase(): Promise;
+export declare class BrowserIndexedDB implements IOHandler {
+ protected readonly indexedDB: IDBFactory;
+ protected readonly modelPath: string;
+ static readonly URL_SCHEME: string;
+ constructor(modelPath: string);
+ save(modelArtifacts: ModelArtifacts): Promise;
+ load(): Promise;
+ private databaseAction;
+}
+export declare const indexedDBRouter: IORouter;
+export declare function browserIndexedDB(modelPath: string): IOHandler;
+export declare class BrowserIndexedDBManager implements ModelStoreManager {
+ private indexedDB;
+ constructor();
+ listModels(): Promise<{
+ [path: string]: ModelArtifactsInfo;
+ }>;
+ removeModel(path: string): Promise;
+}
diff --git a/node_modules/@tensorflow/tfjs-core/dist/io/indexed_db.js b/node_modules/@tensorflow/tfjs-core/dist/io/indexed_db.js
new file mode 100644
index 0000000..ac6936a
--- /dev/null
+++ b/node_modules/@tensorflow/tfjs-core/dist/io/indexed_db.js
@@ -0,0 +1,309 @@
+"use strict";
+var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
+ return new (P || (P = Promise))(function (resolve, reject) {
+ function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
+ function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
+ function step(result) { result.done ? resolve(result.value) : new P(function (resolve) { resolve(result.value); }).then(fulfilled, rejected); }
+ step((generator = generator.apply(thisArg, _arguments || [])).next());
+ });
+};
+var __generator = (this && this.__generator) || function (thisArg, body) {
+ var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;
+ return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
+ function verb(n) { return function (v) { return step([n, v]); }; }
+ function step(op) {
+ if (f) throw new TypeError("Generator is already executing.");
+ while (_) try {
+ if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;
+ if (y = 0, t) op = [op[0] & 2, t.value];
+ switch (op[0]) {
+ case 0: case 1: t = op; break;
+ case 4: _.label++; return { value: op[1], done: false };
+ case 5: _.label++; y = op[1]; op = [0]; continue;
+ case 7: op = _.ops.pop(); _.trys.pop(); continue;
+ default:
+ if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }
+ if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }
+ if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }
+ if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }
+ if (t[2]) _.ops.pop();
+ _.trys.pop(); continue;
+ }
+ op = body.call(thisArg, _);
+ } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }
+ if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };
+ }
+};
+Object.defineProperty(exports, "__esModule", { value: true });
+var environment_1 = require("../environment");
+var io_utils_1 = require("./io_utils");
+var model_management_1 = require("./model_management");
+var router_registry_1 = require("./router_registry");
+var DATABASE_NAME = 'tensorflowjs';
+var DATABASE_VERSION = 1;
+var MODEL_STORE_NAME = 'models_store';
+var INFO_STORE_NAME = 'model_info_store';
+function deleteDatabase() {
+ return __awaiter(this, void 0, void 0, function () {
+ var idbFactory;
+ return __generator(this, function (_a) {
+ idbFactory = getIndexedDBFactory();
+ return [2, new Promise(function (resolve, reject) {
+ var deleteRequest = idbFactory.deleteDatabase(DATABASE_NAME);
+ deleteRequest.onsuccess = function () { return resolve(); };
+ deleteRequest.onerror = function (error) { return reject(error); };
+ })];
+ });
+ });
+}
+exports.deleteDatabase = deleteDatabase;
+function getIndexedDBFactory() {
+ if (!environment_1.ENV.get('IS_BROWSER')) {
+ throw new Error('Failed to obtain IndexedDB factory because the current environment' +
+ 'is not a web browser.');
+ }
+ var theWindow = window;
+ var factory = theWindow.indexedDB || theWindow.mozIndexedDB ||
+ theWindow.webkitIndexedDB || theWindow.msIndexedDB ||
+ theWindow.shimIndexedDB;
+ if (factory == null) {
+ throw new Error('The current browser does not appear to support IndexedDB.');
+ }
+ return factory;
+}
+function setUpDatabase(openRequest) {
+ var db = openRequest.result;
+ db.createObjectStore(MODEL_STORE_NAME, { keyPath: 'modelPath' });
+ db.createObjectStore(INFO_STORE_NAME, { keyPath: 'modelPath' });
+}
+var BrowserIndexedDB = (function () {
+ function BrowserIndexedDB(modelPath) {
+ this.indexedDB = getIndexedDBFactory();
+ if (modelPath == null || !modelPath) {
+ throw new Error('For IndexedDB, modelPath must not be null, undefined or empty.');
+ }
+ this.modelPath = modelPath;
+ }
+ BrowserIndexedDB.prototype.save = function (modelArtifacts) {
+ return __awaiter(this, void 0, void 0, function () {
+ return __generator(this, function (_a) {
+ if (modelArtifacts.modelTopology instanceof ArrayBuffer) {
+ throw new Error('BrowserLocalStorage.save() does not support saving model topology ' +
+ 'in binary formats yet.');
+ }
+ return [2, this.databaseAction(this.modelPath, modelArtifacts)];
+ });
+ });
+ };
+ BrowserIndexedDB.prototype.load = function () {
+ return __awaiter(this, void 0, void 0, function () {
+ return __generator(this, function (_a) {
+ return [2, this.databaseAction(this.modelPath)];
+ });
+ });
+ };
+ BrowserIndexedDB.prototype.databaseAction = function (modelPath, modelArtifacts) {
+ var _this = this;
+ return new Promise(function (resolve, reject) {
+ var openRequest = _this.indexedDB.open(DATABASE_NAME, DATABASE_VERSION);
+ openRequest.onupgradeneeded = function () { return setUpDatabase(openRequest); };
+ openRequest.onsuccess = function () {
+ var db = openRequest.result;
+ if (modelArtifacts == null) {
+ var modelTx = db.transaction(MODEL_STORE_NAME, 'readonly');
+ var modelStore = modelTx.objectStore(MODEL_STORE_NAME);
+ var getRequest_1 = modelStore.get(_this.modelPath);
+ getRequest_1.onsuccess = function () {
+ if (getRequest_1.result == null) {
+ db.close();
+ return reject(new Error("Cannot find model with path '" + _this.modelPath + "' " +
+ "in IndexedDB."));
+ }
+ else {
+ resolve(getRequest_1.result.modelArtifacts);
+ }
+ };
+ getRequest_1.onerror = function (error) {
+ db.close();
+ return reject(getRequest_1.error);
+ };
+ modelTx.oncomplete = function () { return db.close(); };
+ }
+ else {
+ var modelArtifactsInfo_1 = io_utils_1.getModelArtifactsInfoForJSON(modelArtifacts);
+ var infoTx_1 = db.transaction(INFO_STORE_NAME, 'readwrite');
+ var infoStore_1 = infoTx_1.objectStore(INFO_STORE_NAME);
+ var putInfoRequest_1 = infoStore_1.put({ modelPath: _this.modelPath, modelArtifactsInfo: modelArtifactsInfo_1 });
+ var modelTx_1;
+ putInfoRequest_1.onsuccess = function () {
+ modelTx_1 = db.transaction(MODEL_STORE_NAME, 'readwrite');
+ var modelStore = modelTx_1.objectStore(MODEL_STORE_NAME);
+ var putModelRequest = modelStore.put({
+ modelPath: _this.modelPath,
+ modelArtifacts: modelArtifacts,
+ modelArtifactsInfo: modelArtifactsInfo_1
+ });
+ putModelRequest.onsuccess = function () { return resolve({ modelArtifactsInfo: modelArtifactsInfo_1 }); };
+ putModelRequest.onerror = function (error) {
+ infoStore_1 = infoTx_1.objectStore(INFO_STORE_NAME);
+ var deleteInfoRequest = infoStore_1.delete(_this.modelPath);
+ deleteInfoRequest.onsuccess = function () {
+ db.close();
+ return reject(putModelRequest.error);
+ };
+ deleteInfoRequest.onerror = function (error) {
+ db.close();
+ return reject(putModelRequest.error);
+ };
+ };
+ };
+ putInfoRequest_1.onerror = function (error) {
+ db.close();
+ return reject(putInfoRequest_1.error);
+ };
+ infoTx_1.oncomplete = function () {
+ if (modelTx_1 == null) {
+ db.close();
+ }
+ else {
+ modelTx_1.oncomplete = function () { return db.close(); };
+ }
+ };
+ }
+ };
+ openRequest.onerror = function (error) { return reject(openRequest.error); };
+ });
+ };
+ BrowserIndexedDB.URL_SCHEME = 'indexeddb://';
+ return BrowserIndexedDB;
+}());
+exports.BrowserIndexedDB = BrowserIndexedDB;
+exports.indexedDBRouter = function (url) {
+ if (!environment_1.ENV.get('IS_BROWSER')) {
+ return null;
+ }
+ else {
+ if (url.startsWith(BrowserIndexedDB.URL_SCHEME)) {
+ return browserIndexedDB(url.slice(BrowserIndexedDB.URL_SCHEME.length));
+ }
+ else {
+ return null;
+ }
+ }
+};
+router_registry_1.IORouterRegistry.registerSaveRouter(exports.indexedDBRouter);
+router_registry_1.IORouterRegistry.registerLoadRouter(exports.indexedDBRouter);
+function browserIndexedDB(modelPath) {
+ return new BrowserIndexedDB(modelPath);
+}
+exports.browserIndexedDB = browserIndexedDB;
+function maybeStripScheme(key) {
+ return key.startsWith(BrowserIndexedDB.URL_SCHEME) ?
+ key.slice(BrowserIndexedDB.URL_SCHEME.length) :
+ key;
+}
+var BrowserIndexedDBManager = (function () {
+ function BrowserIndexedDBManager() {
+ this.indexedDB = getIndexedDBFactory();
+ }
+ BrowserIndexedDBManager.prototype.listModels = function () {
+ return __awaiter(this, void 0, void 0, function () {
+ var _this = this;
+ return __generator(this, function (_a) {
+ return [2, new Promise(function (resolve, reject) {
+ var openRequest = _this.indexedDB.open(DATABASE_NAME, DATABASE_VERSION);
+ openRequest.onupgradeneeded = function () { return setUpDatabase(openRequest); };
+ openRequest.onsuccess = function () {
+ var db = openRequest.result;
+ var tx = db.transaction(INFO_STORE_NAME, 'readonly');
+ var store = tx.objectStore(INFO_STORE_NAME);
+ var getAllInfoRequest = store.getAll();
+ getAllInfoRequest.onsuccess = function () {
+ var out = {};
+ for (var _i = 0, _a = getAllInfoRequest.result; _i < _a.length; _i++) {
+ var item = _a[_i];
+ out[item.modelPath] = item.modelArtifactsInfo;
+ }
+ resolve(out);
+ };
+ getAllInfoRequest.onerror = function (error) {
+ db.close();
+ return reject(getAllInfoRequest.error);
+ };
+ tx.oncomplete = function () { return db.close(); };
+ };
+ openRequest.onerror = function (error) { return reject(openRequest.error); };
+ })];
+ });
+ });
+ };
+ BrowserIndexedDBManager.prototype.removeModel = function (path) {
+ return __awaiter(this, void 0, void 0, function () {
+ var _this = this;
+ return __generator(this, function (_a) {
+ path = maybeStripScheme(path);
+ return [2, new Promise(function (resolve, reject) {
+ var openRequest = _this.indexedDB.open(DATABASE_NAME, DATABASE_VERSION);
+ openRequest.onupgradeneeded = function () { return setUpDatabase(openRequest); };
+ openRequest.onsuccess = function () {
+ var db = openRequest.result;
+ var infoTx = db.transaction(INFO_STORE_NAME, 'readwrite');
+ var infoStore = infoTx.objectStore(INFO_STORE_NAME);
+ var getInfoRequest = infoStore.get(path);
+ var modelTx;
+ getInfoRequest.onsuccess = function () {
+ if (getInfoRequest.result == null) {
+ db.close();
+ return reject(new Error("Cannot find model with path '" + path + "' " +
+ "in IndexedDB."));
+ }
+ else {
+ var deleteInfoRequest = infoStore.delete(path);
+ var deleteModelData_1 = function () {
+ modelTx = db.transaction(MODEL_STORE_NAME, 'readwrite');
+ var modelStore = modelTx.objectStore(MODEL_STORE_NAME);
+ var deleteModelRequest = modelStore.delete(path);
+ deleteModelRequest.onsuccess = function () {
+ return resolve(getInfoRequest.result.modelArtifactsInfo);
+ };
+ deleteModelRequest.onerror = function (error) {
+ return reject(getInfoRequest.error);
+ };
+ };
+ deleteInfoRequest.onsuccess = deleteModelData_1;
+ deleteInfoRequest.onerror = function (error) {
+ deleteModelData_1();
+ db.close();
+ return reject(getInfoRequest.error);
+ };
+ }
+ };
+ getInfoRequest.onerror = function (error) {
+ db.close();
+ return reject(getInfoRequest.error);
+ };
+ infoTx.oncomplete = function () {
+ if (modelTx == null) {
+ db.close();
+ }
+ else {
+ modelTx.oncomplete = function () { return db.close(); };
+ }
+ };
+ };
+ openRequest.onerror = function (error) { return reject(openRequest.error); };
+ })];
+ });
+ });
+ };
+ return BrowserIndexedDBManager;
+}());
+exports.BrowserIndexedDBManager = BrowserIndexedDBManager;
+if (environment_1.ENV.get('IS_BROWSER')) {
+ try {
+ model_management_1.ModelStoreManagerRegistry.registerManager(BrowserIndexedDB.URL_SCHEME, new BrowserIndexedDBManager());
+ }
+ catch (err) {
+ }
+}
+//# sourceMappingURL=indexed_db.js.map
\ No newline at end of file
diff --git a/node_modules/@tensorflow/tfjs-core/dist/io/indexed_db.js.map b/node_modules/@tensorflow/tfjs-core/dist/io/indexed_db.js.map
new file mode 100644
index 0000000..f85e11c
--- /dev/null
+++ b/node_modules/@tensorflow/tfjs-core/dist/io/indexed_db.js.map
@@ -0,0 +1 @@
+{"version":3,"file":"indexed_db.js","sourceRoot":"","sources":["../../src/io/indexed_db.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAiBA,8CAAmC;AACnC,uCAAwD;AACxD,uDAA6D;AAC7D,qDAA6D;AAG7D,IAAM,aAAa,GAAG,cAAc,CAAC;AACrC,IAAM,gBAAgB,GAAG,CAAC,CAAC;AAK3B,IAAM,gBAAgB,GAAG,cAAc,CAAC;AAIxC,IAAM,eAAe,GAAG,kBAAkB,CAAC;AAK3C;;;;YACQ,UAAU,GAAG,mBAAmB,EAAE,CAAC;YAEzC,WAAO,IAAI,OAAO,CAAO,UAAC,OAAO,EAAE,MAAM;oBACvC,IAAM,aAAa,GAAG,UAAU,CAAC,cAAc,CAAC,aAAa,CAAC,CAAC;oBAC/D,aAAa,CAAC,SAAS,GAAG,cAAM,OAAA,OAAO,EAAE,EAAT,CAAS,CAAC;oBAC1C,aAA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BAEF,MAAM,CAAC,UAAU,GAAG;gCAClB,IAAI,OAAO,IAAI,IAAI,EAAE;oCACnB,EAAE,CAAC,KAAK,EAAE,CAAC;iCACZ;qCAAM;oCACL,OAAO,CAAC,UAAU,GAAG,cAAM,OAAA,EAAE,CAAC,KAAK,EAAE,EAAV,CAAU,CAAC;iCACvC;4BACH,CAAC,CAAC;wBACJ,CAAC,CAAC;wBACF,WAAW,CAAC,OAAO,GAAG,UAAA,KAAK,IAAI,OAAA,MAAM,CAAC,WAAW,CAAC,KAAK,CAAC,EAAzB,CAAyB,CAAC;oBAC3D,CAAC,CAAC,EAAC;;;KACJ;IACH,8BAAC;AAAD,CAAC,AAtGD,IAsGC;AAtGY,0DAAuB;AAwGpC,IAAI,iBAAG,CAAC,GAAG,CAAC,YAAY,CAAC,EAAE;IAGzB,IAAI;QACF,4CAAyB,CAAC,eAAe,CACrC,gBAAgB,CAAC,UAAU,EAAE,IAAI,uBAAuB,EAAE,CAAC,CAAC;KACjE;IAAC,OAAO,GAAG,EAAE;KACb;CACF"}
\ No newline at end of file
diff --git a/node_modules/@tensorflow/tfjs-core/dist/io/indexed_db_test.d.ts b/node_modules/@tensorflow/tfjs-core/dist/io/indexed_db_test.d.ts
new file mode 100644
index 0000000..cb0ff5c
--- /dev/null
+++ b/node_modules/@tensorflow/tfjs-core/dist/io/indexed_db_test.d.ts
@@ -0,0 +1 @@
+export {};
diff --git a/node_modules/@tensorflow/tfjs-core/dist/io/indexed_db_test.js b/node_modules/@tensorflow/tfjs-core/dist/io/indexed_db_test.js
new file mode 100644
index 0000000..3c19df7
--- /dev/null
+++ b/node_modules/@tensorflow/tfjs-core/dist/io/indexed_db_test.js
@@ -0,0 +1,313 @@
+"use strict";
+Object.defineProperty(exports, "__esModule", { value: true });
+var tf = require("../index");
+var jasmine_util_1 = require("../jasmine_util");
+var test_util_1 = require("../test_util");
+var indexed_db_1 = require("./indexed_db");
+jasmine_util_1.describeWithFlags('IndexedDB', test_util_1.BROWSER_ENVS, function () {
+ var modelTopology1 = {
+ 'class_name': 'Sequential',
+ 'keras_version': '2.1.4',
+ 'config': [{
+ 'class_name': 'Dense',
+ 'config': {
+ 'kernel_initializer': {
+ 'class_name': 'VarianceScaling',
+ 'config': {
+ 'distribution': 'uniform',
+ 'scale': 1.0,
+ 'seed': null,
+ 'mode': 'fan_avg'
+ }
+ },
+ 'name': 'dense',
+ 'kernel_constraint': null,
+ 'bias_regularizer': null,
+ 'bias_constraint': null,
+ 'dtype': 'float32',
+ 'activation': 'linear',
+ 'trainable': true,
+ 'kernel_regularizer': null,
+ 'bias_initializer': { 'class_name': 'Zeros', 'config': {} },
+ 'units': 1,
+ 'batch_input_shape': [null, 3],
+ 'use_bias': true,
+ 'activity_regularizer': null
+ }
+ }],
+ 'backend': 'tensorflow'
+ };
+ var weightSpecs1 = [
+ {
+ name: 'dense/kernel',
+ shape: [3, 1],
+ dtype: 'float32',
+ },
+ {
+ name: 'dense/bias',
+ shape: [1],
+ dtype: 'float32',
+ }
+ ];
+ var weightData1 = new ArrayBuffer(16);
+ var artifacts1 = {
+ modelTopology: modelTopology1,
+ weightSpecs: weightSpecs1,
+ weightData: weightData1,
+ };
+ var weightSpecs2 = [
+ {
+ name: 'dense/new_kernel',
+ shape: [5, 1],
+ dtype: 'float32',
+ },
+ {
+ name: 'dense/new_bias',
+ shape: [1],
+ dtype: 'float32',
+ }
+ ];
+ beforeEach(function (done) {
+ indexed_db_1.deleteDatabase().then(function () {
+ done();
+ });
+ });
+ afterEach(function (done) {
+ indexed_db_1.deleteDatabase().then(function () {
+ done();
+ });
+ });
+ it('Save-load round trip', function (done) {
+ var testStartDate = new Date();
+ var handler = tf.io.getSaveHandlers('indexeddb://FooModel')[0];
+ handler.save(artifacts1)
+ .then(function (saveResult) {
+ expect(saveResult.modelArtifactsInfo.dateSaved.getTime())
+ .toBeGreaterThanOrEqual(testStartDate.getTime());
+ expect(saveResult.modelArtifactsInfo.modelTopologyBytes)
+ .toEqual(JSON.stringify(modelTopology1).length);
+ expect(saveResult.modelArtifactsInfo.weightSpecsBytes)
+ .toEqual(JSON.stringify(weightSpecs1).length);
+ expect(saveResult.modelArtifactsInfo.weightDataBytes)
+ .toEqual(weightData1.byteLength);
+ handler.load()
+ .then(function (loadedArtifacts) {
+ expect(loadedArtifacts.modelTopology).toEqual(modelTopology1);
+ expect(loadedArtifacts.weightSpecs).toEqual(weightSpecs1);
+ test_util_1.expectArrayBuffersEqual(loadedArtifacts.weightData, weightData1);
+ done();
+ })
+ .catch(function (err) {
+ console.error(err.stack);
+ });
+ })
+ .catch(function (err) {
+ console.error(err.stack);
+ });
+ });
+ it('Save two models and load one', function (done) {
+ var weightData2 = new ArrayBuffer(24);
+ var artifacts2 = {
+ modelTopology: modelTopology1,
+ weightSpecs: weightSpecs2,
+ weightData: weightData2,
+ };
+ var handler1 = tf.io.getSaveHandlers('indexeddb://Model/1')[0];
+ handler1.save(artifacts1)
+ .then(function (saveResult1) {
+ expect(saveResult1.modelArtifactsInfo.modelTopologyBytes)
+ .toEqual(JSON.stringify(modelTopology1).length);
+ expect(saveResult1.modelArtifactsInfo.weightSpecsBytes)
+ .toEqual(JSON.stringify(weightSpecs1).length);
+ expect(saveResult1.modelArtifactsInfo.weightDataBytes)
+ .toEqual(weightData1.byteLength);
+ var handler2 = tf.io.getSaveHandlers('indexeddb://Model/2')[0];
+ handler2.save(artifacts2)
+ .then(function (saveResult2) {
+ expect(saveResult2.modelArtifactsInfo.dateSaved.getTime())
+ .toBeGreaterThanOrEqual(saveResult1.modelArtifactsInfo.dateSaved.getTime());
+ expect(saveResult2.modelArtifactsInfo.modelTopologyBytes)
+ .toEqual(JSON.stringify(modelTopology1).length);
+ expect(saveResult2.modelArtifactsInfo.weightSpecsBytes)
+ .toEqual(JSON.stringify(weightSpecs2).length);
+ expect(saveResult2.modelArtifactsInfo.weightDataBytes)
+ .toEqual(weightData2.byteLength);
+ handler1.load()
+ .then(function (loadedArtifacts) {
+ expect(loadedArtifacts.modelTopology)
+ .toEqual(modelTopology1);
+ expect(loadedArtifacts.weightSpecs).toEqual(weightSpecs1);
+ test_util_1.expectArrayBuffersEqual(loadedArtifacts.weightData, weightData1);
+ done();
+ })
+ .catch(function (err) {
+ console.error(err.stack);
+ });
+ })
+ .catch(function (err) {
+ console.error(err.stack);
+ });
+ })
+ .catch(function (err) {
+ console.error(err.stack);
+ });
+ });
+ it('Loading nonexistent model fails', function (done) {
+ var handler = tf.io.getSaveHandlers('indexeddb://NonexistentModel')[0];
+ handler.load()
+ .then(function (modelArtifacts) {
+ done.fail('Loading nonexistent model from IndexedDB succeeded unexpectly');
+ })
+ .catch(function (err) {
+ expect(err.message)
+ .toEqual('Cannot find model with path \'NonexistentModel\' in ' +
+ 'IndexedDB.');
+ done();
+ });
+ });
+ it('Null, undefined or empty modelPath throws Error', function () {
+ expect(function () { return indexed_db_1.browserIndexedDB(null); })
+ .toThrowError(/IndexedDB, modelPath must not be null, undefined or empty/);
+ expect(function () { return indexed_db_1.browserIndexedDB(undefined); })
+ .toThrowError(/IndexedDB, modelPath must not be null, undefined or empty/);
+ expect(function () { return indexed_db_1.browserIndexedDB(''); })
+ .toThrowError(/IndexedDB, modelPath must not be null, undefined or empty./);
+ });
+ it('router', function () {
+ expect(indexed_db_1.indexedDBRouter('indexeddb://bar') instanceof indexed_db_1.BrowserIndexedDB)
+ .toEqual(true);
+ expect(indexed_db_1.indexedDBRouter('localstorage://bar')).toBeNull();
+ expect(indexed_db_1.indexedDBRouter('qux')).toBeNull();
+ });
+ it('Manager: List models: 0 result', function (done) {
+ new indexed_db_1.BrowserIndexedDBManager()
+ .listModels()
+ .then(function (out) {
+ expect(out).toEqual({});
+ done();
+ })
+ .catch(function (err) { return done.fail(err.stack); });
+ });
+ it('Manager: List models: 1 result', function (done) {
+ var handler = tf.io.getSaveHandlers('indexeddb://baz/QuxModel')[0];
+ handler.save(artifacts1)
+ .then(function (saveResult) {
+ new indexed_db_1.BrowserIndexedDBManager()
+ .listModels()
+ .then(function (out) {
+ expect(Object.keys(out).length).toEqual(1);
+ expect(out['baz/QuxModel'].modelTopologyType)
+ .toEqual(saveResult.modelArtifactsInfo.modelTopologyType);
+ expect(out['baz/QuxModel'].modelTopologyBytes)
+ .toEqual(saveResult.modelArtifactsInfo.modelTopologyBytes);
+ expect(out['baz/QuxModel'].weightSpecsBytes)
+ .toEqual(saveResult.modelArtifactsInfo.weightSpecsBytes);
+ expect(out['baz/QuxModel'].weightDataBytes)
+ .toEqual(saveResult.modelArtifactsInfo.weightDataBytes);
+ done();
+ })
+ .catch(function (err) { return done.fail(err.stack); });
+ })
+ .catch(function (err) { return done.fail(err.stack); });
+ });
+ it('Manager: List models: 2 results', function (done) {
+ var handler1 = tf.io.getSaveHandlers('indexeddb://QuxModel')[0];
+ handler1.save(artifacts1)
+ .then(function (saveResult1) {
+ var handler2 = tf.io.getSaveHandlers('indexeddb://repeat/QuxModel')[0];
+ handler2.save(artifacts1)
+ .then(function (saveResult2) {
+ new indexed_db_1.BrowserIndexedDBManager()
+ .listModels()
+ .then(function (out) {
+ expect(Object.keys(out).length).toEqual(2);
+ expect(out['QuxModel'].modelTopologyType)
+ .toEqual(saveResult1.modelArtifactsInfo.modelTopologyType);
+ expect(out['QuxModel'].modelTopologyBytes)
+ .toEqual(saveResult1.modelArtifactsInfo
+ .modelTopologyBytes);
+ expect(out['QuxModel'].weightSpecsBytes)
+ .toEqual(saveResult1.modelArtifactsInfo.weightSpecsBytes);
+ expect(out['QuxModel'].weightDataBytes)
+ .toEqual(saveResult1.modelArtifactsInfo.weightDataBytes);
+ expect(out['repeat/QuxModel'].modelTopologyType)
+ .toEqual(saveResult2.modelArtifactsInfo.modelTopologyType);
+ expect(out['repeat/QuxModel'].modelTopologyBytes)
+ .toEqual(saveResult2.modelArtifactsInfo
+ .modelTopologyBytes);
+ expect(out['repeat/QuxModel'].weightSpecsBytes)
+ .toEqual(saveResult2.modelArtifactsInfo.weightSpecsBytes);
+ expect(out['repeat/QuxModel'].weightDataBytes)
+ .toEqual(saveResult2.modelArtifactsInfo.weightDataBytes);
+ done();
+ })
+ .catch(function (err) { return done.fail(err.stack); });
+ })
+ .catch(function (err) { return done.fail(err.stack); });
+ })
+ .catch(function (err) { return done.fail(err.stack); });
+ });
+ it('Manager: Successful deleteModel', function (done) {
+ var handler1 = tf.io.getSaveHandlers('indexeddb://QuxModel')[0];
+ handler1.save(artifacts1)
+ .then(function (saveResult1) {
+ var handler2 = tf.io.getSaveHandlers('indexeddb://repeat/QuxModel')[0];
+ handler2.save(artifacts1)
+ .then(function (saveResult2) {
+ var manager = new indexed_db_1.BrowserIndexedDBManager();
+ manager.removeModel('QuxModel')
+ .then(function (deletedInfo) {
+ manager.listModels()
+ .then(function (out) {
+ expect(Object.keys(out)).toEqual([
+ 'repeat/QuxModel'
+ ]);
+ done();
+ })
+ .catch(function (err) { return done.fail(err.stack); });
+ })
+ .catch(function (err) { return done.fail(err.stack); });
+ })
+ .catch(function (err) { return done.fail(err.stack); });
+ })
+ .catch(function (err) { return done.fail(err.stack); });
+ });
+ it('Manager: Successful deleteModel with URL scheme', function (done) {
+ var handler1 = tf.io.getSaveHandlers('indexeddb://QuxModel')[0];
+ handler1.save(artifacts1)
+ .then(function (saveResult1) {
+ var handler2 = tf.io.getSaveHandlers('indexeddb://repeat/QuxModel')[0];
+ handler2.save(artifacts1)
+ .then(function (saveResult2) {
+ var manager = new indexed_db_1.BrowserIndexedDBManager();
+ manager.removeModel('indexeddb://QuxModel')
+ .then(function (deletedInfo) {
+ manager.listModels()
+ .then(function (out) {
+ expect(Object.keys(out)).toEqual([
+ 'repeat/QuxModel'
+ ]);
+ done();
+ })
+ .catch(function (err) { return done.fail(err); });
+ })
+ .catch(function (err) { return done.fail(err.stack); });
+ })
+ .catch(function (err) { return done.fail(err.stack); });
+ })
+ .catch(function (err) { return done.fail(err.stack); });
+ });
+ it('Manager: Failed deletedModel', function (done) {
+ new indexed_db_1.BrowserIndexedDBManager()
+ .removeModel('nonexistent')
+ .then(function (out) {
+ done.fail('Deleting nonexistent model succeeded unexpectedly.');
+ })
+ .catch(function (err) {
+ expect(err.message)
+ .toEqual('Cannot find model with path \'nonexistent\' in IndexedDB.');
+ done();
+ });
+ });
+});
+//# sourceMappingURL=indexed_db_test.js.map
\ No newline at end of file
diff --git a/node_modules/@tensorflow/tfjs-core/dist/io/indexed_db_test.js.map b/node_modules/@tensorflow/tfjs-core/dist/io/indexed_db_test.js.map
new file mode 100644
index 0000000..2a5eeb0
--- /dev/null
+++ b/node_modules/@tensorflow/tfjs-core/dist/io/indexed_db_test.js.map
@@ -0,0 +1 @@
+{"version":3,"file":"indexed_db_test.js","sourceRoot":"","sources":["../../src/io/indexed_db_test.ts"],"names":[],"mappings":";;AAqBA,6BAA+B;AAC/B,gDAAkD;AAClD,0CAAmE;AACnE,2CAA0H;AAE1H,gCAAiB,CAAC,WAAW,EAAE,wBAAY,EAAE;IAE3C,IAAM,cAAc,GAAO;QACzB,YAAY,EAAE,YAAY;QAC1B,eAAe,EAAE,OAAO;QACxB,QAAQ,EAAE,CAAC;gBACT,YAAY,EAAE,OAAO;gBACrB,QAAQ,EAAE;oBACR,oBAAoB,EAAE;wBACpB,YAAY,EAAE,iBAAiB;wBAC/B,QAAQ,EAAE;4BACR,cAAc,EAAE,SAAS;4BACzB,OAAO,EAAE,GAAG;4BACZ,MAAM,EAAE,IAAI;4BACZ,MAAM,EAAE,SAAS;yBAClB;qBACF;oBACD,MAAM,EAAE,OAAO;oBACf,mBAAmB,EAAE,IAAI;oBACzB,kBAAkB,EAAE,IAAI;oBACxB,iBAAiB,EAAE,IAAI;oBACvB,OAAO,EAAE,SAAS;oBAClB,YAAY,EAAE,QAAQ;oBACtB,WAAW,EAAE,IAAI;oBACjB,oBAAoB,EAAE,IAAI;oBAC1B,kBAAkB,EAAE,EAAC,YAAY,EAAE,OAAO,EAAE,QAAQ,EAAE,EAAE,EAAC;oBACzD,OAAO,EAAE,CAAC;oBACV,mBAAmB,EAAE,CAAC,IAAI,EAAE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,OAAO,CACJ,2DAA2D,CAAC,CAAC;YACrE,IAAI,EAAE,CAAC;QACT,CAAC,CAAC,CAAC;IACT,CAAC,CAAC,CAAC;AACL,CAAC,CAAC,CAAC"}
\ No newline at end of file
diff --git a/node_modules/@tensorflow/tfjs-core/dist/io/io.d.ts b/node_modules/@tensorflow/tfjs-core/dist/io/io.d.ts
new file mode 100644
index 0000000..9c53f97
--- /dev/null
+++ b/node_modules/@tensorflow/tfjs-core/dist/io/io.d.ts
@@ -0,0 +1,15 @@
+import './indexed_db';
+import './local_storage';
+import { browserFiles } from './browser_files';
+import { browserHTTPRequest } from './browser_http';
+import { concatenateArrayBuffers, decodeWeights, encodeWeights, getModelArtifactsInfoForJSON } from './io_utils';
+import { fromMemory, withSaveHandler } from './passthrough';
+import { IORouterRegistry } from './router_registry';
+import { IOHandler, LoadHandler, ModelArtifacts, ModelStoreManager, SaveConfig, SaveHandler, SaveResult, WeightsManifestConfig, WeightsManifestEntry } from './types';
+import { loadWeights } from './weights_loader';
+declare const registerSaveRouter: typeof IORouterRegistry.registerSaveRouter;
+declare const registerLoadRouter: typeof IORouterRegistry.registerLoadRouter;
+declare const getSaveHandlers: typeof IORouterRegistry.getSaveHandlers;
+declare const getLoadHandlers: typeof IORouterRegistry.getLoadHandlers;
+export { copyModel, listModels, moveModel, removeModel } from './model_management';
+export { browserFiles, browserHTTPRequest, concatenateArrayBuffers, decodeWeights, encodeWeights, fromMemory, getLoadHandlers, getModelArtifactsInfoForJSON, getSaveHandlers, IOHandler, LoadHandler, loadWeights, ModelArtifacts, ModelStoreManager, registerLoadRouter, registerSaveRouter, SaveConfig, SaveHandler, SaveResult, WeightsManifestConfig, WeightsManifestEntry, withSaveHandler };
diff --git a/node_modules/@tensorflow/tfjs-core/dist/io/io.js b/node_modules/@tensorflow/tfjs-core/dist/io/io.js
new file mode 100644
index 0000000..07f5b2a
--- /dev/null
+++ b/node_modules/@tensorflow/tfjs-core/dist/io/io.js
@@ -0,0 +1,33 @@
+"use strict";
+Object.defineProperty(exports, "__esModule", { value: true });
+require("./indexed_db");
+require("./local_storage");
+var browser_files_1 = require("./browser_files");
+exports.browserFiles = browser_files_1.browserFiles;
+var browser_http_1 = require("./browser_http");
+exports.browserHTTPRequest = browser_http_1.browserHTTPRequest;
+var io_utils_1 = require("./io_utils");
+exports.concatenateArrayBuffers = io_utils_1.concatenateArrayBuffers;
+exports.decodeWeights = io_utils_1.decodeWeights;
+exports.encodeWeights = io_utils_1.encodeWeights;
+exports.getModelArtifactsInfoForJSON = io_utils_1.getModelArtifactsInfoForJSON;
+var passthrough_1 = require("./passthrough");
+exports.fromMemory = passthrough_1.fromMemory;
+exports.withSaveHandler = passthrough_1.withSaveHandler;
+var router_registry_1 = require("./router_registry");
+var weights_loader_1 = require("./weights_loader");
+exports.loadWeights = weights_loader_1.loadWeights;
+var registerSaveRouter = router_registry_1.IORouterRegistry.registerSaveRouter;
+exports.registerSaveRouter = registerSaveRouter;
+var registerLoadRouter = router_registry_1.IORouterRegistry.registerLoadRouter;
+exports.registerLoadRouter = registerLoadRouter;
+var getSaveHandlers = router_registry_1.IORouterRegistry.getSaveHandlers;
+exports.getSaveHandlers = getSaveHandlers;
+var getLoadHandlers = router_registry_1.IORouterRegistry.getLoadHandlers;
+exports.getLoadHandlers = getLoadHandlers;
+var model_management_1 = require("./model_management");
+exports.copyModel = model_management_1.copyModel;
+exports.listModels = model_management_1.listModels;
+exports.moveModel = model_management_1.moveModel;
+exports.removeModel = model_management_1.removeModel;
+//# sourceMappingURL=io.js.map
\ No newline at end of file
diff --git a/node_modules/@tensorflow/tfjs-core/dist/io/io.js.map b/node_modules/@tensorflow/tfjs-core/dist/io/io.js.map
new file mode 100644
index 0000000..fae71e4
--- /dev/null
+++ b/node_modules/@tensorflow/tfjs-core/dist/io/io.js.map
@@ -0,0 +1 @@
+{"version":3,"file":"io.js","sourceRoot":"","sources":["../../src/io/io.ts"],"names":[],"mappings":";;AAmBA,wBAAsB;AACtB,2BAAyB;AAEzB,iDAA6C;AAgB3C,uBAhBM,4BAAY,CAgBN;AAfd,+CAAkD;AAgBhD,6BAhBM,iCAAkB,CAgBN;AAfpB,uCAA+G;AAgB7G,kCAhBM,kCAAuB,CAgBN;AACvB,wBAjB+B,wBAAa,CAiB/B;AACb,wBAlB8C,wBAAa,CAkB9C;AAGb,uCArB6D,uCAA4B,CAqB7D;AApB9B,6CAA0D;AAkBxD,qBAlBM,wBAAU,CAkBN;AAgBV,0BAlCkB,6BAAe,CAkClB;AAjCjB,qDAAmD;AAEnD,mDAA6C;AAqB3C,sBArBM,4BAAW,CAqBN;AAnBb,IAAM,kBAAkB,GAAG,kCAAgB,CAAC,kBAAkB,CAAC;AAuB7D,gDAAkB;AAtBpB,IAAM,kBAAkB,GAAG,kCAAgB,CAAC,kBAAkB,CAAC;AAqB7D,gDAAkB;AApBpB,IAAM,eAAe,GAAG,kCAAgB,CAAC,eAAe,CAAC;AAcvD,0CAAe;AAbjB,IAAM,eAAe,GAAG,kCAAgB,CAAC,eAAe,CAAC;AAWvD,0CAAe;AATjB,uDAAiF;AAAzE,uCAAA,SAAS,CAAA;AAAE,wCAAA,UAAU,CAAA;AAAE,uCAAA,SAAS,CAAA;AAAE,yCAAA,WAAW,CAAA"}
\ No newline at end of file
diff --git a/node_modules/@tensorflow/tfjs-core/dist/io/io_utils.d.ts b/node_modules/@tensorflow/tfjs-core/dist/io/io_utils.d.ts
new file mode 100644
index 0000000..8c70b11
--- /dev/null
+++ b/node_modules/@tensorflow/tfjs-core/dist/io/io_utils.d.ts
@@ -0,0 +1,15 @@
+import { NamedTensorMap } from '../tensor_types';
+import { TypedArray } from '../types';
+import { ModelArtifacts, ModelArtifactsInfo, WeightsManifestEntry } from './types';
+export declare function encodeWeights(tensors: NamedTensorMap): Promise<{
+ data: ArrayBuffer;
+ specs: WeightsManifestEntry[];
+}>;
+export declare function decodeWeights(buffer: ArrayBuffer, specs: WeightsManifestEntry[]): NamedTensorMap;
+export declare function concatenateTypedArrays(xs: TypedArray[]): ArrayBuffer;
+export declare function stringByteLength(str: string): number;
+export declare function arrayBufferToBase64String(buffer: ArrayBuffer): string;
+export declare function base64StringToArrayBuffer(str: string): ArrayBuffer;
+export declare function concatenateArrayBuffers(buffers: ArrayBuffer[]): ArrayBuffer;
+export declare function basename(path: string): string;
+export declare function getModelArtifactsInfoForJSON(modelArtifacts: ModelArtifacts): ModelArtifactsInfo;
diff --git a/node_modules/@tensorflow/tfjs-core/dist/io/io_utils.js b/node_modules/@tensorflow/tfjs-core/dist/io/io_utils.js
new file mode 100644
index 0000000..0ccd90f
--- /dev/null
+++ b/node_modules/@tensorflow/tfjs-core/dist/io/io_utils.js
@@ -0,0 +1,195 @@
+"use strict";
+var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
+ return new (P || (P = Promise))(function (resolve, reject) {
+ function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
+ function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
+ function step(result) { result.done ? resolve(result.value) : new P(function (resolve) { resolve(result.value); }).then(fulfilled, rejected); }
+ step((generator = generator.apply(thisArg, _arguments || [])).next());
+ });
+};
+var __generator = (this && this.__generator) || function (thisArg, body) {
+ var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;
+ return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
+ function verb(n) { return function (v) { return step([n, v]); }; }
+ function step(op) {
+ if (f) throw new TypeError("Generator is already executing.");
+ while (_) try {
+ if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;
+ if (y = 0, t) op = [op[0] & 2, t.value];
+ switch (op[0]) {
+ case 0: case 1: t = op; break;
+ case 4: _.label++; return { value: op[1], done: false };
+ case 5: _.label++; y = op[1]; op = [0]; continue;
+ case 7: op = _.ops.pop(); _.trys.pop(); continue;
+ default:
+ if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }
+ if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }
+ if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }
+ if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }
+ if (t[2]) _.ops.pop();
+ _.trys.pop(); continue;
+ }
+ op = body.call(thisArg, _);
+ } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }
+ if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };
+ }
+};
+Object.defineProperty(exports, "__esModule", { value: true });
+var tensor_ops_1 = require("../ops/tensor_ops");
+var util_1 = require("../util");
+var types_1 = require("./types");
+function encodeWeights(tensors) {
+ return __awaiter(this, void 0, void 0, function () {
+ var specs, dataPromises, name_1, t, tensorValues;
+ return __generator(this, function (_a) {
+ switch (_a.label) {
+ case 0:
+ specs = [];
+ dataPromises = [];
+ for (name_1 in tensors) {
+ t = tensors[name_1];
+ if (t.dtype !== 'float32' && t.dtype !== 'int32' && t.dtype !== 'bool') {
+ throw new Error("Unsupported dtype in weight '" + name_1 + "': " + t.dtype);
+ }
+ specs.push({ name: name_1, shape: t.shape, dtype: t.dtype });
+ dataPromises.push(t.data());
+ }
+ return [4, Promise.all(dataPromises)];
+ case 1:
+ tensorValues = _a.sent();
+ return [2, { data: concatenateTypedArrays(tensorValues), specs: specs }];
+ }
+ });
+ });
+}
+exports.encodeWeights = encodeWeights;
+function decodeWeights(buffer, specs) {
+ var out = {};
+ var offset = 0;
+ for (var _i = 0, specs_1 = specs; _i < specs_1.length; _i++) {
+ var spec = specs_1[_i];
+ var name_2 = spec.name;
+ var dtype = spec.dtype;
+ var shape = spec.shape;
+ if (spec.quantization != null) {
+ throw new Error("decodeWeights does not support quantization yet, but encountered " +
+ ("weight '" + name_2 + " with quantization.'"));
+ }
+ var size = util_1.sizeFromShape(shape);
+ var value = void 0;
+ if (dtype === 'float32') {
+ value = tensor_ops_1.tensor(new Float32Array(buffer, offset, size), shape, 'float32');
+ }
+ else if (dtype === 'int32') {
+ value = tensor_ops_1.tensor(new Int32Array(buffer, offset, size), shape, 'int32');
+ }
+ else if (dtype === 'bool') {
+ value = tensor_ops_1.tensor(new Uint8Array(buffer, offset, size), shape, 'bool');
+ }
+ else {
+ throw new Error("Unsupported dtype in weight '" + name_2 + "': " + dtype);
+ }
+ out[name_2] = value;
+ offset += size * types_1.DTYPE_VALUE_SIZE_MAP[dtype];
+ }
+ return out;
+}
+exports.decodeWeights = decodeWeights;
+function concatenateTypedArrays(xs) {
+ if (xs === null) {
+ throw new Error("Invalid input value: " + JSON.stringify(xs));
+ }
+ var totalByteLength = 0;
+ var normalizedXs = [];
+ xs.forEach(function (x) {
+ totalByteLength += x.byteLength;
+ normalizedXs.push(x.byteLength === x.buffer.byteLength ? x :
+ new x.constructor(x));
+ if (!(x instanceof Float32Array || x instanceof Int32Array ||
+ x instanceof Uint8Array)) {
+ throw new Error("Unsupported TypedArray subtype: " + x.constructor.name);
+ }
+ });
+ var y = new Uint8Array(totalByteLength);
+ var offset = 0;
+ normalizedXs.forEach(function (x) {
+ y.set(new Uint8Array(x.buffer), offset);
+ offset += x.byteLength;
+ });
+ return y.buffer;
+}
+exports.concatenateTypedArrays = concatenateTypedArrays;
+var useNodeBuffer = typeof Buffer !== 'undefined' &&
+ (typeof Blob === 'undefined' || typeof atob === 'undefined' ||
+ typeof btoa === 'undefined');
+function stringByteLength(str) {
+ if (useNodeBuffer) {
+ return Buffer.byteLength(str);
+ }
+ return new Blob([str]).size;
+}
+exports.stringByteLength = stringByteLength;
+function arrayBufferToBase64String(buffer) {
+ if (useNodeBuffer) {
+ return Buffer.from(buffer).toString('base64');
+ }
+ return btoa(String.fromCharCode.apply(null, new Uint8Array(buffer)));
+}
+exports.arrayBufferToBase64String = arrayBufferToBase64String;
+function base64StringToArrayBuffer(str) {
+ if (useNodeBuffer) {
+ var buf = Buffer.from(str, 'base64');
+ return buf.buffer.slice(buf.byteOffset, buf.byteOffset + buf.byteLength);
+ }
+ var s = atob(str);
+ var buffer = new Uint8Array(s.length);
+ for (var i = 0; i < s.length; ++i) {
+ buffer.set([s.charCodeAt(i)], i);
+ }
+ return buffer.buffer;
+}
+exports.base64StringToArrayBuffer = base64StringToArrayBuffer;
+function concatenateArrayBuffers(buffers) {
+ var totalByteLength = 0;
+ buffers.forEach(function (buffer) {
+ totalByteLength += buffer.byteLength;
+ });
+ var temp = new Uint8Array(totalByteLength);
+ var offset = 0;
+ buffers.forEach(function (buffer) {
+ temp.set(new Uint8Array(buffer), offset);
+ offset += buffer.byteLength;
+ });
+ return temp.buffer;
+}
+exports.concatenateArrayBuffers = concatenateArrayBuffers;
+function basename(path) {
+ var SEPARATOR = '/';
+ path = path.trim();
+ while (path.endsWith(SEPARATOR)) {
+ path = path.slice(0, path.length - 1);
+ }
+ var items = path.split(SEPARATOR);
+ return items[items.length - 1];
+}
+exports.basename = basename;
+function getModelArtifactsInfoForJSON(modelArtifacts) {
+ if (modelArtifacts.modelTopology instanceof ArrayBuffer) {
+ throw new Error('Expected JSON model topology, received ArrayBuffer.');
+ }
+ return {
+ dateSaved: new Date(),
+ modelTopologyType: 'JSON',
+ modelTopologyBytes: modelArtifacts.modelTopology == null ?
+ 0 :
+ stringByteLength(JSON.stringify(modelArtifacts.modelTopology)),
+ weightSpecsBytes: modelArtifacts.weightSpecs == null ?
+ 0 :
+ stringByteLength(JSON.stringify(modelArtifacts.weightSpecs)),
+ weightDataBytes: modelArtifacts.weightData == null ?
+ 0 :
+ modelArtifacts.weightData.byteLength,
+ };
+}
+exports.getModelArtifactsInfoForJSON = getModelArtifactsInfoForJSON;
+//# sourceMappingURL=io_utils.js.map
\ No newline at end of file
diff --git a/node_modules/@tensorflow/tfjs-core/dist/io/io_utils.js.map b/node_modules/@tensorflow/tfjs-core/dist/io/io_utils.js.map
new file mode 100644
index 0000000..e8e3574
--- /dev/null
+++ b/node_modules/@tensorflow/tfjs-core/dist/io/io_utils.js.map
@@ -0,0 +1 @@
+{"version":3,"file":"io_utils.js","sourceRoot":"","sources":["../../src/io/io_utils.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAiBA,gDAAyC;AAIzC,gCAAsC;AACtC,iCAAuG;AAkBvG,uBAAoC,OAAuB;;;;;;oBAGnD,KAAK,GAA2B,EAAE,CAAC;oBACnC,YAAY,GAA+B,EAAE,CAAC;oBACpD,KAAW,MAAI,IAAI,OAAO,EAAE;wBACpB,CAAC,GAAG,OAAO,CAAC,MAAI,CAAC,CAAC;wBAExB,IAAI,CAAC,CAAC,KAAK,KAAK,SAAS,IAAI,CAAC,CAAC,KAAK,KAAK,OAAO,IAAI,CAAC,CAAC,KAAK,KAAK,MAAM,EAAE;4BACtE,MAAM,IAAI,KAAK,CAAC,kCAAgC,MAAI,WAAM,CAAC,CAAC,KAAO,CAAC,CAAC;yBACtE;wBACD,KAAK,CAAC,IAAI,CAAC,EAAC,IAAI,QAAA,EAAE,KAAK,EAAE,CAAC,CAAC,KAAK,EAAE,KAAK,EAAE,CAAC,CAAC,KAAK,EAAC,CAAC,CAAC;wBACnD,YAAY,CAAC,IAAI,CAAC,CAAC,CAAC,IAAI,EAAE,CAAC,CAAC;qBAC7B;oBACoB,WAAM,OAAO,CAAC,GAAG,CAAC,YAAY,CAAC,EAAA;;oBAA9C,YAAY,GAAG,SAA+B;oBACpD,WAAO,EAAC,IAAI,EAAE,sBAAsB,CAAC,YAAY,CAAC,EAAE,KAAK,OAAA,EAAC,EAAC;;;;CAC5D;AAhBD,sCAgBC;AAiBD,uBACI,MAAmB,EAAE,KAA6B;IAEpD,IAAM,GAAG,GAAmB,EAAE,CAAC;IAC/B,IAAI,MAAM,GAAG,CAAC,CAAC;IACf,KAAmB,UAAK,EAAL,eAAK,EAAL,mBAA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AAC,SAAS,CAAC,cAAc,CAAC,WAAW,CAAC,CAAC;QAChE,eAAe,EAAE,cAAc,CAAC,UAAU,IAAI,IAAI,CAAC,CAAC;YAChD,CAAC,CAAC,CAAC;YACH,cAAc,CAAC,UAAU,CAAC,UAAU;KACzC,CAAC;AACJ,CAAC;AAnBD,oEAmBC"}
\ No newline at end of file
diff --git a/node_modules/@tensorflow/tfjs-core/dist/io/io_utils_test.d.ts b/node_modules/@tensorflow/tfjs-core/dist/io/io_utils_test.d.ts
new file mode 100644
index 0000000..cb0ff5c
--- /dev/null
+++ b/node_modules/@tensorflow/tfjs-core/dist/io/io_utils_test.d.ts
@@ -0,0 +1 @@
+export {};
diff --git a/node_modules/@tensorflow/tfjs-core/dist/io/io_utils_test.js b/node_modules/@tensorflow/tfjs-core/dist/io/io_utils_test.js
new file mode 100644
index 0000000..387305d
--- /dev/null
+++ b/node_modules/@tensorflow/tfjs-core/dist/io/io_utils_test.js
@@ -0,0 +1,465 @@
+"use strict";
+var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
+ return new (P || (P = Promise))(function (resolve, reject) {
+ function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
+ function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
+ function step(result) { result.done ? resolve(result.value) : new P(function (resolve) { resolve(result.value); }).then(fulfilled, rejected); }
+ step((generator = generator.apply(thisArg, _arguments || [])).next());
+ });
+};
+var __generator = (this && this.__generator) || function (thisArg, body) {
+ var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;
+ return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
+ function verb(n) { return function (v) { return step([n, v]); }; }
+ function step(op) {
+ if (f) throw new TypeError("Generator is already executing.");
+ while (_) try {
+ if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;
+ if (y = 0, t) op = [op[0] & 2, t.value];
+ switch (op[0]) {
+ case 0: case 1: t = op; break;
+ case 4: _.label++; return { value: op[1], done: false };
+ case 5: _.label++; y = op[1]; op = [0]; continue;
+ case 7: op = _.ops.pop(); _.trys.pop(); continue;
+ default:
+ if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }
+ if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }
+ if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }
+ if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }
+ if (t[2]) _.ops.pop();
+ _.trys.pop(); continue;
+ }
+ op = body.call(thisArg, _);
+ } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }
+ if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };
+ }
+};
+var _this = this;
+Object.defineProperty(exports, "__esModule", { value: true });
+var tf = require("../index");
+var ops_1 = require("../ops/ops");
+var test_util_1 = require("../test_util");
+var io_utils_1 = require("./io_utils");
+describe('concatenateTypedArrays', function () {
+ it('Single float arrays', function () {
+ var x = new Float32Array([1.1, 2.2, 3.3]);
+ var buffer = io_utils_1.concatenateTypedArrays([x]);
+ expect(buffer.byteLength).toEqual(12);
+ expect(new Float32Array(buffer, 0, 3)).toEqual(x);
+ });
+ it('Float arrays', function () {
+ var x = new Float32Array([1.1, 2.2, 3.3]);
+ var y = new Float32Array([-1.1, -2.2, -3.3]);
+ var buffer = io_utils_1.concatenateTypedArrays([x, y]);
+ expect(buffer.byteLength).toEqual(24);
+ expect(new Float32Array(buffer, 0, 3)).toEqual(x);
+ expect(new Float32Array(buffer, 12, 3)).toEqual(y);
+ });
+ it('Single int32 arrays', function () {
+ var x = new Int32Array([11, 22, 33]);
+ var buffer = io_utils_1.concatenateTypedArrays([x]);
+ expect(buffer.byteLength).toEqual(12);
+ expect(new Int32Array(buffer, 0, 3)).toEqual(x);
+ });
+ it('Int32 arrays', function () {
+ var x = new Int32Array([11, 22, 33]);
+ var y = new Int32Array([-11, -22, -33]);
+ var buffer = io_utils_1.concatenateTypedArrays([x, y]);
+ expect(buffer.byteLength).toEqual(24);
+ expect(new Int32Array(buffer, 0, 3)).toEqual(x);
+ expect(new Int32Array(buffer, 12, 3)).toEqual(y);
+ });
+ it('Single uint8 arrays', function () {
+ var x = new Uint8Array([11, 22, 33]);
+ var buffer = io_utils_1.concatenateTypedArrays([x]);
+ expect(buffer.byteLength).toEqual(3);
+ expect(new Uint8Array(buffer, 0, 3)).toEqual(x);
+ });
+ it('Uint8 arrays', function () {
+ var x = new Uint8Array([11, 22, 33]);
+ var y = new Uint8Array([111, 122, 133]);
+ var buffer = io_utils_1.concatenateTypedArrays([x, y]);
+ expect(buffer.byteLength).toEqual(6);
+ expect(new Uint8Array(buffer, 0, 3)).toEqual(x);
+ expect(new Uint8Array(buffer, 3, 3)).toEqual(y);
+ });
+ it('Mixed Uint8, Int32 and Float32 arrays', function () {
+ var x = new Uint8Array([0, 1, 1, 0]);
+ var y = new Int32Array([10, 20, 30, 40]);
+ var z = new Float32Array([-1.1, -2.2, -3.3, -4.4]);
+ var buffer = io_utils_1.concatenateTypedArrays([x, y, z]);
+ expect(buffer.byteLength).toEqual(1 * 4 + 4 * 4 + 4 * 4);
+ expect(new Uint8Array(buffer, 0, 4)).toEqual(x);
+ expect(new Int32Array(buffer, 4, 4)).toEqual(y);
+ expect(new Float32Array(buffer, 20, 4)).toEqual(z);
+ });
+ it('Concatenate Float32Arrays from SubArrays', function () {
+ var x1 = new Float32Array([1.1, 2.2, 3.3]);
+ var x2 = new Float32Array([-1.1, -2.2, -3.3]);
+ var xConcatenated = io_utils_1.concatenateTypedArrays([x1, x2]);
+ var y1 = new Float32Array(xConcatenated, 0, 3);
+ var y2 = new Float32Array(xConcatenated, 3 * 4, 3);
+ expect(y1.buffer.byteLength).toEqual(6 * 4);
+ expect(y2.buffer.byteLength).toEqual(6 * 4);
+ var yConcatenated = io_utils_1.concatenateTypedArrays([y1, y2]);
+ expect(yConcatenated.byteLength).toEqual(6 * 4);
+ expect(new Float32Array(yConcatenated, 0, 3)).toEqual(x1);
+ expect(new Float32Array(yConcatenated, 3 * 4, 3)).toEqual(x2);
+ });
+ it('Concatenate Int32Array from SubArrays', function () {
+ var x1 = new Int32Array([11, 22, 33]);
+ var x2 = new Int32Array([-11, -22, -33]);
+ var xConcatenated = io_utils_1.concatenateTypedArrays([x1, x2]);
+ var y1 = new Int32Array(xConcatenated, 0, 3);
+ var y2 = new Int32Array(xConcatenated, 3 * 4, 3);
+ expect(y1.buffer.byteLength).toEqual(6 * 4);
+ expect(y2.buffer.byteLength).toEqual(6 * 4);
+ var yConcatenated = io_utils_1.concatenateTypedArrays([y1, y2]);
+ expect(yConcatenated.byteLength).toEqual(6 * 4);
+ expect(new Int32Array(yConcatenated, 0, 3)).toEqual(x1);
+ expect(new Int32Array(yConcatenated, 3 * 4, 3)).toEqual(x2);
+ });
+ it('Concatenate Uint8Array from SubArrays', function () {
+ var x1 = new Uint8Array([11, 22, 33]);
+ var x2 = new Uint8Array([44, 55, 66]);
+ var xConcatenated = io_utils_1.concatenateTypedArrays([x1, x2]);
+ var y1 = new Uint8Array(xConcatenated, 0, 3);
+ var y2 = new Uint8Array(xConcatenated, 3, 3);
+ expect(y1.buffer.byteLength).toEqual(6);
+ expect(y2.buffer.byteLength).toEqual(6);
+ var yConcatenated = io_utils_1.concatenateTypedArrays([y1, y2]);
+ expect(yConcatenated.byteLength).toEqual(6);
+ expect(new Uint8Array(yConcatenated, 0, 3)).toEqual(x1);
+ expect(new Uint8Array(yConcatenated, 3, 3)).toEqual(x2);
+ });
+ it('Concatenate mixed TypedArrays from SubArrays', function () {
+ var x1 = new Uint8Array([11, 22, 33, 44]);
+ var x2 = new Int32Array([-44, -55, -66]);
+ var x3 = new Float32Array([1.1, 2.2, 3.3]);
+ var xConcatenated = io_utils_1.concatenateTypedArrays([x1, x2, x3]);
+ var y1 = new Uint8Array(xConcatenated, 0, 4);
+ var y2 = new Int32Array(xConcatenated, 4, 3);
+ var y3 = new Float32Array(xConcatenated, 4 + 3 * 4, 3);
+ expect(y1.buffer.byteLength).toEqual(4 + 3 * 4 + 3 * 4);
+ expect(y2.buffer.byteLength).toEqual(4 + 3 * 4 + 3 * 4);
+ expect(y3.buffer.byteLength).toEqual(4 + 3 * 4 + 3 * 4);
+ var yConcatenated = io_utils_1.concatenateTypedArrays([y1, y2, y3]);
+ expect(yConcatenated.byteLength).toEqual(4 + 3 * 4 + 3 * 4);
+ expect(new Uint8Array(yConcatenated, 0, 4)).toEqual(x1);
+ expect(new Int32Array(yConcatenated, 4, 3)).toEqual(x2);
+ expect(new Float32Array(yConcatenated, 4 + 3 * 4, 3)).toEqual(x3);
+ });
+ it('null and undefined inputs', function () {
+ expect(function () { return io_utils_1.concatenateTypedArrays(null); }).toThrow();
+ expect(function () { return io_utils_1.concatenateTypedArrays(undefined); }).toThrow();
+ });
+ it('empty input array', function () {
+ expect(io_utils_1.concatenateTypedArrays([]).byteLength).toEqual(0);
+ });
+ it('Unsupported dtype', function () {
+ var x = new Int16Array([0, 1, 1, 0]);
+ expect(function () { return io_utils_1.concatenateTypedArrays([x]); })
+ .toThrowError(/Unsupported TypedArray subtype: Int16Array/);
+ });
+});
+describe('encodeWeights', function () {
+ it('Float32 tensors', function (done) { return __awaiter(_this, void 0, void 0, function () {
+ var tensors;
+ return __generator(this, function (_a) {
+ tensors = {
+ x1: ops_1.tensor2d([[10, 20], [30, 40]]),
+ x2: ops_1.scalar(42),
+ x3: ops_1.tensor1d([-1.3, -3.7, 1.3, 3.7]),
+ };
+ tf.io.encodeWeights(tensors)
+ .then(function (dataAndSpecs) {
+ var data = dataAndSpecs.data;
+ var specs = dataAndSpecs.specs;
+ expect(data.byteLength).toEqual(4 * (4 + 1 + 4));
+ expect(new Float32Array(data, 0, 4)).toEqual(new Float32Array([
+ 10, 20, 30, 40
+ ]));
+ expect(new Float32Array(data, 16, 1)).toEqual(new Float32Array([42]));
+ expect(new Float32Array(data, 20, 4)).toEqual(new Float32Array([
+ -1.3, -3.7, 1.3, 3.7
+ ]));
+ expect(specs).toEqual([
+ {
+ name: 'x1',
+ dtype: 'float32',
+ shape: [2, 2],
+ },
+ {
+ name: 'x2',
+ dtype: 'float32',
+ shape: [],
+ },
+ {
+ name: 'x3',
+ dtype: 'float32',
+ shape: [4],
+ }
+ ]);
+ done();
+ })
+ .catch(function (err) {
+ console.error(err.stack);
+ });
+ return [2];
+ });
+ }); });
+ it('Int32 tensors', function (done) { return __awaiter(_this, void 0, void 0, function () {
+ var tensors;
+ return __generator(this, function (_a) {
+ tensors = {
+ x1: ops_1.tensor2d([[10, 20], [30, 40]], [2, 2], 'int32'),
+ x2: ops_1.scalar(42, 'int32'),
+ x3: ops_1.tensor1d([-1, -3, -3, -7], 'int32'),
+ };
+ tf.io.encodeWeights(tensors)
+ .then(function (dataAndSpecs) {
+ var data = dataAndSpecs.data;
+ var specs = dataAndSpecs.specs;
+ expect(data.byteLength).toEqual(4 * (4 + 1 + 4));
+ expect(new Int32Array(data, 0, 4)).toEqual(new Int32Array([
+ 10, 20, 30, 40
+ ]));
+ expect(new Int32Array(data, 16, 1)).toEqual(new Int32Array([42]));
+ expect(new Int32Array(data, 20, 4)).toEqual(new Int32Array([
+ -1, -3, -3, -7
+ ]));
+ expect(specs).toEqual([
+ {
+ name: 'x1',
+ dtype: 'int32',
+ shape: [2, 2],
+ },
+ {
+ name: 'x2',
+ dtype: 'int32',
+ shape: [],
+ },
+ {
+ name: 'x3',
+ dtype: 'int32',
+ shape: [4],
+ }
+ ]);
+ done();
+ })
+ .catch(function (err) {
+ console.error(err.stack);
+ });
+ return [2];
+ });
+ }); });
+ it('Bool tensors', function (done) { return __awaiter(_this, void 0, void 0, function () {
+ var tensors;
+ return __generator(this, function (_a) {
+ tensors = {
+ x1: ops_1.tensor2d([[true, false], [false, true]], [2, 2], 'bool'),
+ x2: ops_1.scalar(false, 'bool'),
+ x3: ops_1.tensor1d([false, true, true, false], 'bool'),
+ };
+ tf.io.encodeWeights(tensors)
+ .then(function (dataAndSpecs) {
+ var data = dataAndSpecs.data;
+ var specs = dataAndSpecs.specs;
+ expect(data.byteLength).toEqual(4 + 1 + 4);
+ expect(new Uint8Array(data, 0, 4)).toEqual(new Uint8Array([
+ 1, 0, 0, 1
+ ]));
+ expect(new Uint8Array(data, 4, 1)).toEqual(new Uint8Array([0]));
+ expect(new Uint8Array(data, 5, 4)).toEqual(new Uint8Array([
+ 0, 1, 1, 0
+ ]));
+ expect(specs).toEqual([
+ {
+ name: 'x1',
+ dtype: 'bool',
+ shape: [2, 2],
+ },
+ {
+ name: 'x2',
+ dtype: 'bool',
+ shape: [],
+ },
+ {
+ name: 'x3',
+ dtype: 'bool',
+ shape: [4],
+ }
+ ]);
+ done();
+ })
+ .catch(function (err) {
+ console.error(err.stack);
+ });
+ return [2];
+ });
+ }); });
+ it('Mixed dtype tensors', function (done) { return __awaiter(_this, void 0, void 0, function () {
+ var tensors;
+ return __generator(this, function (_a) {
+ tensors = {
+ x1: ops_1.tensor2d([[10, 20], [30, 40]], [2, 2], 'int32'),
+ x2: ops_1.scalar(13.37, 'float32'),
+ x3: ops_1.tensor1d([true, false, false, true], 'bool'),
+ };
+ tf.io.encodeWeights(tensors)
+ .then(function (dataAndSpecs) {
+ var data = dataAndSpecs.data;
+ var specs = dataAndSpecs.specs;
+ expect(data.byteLength).toEqual(4 * 4 + 4 * 1 + 1 * 4);
+ expect(new Int32Array(data, 0, 4)).toEqual(new Int32Array([
+ 10, 20, 30, 40
+ ]));
+ expect(new Float32Array(data, 16, 1))
+ .toEqual(new Float32Array([13.37]));
+ expect(new Uint8Array(data, 20, 4)).toEqual(new Uint8Array([
+ 1, 0, 0, 1
+ ]));
+ expect(specs).toEqual([
+ {
+ name: 'x1',
+ dtype: 'int32',
+ shape: [2, 2],
+ },
+ {
+ name: 'x2',
+ dtype: 'float32',
+ shape: [],
+ },
+ {
+ name: 'x3',
+ dtype: 'bool',
+ shape: [4],
+ }
+ ]);
+ done();
+ })
+ .catch(function (err) {
+ console.error(err.stack);
+ });
+ return [2];
+ });
+ }); });
+});
+describe('decodeWeights', function () {
+ it('Mixed dtype tensors', function (done) { return __awaiter(_this, void 0, void 0, function () {
+ var tensors;
+ return __generator(this, function (_a) {
+ tensors = {
+ x1: ops_1.tensor2d([[10, 20], [30, 40]], [2, 2], 'int32'),
+ x2: ops_1.scalar(13.37, 'float32'),
+ x3: ops_1.tensor1d([true, false, false, true], 'bool'),
+ y1: ops_1.tensor2d([-10, -20, -30], [3, 1], 'float32'),
+ };
+ tf.io.encodeWeights(tensors)
+ .then(function (dataAndSpecs) {
+ var data = dataAndSpecs.data;
+ var specs = dataAndSpecs.specs;
+ expect(data.byteLength).toEqual(4 * 4 + 4 * 1 + 1 * 4 + 4 * 3);
+ var decoded = tf.io.decodeWeights(data, specs);
+ expect(Object.keys(decoded).length).toEqual(4);
+ test_util_1.expectArraysEqual(decoded['x1'], tensors['x1']);
+ test_util_1.expectArraysEqual(decoded['x2'], tensors['x2']);
+ test_util_1.expectArraysEqual(decoded['x3'], tensors['x3']);
+ test_util_1.expectArraysEqual(decoded['y1'], tensors['y1']);
+ done();
+ })
+ .catch(function (err) {
+ console.error(err.stack);
+ });
+ return [2];
+ });
+ }); });
+ it('Unsupported dtype raises Error', function () {
+ var buffer = new ArrayBuffer(4);
+ var specs = [
+ {
+ name: 'x',
+ dtype: 'int16',
+ shape: [],
+ },
+ { name: 'y', dtype: 'int16', shape: [] }
+ ];
+ expect(function () { return tf.io.decodeWeights(buffer, specs); })
+ .toThrowError(/Unsupported dtype in weight \'x\': int16/);
+ });
+});
+describe('stringByteLength', function () {
+ it('ASCII only', function () {
+ var str = '_Lorem ipsum 1337!';
+ expect(io_utils_1.stringByteLength(str)).toEqual(str.length);
+ });
+ it('Mixed narrow and wide chars', function () {
+ var str = 'aЖ文1';
+ expect(io_utils_1.stringByteLength(str.slice(0, 1))).toEqual(1);
+ expect(io_utils_1.stringByteLength(str.slice(0, 2))).toEqual(3);
+ expect(io_utils_1.stringByteLength(str.slice(0, 3))).toEqual(6);
+ expect(io_utils_1.stringByteLength(str.slice(0, 4))).toEqual(7);
+ });
+});
+describe('arrayBufferToBase64String-base64StringToArrayBuffer', function () {
+ it('Round trip', function () {
+ var x = [];
+ for (var k = 0; k < 2; ++k) {
+ for (var i = 0; i < 254; ++i) {
+ x.push(i + k);
+ }
+ for (var i = 254; i >= 0; --i) {
+ x.push(i + k);
+ }
+ }
+ var buffer = Uint8Array.from(x).buffer;
+ var base64Str = io_utils_1.arrayBufferToBase64String(buffer);
+ var decoded = Array.from(new Uint8Array(io_utils_1.base64StringToArrayBuffer(base64Str)));
+ expect(decoded).toEqual(x);
+ });
+});
+describe('concatenateArrayBuffers', function () {
+ it('Concatenate 3 non-empty ArrayBuffers', function () {
+ var buffer1 = new Uint8Array([1, 2, 3]);
+ var buffer2 = new Uint8Array([11, 22, 33, 44]);
+ var buffer3 = new Uint8Array([111, 222, 100]);
+ var out = io_utils_1.concatenateArrayBuffers([buffer1.buffer, buffer2.buffer, buffer3.buffer]);
+ expect(new Uint8Array(out)).toEqual(new Uint8Array([
+ 1, 2, 3, 11, 22, 33, 44, 111, 222, 100
+ ]));
+ });
+ it('Concatenate non-empty and empty ArrayBuffers', function () {
+ var buffer1 = new Uint8Array([1, 2, 3]);
+ var buffer2 = new Uint8Array([11, 22, 33, 44]);
+ var buffer3 = new Uint8Array([]);
+ var buffer4 = new Uint8Array([150, 100, 50]);
+ var out = io_utils_1.concatenateArrayBuffers([buffer1.buffer, buffer2.buffer, buffer3.buffer, buffer4.buffer]);
+ expect(new Uint8Array(out)).toEqual(new Uint8Array([
+ 1, 2, 3, 11, 22, 33, 44, 150, 100, 50
+ ]));
+ });
+ it('A single ArrayBuffer', function () {
+ var buffer1 = new Uint8Array([1, 3, 3, 7]);
+ var out = io_utils_1.concatenateArrayBuffers([buffer1.buffer]);
+ expect(new Uint8Array(out)).toEqual(buffer1);
+ });
+ it('Zero ArrayBuffers', function () {
+ expect(new Uint8Array(io_utils_1.concatenateArrayBuffers([])))
+ .toEqual(new Uint8Array([]));
+ });
+});
+describe('basename', function () {
+ it('Paths without slashes', function () {
+ expect(io_utils_1.basename('foo.txt')).toEqual('foo.txt');
+ expect(io_utils_1.basename('bar')).toEqual('bar');
+ });
+ it('Paths with slashes', function () {
+ expect(io_utils_1.basename('qux/foo.txt')).toEqual('foo.txt');
+ expect(io_utils_1.basename('qux/My Model.json')).toEqual('My Model.json');
+ expect(io_utils_1.basename('foo/bar/baz')).toEqual('baz');
+ expect(io_utils_1.basename('/foo/bar/baz')).toEqual('baz');
+ expect(io_utils_1.basename('foo/bar/baz/')).toEqual('baz');
+ expect(io_utils_1.basename('foo/bar/baz//')).toEqual('baz');
+ });
+});
+//# sourceMappingURL=io_utils_test.js.map
\ No newline at end of file
diff --git a/node_modules/@tensorflow/tfjs-core/dist/io/io_utils_test.js.map b/node_modules/@tensorflow/tfjs-core/dist/io/io_utils_test.js.map
new file mode 100644
index 0000000..eebc1ba
--- /dev/null
+++ b/node_modules/@tensorflow/tfjs-core/dist/io/io_utils_test.js.map
@@ -0,0 +1 @@
+{"version":3,"file":"io_utils_test.js","sourceRoot":"","sources":["../../src/io/io_utils_test.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAiBA,iBAycA;;AAzcA,6BAA+B;AAC/B,kCAAsD;AAEtD,0CAA+C;AAC/C,uCAA6J;AAE7J,QAAQ,CAAC,wBAAwB,EAAE;IACjC,EAAE,CAAC,qBAAqB,EAAE;QACxB,IAAM,CAAC,GAAG,IAAI,YAAY,CAAC,CAAC,GAAG,EAAE,GAAG,EAAE,GAAG,CAAC,CAAC,CAAC;QAC5C,IAAM,MAAM,GAAG,iCAAsB,CAAC,CAAC,CAAC,CAAC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AC,mBAAmB,CAAC,CAAC,CAAC,OAAO,CAAC,eAAe,CAAC,CAAC;QAC/D,MAAM,CAAC,mBAAQ,CAAC,aAAa,CAAC,CAAC,CAAC,OAAO,CAAC,KAAK,CAAC,CAAC;QAC/C,MAAM,CAAC,mBAAQ,CAAC,cAAc,CAAC,CAAC,CAAC,OAAO,CAAC,KAAK,CAAC,CAAC;QAChD,MAAM,CAAC,mBAAQ,CAAC,cAAc,CAAC,CAAC,CAAC,OAAO,CAAC,KAAK,CAAC,CAAC;QAChD,MAAM,CAAC,mBAAQ,CAAC,eAAe,CAAC,CAAC,CAAC,OAAO,CAAC,KAAK,CAAC,CAAC;IACnD,CAAC,CAAC,CAAC;AACL,CAAC,CAAC,CAAC"}
\ No newline at end of file
diff --git a/node_modules/@tensorflow/tfjs-core/dist/io/local_storage.d.ts b/node_modules/@tensorflow/tfjs-core/dist/io/local_storage.d.ts
new file mode 100644
index 0000000..567e324
--- /dev/null
+++ b/node_modules/@tensorflow/tfjs-core/dist/io/local_storage.d.ts
@@ -0,0 +1,24 @@
+import { IORouter } from './router_registry';
+import { IOHandler, ModelArtifacts, ModelArtifactsInfo, ModelStoreManager, SaveResult } from './types';
+export declare function purgeLocalStorageArtifacts(): string[];
+export declare class BrowserLocalStorage implements IOHandler {
+ protected readonly LS: Storage;
+ protected readonly modelPath: string;
+ protected readonly keys: {
+ [key: string]: string;
+ };
+ static readonly URL_SCHEME: string;
+ constructor(modelPath: string);
+ save(modelArtifacts: ModelArtifacts): Promise;
+ load(): Promise;
+}
+export declare const localStorageRouter: IORouter;
+export declare function browserLocalStorage(modelPath: string): IOHandler;
+export declare class BrowserLocalStorageManager implements ModelStoreManager {
+ private readonly LS;
+ constructor();
+ listModels(): Promise<{
+ [path: string]: ModelArtifactsInfo;
+ }>;
+ removeModel(path: string): Promise;
+}
diff --git a/node_modules/@tensorflow/tfjs-core/dist/io/local_storage.js b/node_modules/@tensorflow/tfjs-core/dist/io/local_storage.js
new file mode 100644
index 0000000..c2417d8
--- /dev/null
+++ b/node_modules/@tensorflow/tfjs-core/dist/io/local_storage.js
@@ -0,0 +1,246 @@
+"use strict";
+var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
+ return new (P || (P = Promise))(function (resolve, reject) {
+ function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
+ function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
+ function step(result) { result.done ? resolve(result.value) : new P(function (resolve) { resolve(result.value); }).then(fulfilled, rejected); }
+ step((generator = generator.apply(thisArg, _arguments || [])).next());
+ });
+};
+var __generator = (this && this.__generator) || function (thisArg, body) {
+ var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;
+ return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
+ function verb(n) { return function (v) { return step([n, v]); }; }
+ function step(op) {
+ if (f) throw new TypeError("Generator is already executing.");
+ while (_) try {
+ if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;
+ if (y = 0, t) op = [op[0] & 2, t.value];
+ switch (op[0]) {
+ case 0: case 1: t = op; break;
+ case 4: _.label++; return { value: op[1], done: false };
+ case 5: _.label++; y = op[1]; op = [0]; continue;
+ case 7: op = _.ops.pop(); _.trys.pop(); continue;
+ default:
+ if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }
+ if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }
+ if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }
+ if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }
+ if (t[2]) _.ops.pop();
+ _.trys.pop(); continue;
+ }
+ op = body.call(thisArg, _);
+ } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }
+ if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };
+ }
+};
+Object.defineProperty(exports, "__esModule", { value: true });
+var environment_1 = require("../environment");
+var util_1 = require("../util");
+var io_utils_1 = require("./io_utils");
+var model_management_1 = require("./model_management");
+var router_registry_1 = require("./router_registry");
+var PATH_SEPARATOR = '/';
+var PATH_PREFIX = 'tensorflowjs_models';
+var INFO_SUFFIX = 'info';
+var MODEL_TOPOLOGY_SUFFIX = 'model_topology';
+var WEIGHT_SPECS_SUFFIX = 'weight_specs';
+var WEIGHT_DATA_SUFFIX = 'weight_data';
+function purgeLocalStorageArtifacts() {
+ if (!environment_1.ENV.get('IS_BROWSER') || typeof window.localStorage === 'undefined') {
+ throw new Error('purgeLocalStorageModels() cannot proceed because local storage is ' +
+ 'unavailable in the current environment.');
+ }
+ var LS = window.localStorage;
+ var purgedModelPaths = [];
+ for (var i = 0; i < LS.length; ++i) {
+ var key = LS.key(i);
+ var prefix = PATH_PREFIX + PATH_SEPARATOR;
+ if (key.startsWith(prefix) && key.length > prefix.length) {
+ LS.removeItem(key);
+ var modelName = getModelPathFromKey(key);
+ if (purgedModelPaths.indexOf(modelName) === -1) {
+ purgedModelPaths.push(modelName);
+ }
+ }
+ }
+ return purgedModelPaths;
+}
+exports.purgeLocalStorageArtifacts = purgeLocalStorageArtifacts;
+function getModelKeys(path) {
+ return {
+ info: [PATH_PREFIX, path, INFO_SUFFIX].join(PATH_SEPARATOR),
+ topology: [PATH_PREFIX, path, MODEL_TOPOLOGY_SUFFIX].join(PATH_SEPARATOR),
+ weightSpecs: [PATH_PREFIX, path, WEIGHT_SPECS_SUFFIX].join(PATH_SEPARATOR),
+ weightData: [PATH_PREFIX, path, WEIGHT_DATA_SUFFIX].join(PATH_SEPARATOR)
+ };
+}
+function getModelPathFromKey(key) {
+ var items = key.split(PATH_SEPARATOR);
+ if (items.length < 3) {
+ throw new Error("Invalid key format: " + key);
+ }
+ return items.slice(1, items.length - 1).join(PATH_SEPARATOR);
+}
+function maybeStripScheme(key) {
+ return key.startsWith(BrowserLocalStorage.URL_SCHEME) ?
+ key.slice(BrowserLocalStorage.URL_SCHEME.length) :
+ key;
+}
+var BrowserLocalStorage = (function () {
+ function BrowserLocalStorage(modelPath) {
+ if (!environment_1.ENV.get('IS_BROWSER') || typeof window.localStorage === 'undefined') {
+ throw new Error('The current environment does not support local storage.');
+ }
+ this.LS = window.localStorage;
+ if (modelPath == null || !modelPath) {
+ throw new Error('For local storage, modelPath must not be null, undefined or empty.');
+ }
+ this.modelPath = modelPath;
+ this.keys = getModelKeys(this.modelPath);
+ }
+ BrowserLocalStorage.prototype.save = function (modelArtifacts) {
+ return __awaiter(this, void 0, void 0, function () {
+ var topology, weightSpecs, modelArtifactsInfo, key;
+ return __generator(this, function (_a) {
+ if (modelArtifacts.modelTopology instanceof ArrayBuffer) {
+ throw new Error('BrowserLocalStorage.save() does not support saving model topology ' +
+ 'in binary formats yet.');
+ }
+ else {
+ topology = JSON.stringify(modelArtifacts.modelTopology);
+ weightSpecs = JSON.stringify(modelArtifacts.weightSpecs);
+ modelArtifactsInfo = io_utils_1.getModelArtifactsInfoForJSON(modelArtifacts);
+ try {
+ this.LS.setItem(this.keys.info, JSON.stringify(modelArtifactsInfo));
+ this.LS.setItem(this.keys.topology, topology);
+ this.LS.setItem(this.keys.weightSpecs, weightSpecs);
+ this.LS.setItem(this.keys.weightData, io_utils_1.arrayBufferToBase64String(modelArtifacts.weightData));
+ return [2, { modelArtifactsInfo: modelArtifactsInfo }];
+ }
+ catch (err) {
+ for (key in this.keys) {
+ this.LS.removeItem(this.keys[key]);
+ }
+ throw new Error("Failed to save model '" + this.modelPath + "' to local storage: " +
+ "size quota being exceeded is a possible cause of this failure: " +
+ ("modelTopologyBytes=" + modelArtifactsInfo.modelTopologyBytes + ", ") +
+ ("weightSpecsBytes=" + modelArtifactsInfo.weightSpecsBytes + ", ") +
+ ("weightDataBytes=" + modelArtifactsInfo.weightDataBytes + "."));
+ }
+ }
+ return [2];
+ });
+ });
+ };
+ BrowserLocalStorage.prototype.load = function () {
+ return __awaiter(this, void 0, void 0, function () {
+ var info, out, topology, weightSpecs, weightDataBase64;
+ return __generator(this, function (_a) {
+ info = JSON.parse(this.LS.getItem(this.keys.info));
+ if (info == null) {
+ throw new Error("In local storage, there is no model with name '" + this.modelPath + "'");
+ }
+ if (info.modelTopologyType !== 'JSON') {
+ throw new Error('BrowserLocalStorage does not support loading non-JSON model ' +
+ 'topology yet.');
+ }
+ out = {};
+ topology = JSON.parse(this.LS.getItem(this.keys.topology));
+ if (topology == null) {
+ throw new Error("In local storage, the topology of model '" + this.modelPath + "' " +
+ "is missing.");
+ }
+ out.modelTopology = topology;
+ weightSpecs = JSON.parse(this.LS.getItem(this.keys.weightSpecs));
+ if (weightSpecs == null) {
+ throw new Error("In local storage, the weight specs of model '" + this.modelPath + "' " +
+ "are missing.");
+ }
+ out.weightSpecs = weightSpecs;
+ weightDataBase64 = this.LS.getItem(this.keys.weightData);
+ if (weightDataBase64 == null) {
+ throw new Error("In local storage, the binary weight values of model " +
+ ("'" + this.modelPath + "' are missing."));
+ }
+ out.weightData = io_utils_1.base64StringToArrayBuffer(weightDataBase64);
+ return [2, out];
+ });
+ });
+ };
+ BrowserLocalStorage.URL_SCHEME = 'localstorage://';
+ return BrowserLocalStorage;
+}());
+exports.BrowserLocalStorage = BrowserLocalStorage;
+exports.localStorageRouter = function (url) {
+ if (!environment_1.ENV.get('IS_BROWSER')) {
+ return null;
+ }
+ else {
+ if (url.startsWith(BrowserLocalStorage.URL_SCHEME)) {
+ return browserLocalStorage(url.slice(BrowserLocalStorage.URL_SCHEME.length));
+ }
+ else {
+ return null;
+ }
+ }
+};
+router_registry_1.IORouterRegistry.registerSaveRouter(exports.localStorageRouter);
+router_registry_1.IORouterRegistry.registerLoadRouter(exports.localStorageRouter);
+function browserLocalStorage(modelPath) {
+ return new BrowserLocalStorage(modelPath);
+}
+exports.browserLocalStorage = browserLocalStorage;
+var BrowserLocalStorageManager = (function () {
+ function BrowserLocalStorageManager() {
+ util_1.assert(environment_1.ENV.get('IS_BROWSER'), 'Current environment is not a web browser');
+ util_1.assert(typeof window.localStorage !== 'undefined', 'Current browser does not appear to support localStorage');
+ this.LS = window.localStorage;
+ }
+ BrowserLocalStorageManager.prototype.listModels = function () {
+ return __awaiter(this, void 0, void 0, function () {
+ var out, prefix, suffix, i, key, modelPath;
+ return __generator(this, function (_a) {
+ out = {};
+ prefix = PATH_PREFIX + PATH_SEPARATOR;
+ suffix = PATH_SEPARATOR + INFO_SUFFIX;
+ for (i = 0; i < this.LS.length; ++i) {
+ key = this.LS.key(i);
+ if (key.startsWith(prefix) && key.endsWith(suffix)) {
+ modelPath = getModelPathFromKey(key);
+ out[modelPath] = JSON.parse(this.LS.getItem(key));
+ }
+ }
+ return [2, out];
+ });
+ });
+ };
+ BrowserLocalStorageManager.prototype.removeModel = function (path) {
+ return __awaiter(this, void 0, void 0, function () {
+ var keys, info;
+ return __generator(this, function (_a) {
+ path = maybeStripScheme(path);
+ keys = getModelKeys(path);
+ if (this.LS.getItem(keys.info) == null) {
+ throw new Error("Cannot find model at path '" + path + "'");
+ }
+ info = JSON.parse(this.LS.getItem(keys.info));
+ this.LS.removeItem(keys.info);
+ this.LS.removeItem(keys.topology);
+ this.LS.removeItem(keys.weightSpecs);
+ this.LS.removeItem(keys.weightData);
+ return [2, info];
+ });
+ });
+ };
+ return BrowserLocalStorageManager;
+}());
+exports.BrowserLocalStorageManager = BrowserLocalStorageManager;
+if (environment_1.ENV.get('IS_BROWSER')) {
+ try {
+ model_management_1.ModelStoreManagerRegistry.registerManager(BrowserLocalStorage.URL_SCHEME, new BrowserLocalStorageManager());
+ }
+ catch (err) {
+ }
+}
+//# sourceMappingURL=local_storage.js.map
\ No newline at end of file
diff --git a/node_modules/@tensorflow/tfjs-core/dist/io/local_storage.js.map b/node_modules/@tensorflow/tfjs-core/dist/io/local_storage.js.map
new file mode 100644
index 0000000..c2a72c8
--- /dev/null
+++ b/node_modules/@tensorflow/tfjs-core/dist/io/local_storage.js.map
@@ -0,0 +1 @@
+{"version":3,"file":"local_storage.js","sourceRoot":"","sources":["../../src/io/local_storage.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAiBA,8CAAmC;AACnC,gCAA+B;AAC/B,uCAA8G;AAC9G,uDAA6D;AAC7D,qDAA6D;AAG7D,IAAM,cAAc,GAAG,GAAG,CAAC;AAC3B,IAAM,WAAW,GAAG,qBAAqB,CAAC;AAC1C,IAAM,WAAW,GAAG,MAAM,CAAC;AAC3B,IAAM,qBAAqB,GAAG,gBAAgB,CAAC;AAC/C,IAAM,mBAAmB,GAAG,cAAc,CAAC;AAC3C,IAAM,kBAAkB,GAAG,aAAa,CAAC;AAOzC;IACE,IAAI,CAAC,iBAAG,CAAC,GAAG,CAAC,YAAY,CAAC,IAAI,OAAO,MAAM,CAAC,YAAY,KAAK,WAAW,EAAE;QACxE,MAAM,IAAI,KAAK,CACX,oEAAoE;YACpE,yCAAyC,CAAC,CAAC;KAChD;IACD,IAAM,EAAE,GAAG,MAAM,CAAC,YAAY,CAAC;IAC/B,IAAM,gBAAgB,GAAa,EAAE,CAAC;IACtC,KAAK,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,EAAE,CAAC,MAAM,EAAE,EAAE,CAAC,EAAE;QAClC,IAAM,GAAG,GAAG,EAAE,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC;QACtB,IAAM,MAAM,GAAG,WAAW,GAAG,cAAc,CAAC;QAC5C,IAAI,GAAG,CAAC,UAAU,CAAC,MAAM,CAAC,IAAI,GAAG,CAAC,MAAM,GAAG,MAAM,CAAC,MAAM,EAAE;YACxD,EAAE,CAAC,UAAU,CAAC,GAAG,CAAC,CAAC;YACnB,IAAM,SAAS,GAAG,mBAAmB,CAAC,GAAG,CAAC,CAAC;YAC3C,IAAI,gBAAgB,CAA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AI,MAAG,CAAC,CAAC;iBACxD;gBACK,IAAI,GAAG,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC,EAAE,CAAC,OAAO,CAAC,IAAI,CAAC,IAAI,CAAC,CAAuB,CAAC;gBAE1E,IAAI,CAAC,EAAE,CAAC,UAAU,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;gBAC9B,IAAI,CAAC,EAAE,CAAC,UAAU,CAAC,IAAI,CAAC,QAAQ,CAAC,CAAC;gBAClC,IAAI,CAAC,EAAE,CAAC,UAAU,CAAC,IAAI,CAAC,WAAW,CAAC,CAAC;gBACrC,IAAI,CAAC,EAAE,CAAC,UAAU,CAAC,IAAI,CAAC,UAAU,CAAC,CAAC;gBACpC,WAAO,IAAI,EAAC;;;KACb;IACH,iCAAC;AAAD,CAAC,AAvCD,IAuCC;AAvCY,gEAA0B;AAyCvC,IAAI,iBAAG,CAAC,GAAG,CAAC,YAAY,CAAC,EAAE;IAGzB,IAAI;QACF,4CAAyB,CAAC,eAAe,CACrC,mBAAmB,CAAC,UAAU,EAAE,IAAI,0BAA0B,EAAE,CAAC,CAAC;KACvE;IAAC,OAAO,GAAG,EAAE;KACb;CACF"}
\ No newline at end of file
diff --git a/node_modules/@tensorflow/tfjs-core/dist/io/local_storage_test.d.ts b/node_modules/@tensorflow/tfjs-core/dist/io/local_storage_test.d.ts
new file mode 100644
index 0000000..cb0ff5c
--- /dev/null
+++ b/node_modules/@tensorflow/tfjs-core/dist/io/local_storage_test.d.ts
@@ -0,0 +1 @@
+export {};
diff --git a/node_modules/@tensorflow/tfjs-core/dist/io/local_storage_test.js b/node_modules/@tensorflow/tfjs-core/dist/io/local_storage_test.js
new file mode 100644
index 0000000..c80e638
--- /dev/null
+++ b/node_modules/@tensorflow/tfjs-core/dist/io/local_storage_test.js
@@ -0,0 +1,379 @@
+"use strict";
+var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
+ return new (P || (P = Promise))(function (resolve, reject) {
+ function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
+ function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
+ function step(result) { result.done ? resolve(result.value) : new P(function (resolve) { resolve(result.value); }).then(fulfilled, rejected); }
+ step((generator = generator.apply(thisArg, _arguments || [])).next());
+ });
+};
+var __generator = (this && this.__generator) || function (thisArg, body) {
+ var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;
+ return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
+ function verb(n) { return function (v) { return step([n, v]); }; }
+ function step(op) {
+ if (f) throw new TypeError("Generator is already executing.");
+ while (_) try {
+ if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;
+ if (y = 0, t) op = [op[0] & 2, t.value];
+ switch (op[0]) {
+ case 0: case 1: t = op; break;
+ case 4: _.label++; return { value: op[1], done: false };
+ case 5: _.label++; y = op[1]; op = [0]; continue;
+ case 7: op = _.ops.pop(); _.trys.pop(); continue;
+ default:
+ if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }
+ if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }
+ if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }
+ if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }
+ if (t[2]) _.ops.pop();
+ _.trys.pop(); continue;
+ }
+ op = body.call(thisArg, _);
+ } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }
+ if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };
+ }
+};
+var _this = this;
+Object.defineProperty(exports, "__esModule", { value: true });
+var tf = require("../index");
+var jasmine_util_1 = require("../jasmine_util");
+var test_util_1 = require("../test_util");
+var io_utils_1 = require("./io_utils");
+var local_storage_1 = require("./local_storage");
+jasmine_util_1.describeWithFlags('LocalStorage', test_util_1.BROWSER_ENVS, function () {
+ var modelTopology1 = {
+ 'class_name': 'Sequential',
+ 'keras_version': '2.1.4',
+ 'config': [{
+ 'class_name': 'Dense',
+ 'config': {
+ 'kernel_initializer': {
+ 'class_name': 'VarianceScaling',
+ 'config': {
+ 'distribution': 'uniform',
+ 'scale': 1.0,
+ 'seed': null,
+ 'mode': 'fan_avg'
+ }
+ },
+ 'name': 'dense',
+ 'kernel_constraint': null,
+ 'bias_regularizer': null,
+ 'bias_constraint': null,
+ 'dtype': 'float32',
+ 'activation': 'linear',
+ 'trainable': true,
+ 'kernel_regularizer': null,
+ 'bias_initializer': { 'class_name': 'Zeros', 'config': {} },
+ 'units': 1,
+ 'batch_input_shape': [null, 3],
+ 'use_bias': true,
+ 'activity_regularizer': null
+ }
+ }],
+ 'backend': 'tensorflow'
+ };
+ var weightSpecs1 = [
+ {
+ name: 'dense/kernel',
+ shape: [3, 1],
+ dtype: 'float32',
+ },
+ {
+ name: 'dense/bias',
+ shape: [1],
+ dtype: 'float32',
+ }
+ ];
+ var weightData1 = new ArrayBuffer(16);
+ var artifacts1 = {
+ modelTopology: modelTopology1,
+ weightSpecs: weightSpecs1,
+ weightData: weightData1,
+ };
+ function findOverflowingByteSize() {
+ var LS = window.localStorage;
+ var probeKey = "tfjs_test_probe_values_" + new Date().getTime() + "_" + Math.random();
+ var minKilobytes = 200;
+ var stepKilobytes = 200;
+ var maxKilobytes = 40000;
+ for (var kilobytes = minKilobytes; kilobytes < maxKilobytes; kilobytes += stepKilobytes) {
+ var bytes = kilobytes * 1024;
+ var data = new ArrayBuffer(bytes);
+ try {
+ var encoded = io_utils_1.arrayBufferToBase64String(data);
+ LS.setItem(probeKey, encoded);
+ }
+ catch (err) {
+ return bytes;
+ }
+ LS.removeItem(probeKey);
+ }
+ throw new Error("Unable to determined overflowing byte size up to " + maxKilobytes + " kB.");
+ }
+ beforeEach(function () {
+ local_storage_1.purgeLocalStorageArtifacts();
+ });
+ afterEach(function () {
+ local_storage_1.purgeLocalStorageArtifacts();
+ });
+ it('Save artifacts succeeds', function (done) {
+ var testStartDate = new Date();
+ var handler = tf.io.getSaveHandlers('localstorage://foo/FooModel')[0];
+ handler.save(artifacts1)
+ .then(function (saveResult) {
+ expect(saveResult.modelArtifactsInfo.dateSaved.getTime())
+ .toBeGreaterThanOrEqual(testStartDate.getTime());
+ expect(saveResult.modelArtifactsInfo.modelTopologyBytes)
+ .toEqual(JSON.stringify(modelTopology1).length);
+ expect(saveResult.modelArtifactsInfo.weightSpecsBytes)
+ .toEqual(JSON.stringify(weightSpecs1).length);
+ expect(saveResult.modelArtifactsInfo.weightDataBytes).toEqual(16);
+ var LS = window.localStorage;
+ var info = JSON.parse(LS.getItem('tensorflowjs_models/foo/FooModel/info'));
+ expect(Date.parse(info.dateSaved))
+ .toEqual(saveResult.modelArtifactsInfo.dateSaved.getTime());
+ expect(info.modelTopologyBytes)
+ .toEqual(saveResult.modelArtifactsInfo.modelTopologyBytes);
+ expect(info.weightSpecsBytes)
+ .toEqual(saveResult.modelArtifactsInfo.weightSpecsBytes);
+ expect(info.weightDataBytes)
+ .toEqual(saveResult.modelArtifactsInfo.weightDataBytes);
+ var topologyString = LS.getItem('tensorflowjs_models/foo/FooModel/model_topology');
+ expect(JSON.stringify(modelTopology1)).toEqual(topologyString);
+ var weightSpecsString = LS.getItem('tensorflowjs_models/foo/FooModel/weight_specs');
+ expect(JSON.stringify(weightSpecs1)).toEqual(weightSpecsString);
+ var weightDataBase64String = LS.getItem('tensorflowjs_models/foo/FooModel/weight_data');
+ expect(io_utils_1.base64StringToArrayBuffer(weightDataBase64String))
+ .toEqual(weightData1);
+ done();
+ })
+ .catch(function (err) {
+ console.error(err.stack);
+ });
+ });
+ it('Save-load round trip succeeds', function () { return __awaiter(_this, void 0, void 0, function () {
+ var handler1, handler2, loaded;
+ return __generator(this, function (_a) {
+ switch (_a.label) {
+ case 0:
+ handler1 = tf.io.getSaveHandlers('localstorage://FooModel')[0];
+ return [4, handler1.save(artifacts1)];
+ case 1:
+ _a.sent();
+ handler2 = tf.io.getLoadHandlers('localstorage://FooModel')[0];
+ return [4, handler2.load()];
+ case 2:
+ loaded = _a.sent();
+ expect(loaded.modelTopology).toEqual(modelTopology1);
+ expect(loaded.weightSpecs).toEqual(weightSpecs1);
+ expect(loaded.weightData).toEqual(weightData1);
+ return [2];
+ }
+ });
+ }); });
+ it('Loading nonexistent model fails.', function (done) {
+ var handler = tf.io.getSaveHandlers('localstorage://NonexistentModel')[0];
+ handler.load()
+ .then(function (aritfacts) {
+ fail('Loading nonexistent model succeeded unexpectedly.');
+ })
+ .catch(function (err) {
+ expect(err.message)
+ .toEqual('In local storage, there is no model with name ' +
+ '\'NonexistentModel\'');
+ done();
+ });
+ });
+ it('Loading model with missing topology fails.', function (done) {
+ var handler1 = tf.io.getSaveHandlers('localstorage://FooModel')[0];
+ handler1.save(artifacts1)
+ .then(function (saveResult) {
+ window.localStorage.removeItem('tensorflowjs_models/FooModel/model_topology');
+ var handler2 = tf.io.getLoadHandlers('localstorage://FooModel')[0];
+ handler2.load()
+ .then(function (aritfacts) {
+ fail('Loading of model with missing topology succeeded ' +
+ 'unexpectedly.');
+ })
+ .catch(function (err) {
+ expect(err.message)
+ .toEqual('In local storage, the topology of model ' +
+ '\'FooModel\' is missing.');
+ done();
+ });
+ })
+ .catch(function (err) {
+ console.error(err.stack);
+ });
+ });
+ it('Loading model with missing weight specs fails.', function (done) {
+ var handler1 = tf.io.getSaveHandlers('localstorage://FooModel')[0];
+ handler1.save(artifacts1)
+ .then(function (saveResult) {
+ window.localStorage.removeItem('tensorflowjs_models/FooModel/weight_specs');
+ var handler2 = tf.io.getLoadHandlers('localstorage://FooModel')[0];
+ handler2.load()
+ .then(function (aritfacts) {
+ fail('Loading of model with missing weight specs succeeded ' +
+ 'unexpectedly.');
+ })
+ .catch(function (err) {
+ expect(err.message)
+ .toEqual('In local storage, the weight specs of model ' +
+ '\'FooModel\' are missing.');
+ done();
+ });
+ })
+ .catch(function (err) {
+ console.error(err.stack);
+ });
+ });
+ it('Loading model with missing weight data fails.', function (done) {
+ var handler1 = tf.io.getSaveHandlers('localstorage://FooModel')[0];
+ handler1.save(artifacts1)
+ .then(function (saveResult) {
+ window.localStorage.removeItem('tensorflowjs_models/FooModel/weight_data');
+ var handler2 = tf.io.getLoadHandlers('localstorage://FooModel')[0];
+ handler2.load()
+ .then(function (aritfacts) {
+ fail('Loading of model with missing weight data succeeded ' +
+ 'unexpectedly.');
+ })
+ .catch(function (err) {
+ expect(err.message)
+ .toEqual('In local storage, the binary weight values of model ' +
+ '\'FooModel\' are missing.');
+ done();
+ });
+ })
+ .catch(function (err) {
+ console.error(err.stack);
+ });
+ });
+ it('Data size too large leads to error thrown', function (done) {
+ var overflowByteSize = findOverflowingByteSize();
+ var overflowArtifacts = {
+ modelTopology: modelTopology1,
+ weightSpecs: weightSpecs1,
+ weightData: new ArrayBuffer(overflowByteSize),
+ };
+ var handler1 = tf.io.getSaveHandlers('localstorage://FooModel')[0];
+ handler1.save(overflowArtifacts)
+ .then(function (saveResult) {
+ fail('Saving of model of overflowing-size weight data succeeded ' +
+ 'unexpectedly.');
+ })
+ .catch(function (err) {
+ expect(err.message
+ .indexOf('Failed to save model \'FooModel\' to local storage'))
+ .toEqual(0);
+ done();
+ });
+ });
+ it('Null, undefined or empty modelPath throws Error', function () {
+ expect(function () { return local_storage_1.browserLocalStorage(null); })
+ .toThrowError(/local storage, modelPath must not be null, undefined or empty/);
+ expect(function () { return local_storage_1.browserLocalStorage(undefined); })
+ .toThrowError(/local storage, modelPath must not be null, undefined or empty/);
+ expect(function () { return local_storage_1.browserLocalStorage(''); })
+ .toThrowError(/local storage, modelPath must not be null, undefined or empty./);
+ });
+ it('router', function () {
+ expect(local_storage_1.localStorageRouter('localstorage://bar') instanceof local_storage_1.BrowserLocalStorage)
+ .toEqual(true);
+ expect(local_storage_1.localStorageRouter('indexeddb://bar')).toBeNull();
+ expect(local_storage_1.localStorageRouter('qux')).toBeNull();
+ });
+ it('Manager: List models: 0 result', function (done) {
+ new local_storage_1.BrowserLocalStorageManager()
+ .listModels()
+ .then(function (out) {
+ expect(out).toEqual({});
+ done();
+ })
+ .catch(function (err) { return done.fail(err.stack); });
+ });
+ it('Manager: List models: 1 result', function (done) {
+ var handler = tf.io.getSaveHandlers('localstorage://baz/QuxModel')[0];
+ handler.save(artifacts1)
+ .then(function (saveResult) {
+ new local_storage_1.BrowserLocalStorageManager()
+ .listModels()
+ .then(function (out) {
+ expect(Object.keys(out).length).toEqual(1);
+ expect(out['baz/QuxModel'].modelTopologyType)
+ .toEqual(saveResult.modelArtifactsInfo.modelTopologyType);
+ expect(out['baz/QuxModel'].modelTopologyBytes)
+ .toEqual(saveResult.modelArtifactsInfo.modelTopologyBytes);
+ expect(out['baz/QuxModel'].weightSpecsBytes)
+ .toEqual(saveResult.modelArtifactsInfo.weightSpecsBytes);
+ expect(out['baz/QuxModel'].weightDataBytes)
+ .toEqual(saveResult.modelArtifactsInfo.weightDataBytes);
+ done();
+ })
+ .catch(function (err) { return done.fail(err.stack); });
+ })
+ .catch(function (err) { return done.fail(err.stack); });
+ });
+ it('Manager: List models: 2 results', function (done) {
+ var handler1 = tf.io.getSaveHandlers('localstorage://QuxModel')[0];
+ handler1.save(artifacts1)
+ .then(function (saveResult1) {
+ var handler2 = tf.io.getSaveHandlers('localstorage://repeat/QuxModel')[0];
+ handler2.save(artifacts1)
+ .then(function (saveResult2) {
+ new local_storage_1.BrowserLocalStorageManager()
+ .listModels()
+ .then(function (out) {
+ expect(Object.keys(out).length).toEqual(2);
+ expect(out['QuxModel'].modelTopologyType)
+ .toEqual(saveResult1.modelArtifactsInfo.modelTopologyType);
+ expect(out['QuxModel'].modelTopologyBytes)
+ .toEqual(saveResult1.modelArtifactsInfo
+ .modelTopologyBytes);
+ expect(out['QuxModel'].weightSpecsBytes)
+ .toEqual(saveResult1.modelArtifactsInfo.weightSpecsBytes);
+ expect(out['QuxModel'].weightDataBytes)
+ .toEqual(saveResult1.modelArtifactsInfo.weightDataBytes);
+ expect(out['repeat/QuxModel'].modelTopologyType)
+ .toEqual(saveResult2.modelArtifactsInfo.modelTopologyType);
+ expect(out['repeat/QuxModel'].modelTopologyBytes)
+ .toEqual(saveResult2.modelArtifactsInfo
+ .modelTopologyBytes);
+ expect(out['repeat/QuxModel'].weightSpecsBytes)
+ .toEqual(saveResult2.modelArtifactsInfo.weightSpecsBytes);
+ expect(out['repeat/QuxModel'].weightDataBytes)
+ .toEqual(saveResult2.modelArtifactsInfo.weightDataBytes);
+ done();
+ })
+ .catch(function (err) { return done.fail(err.stack); });
+ })
+ .catch(function (err) { return done.fail(err.stack); });
+ })
+ .catch(function (err) { return done.fail(err.stack); });
+ });
+ it('Manager: Successful deleteModel', function (done) {
+ var handler1 = tf.io.getSaveHandlers('localstorage://QuxModel')[0];
+ handler1.save(artifacts1)
+ .then(function (saveResult1) {
+ var handler2 = tf.io.getSaveHandlers('localstorage://repeat/QuxModel')[0];
+ handler2.save(artifacts1)
+ .then(function (saveResult2) {
+ var manager = new local_storage_1.BrowserLocalStorageManager();
+ manager.removeModel('QuxModel')
+ .then(function (deletedInfo) {
+ manager.listModels().then(function (out) {
+ expect(Object.keys(out)).toEqual(['repeat/QuxModel']);
+ });
+ done();
+ })
+ .catch(function (err) { return done.fail(err.stack); });
+ })
+ .catch(function (err) { return done.fail(err.stack); });
+ })
+ .catch(function (err) { return done.fail(err.stack); });
+ });
+});
+//# sourceMappingURL=local_storage_test.js.map
\ No newline at end of file
diff --git a/node_modules/@tensorflow/tfjs-core/dist/io/local_storage_test.js.map b/node_modules/@tensorflow/tfjs-core/dist/io/local_storage_test.js.map
new file mode 100644
index 0000000..bf5218d
--- /dev/null
+++ b/node_modules/@tensorflow/tfjs-core/dist/io/local_storage_test.js.map
@@ -0,0 +1 @@
+{"version":3,"file":"local_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f,IAAM,OAAO,GAAG,IAAI,0CAA0B,EAAE,CAAC;gBAEjD,OAAO,CAAC,WAAW,CAAC,UAAU,CAAC;qBAC1B,IAAI,CAAC,UAAA,WAAW;oBACf,OAAO,CAAC,UAAU,EAAE,CAAC,IAAI,CAAC,UAAA,GAAG;wBAC3B,MAAM,CAAC,MAAM,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC,CAAC,OAAO,CAAC,CAAC,iBAAiB,CAAC,CAAC,CAAC;oBACxD,CAAC,CAAC,CAAC;oBACH,IAAI,EAAE,CAAC;gBACT,CAAC,CAAC;qBACD,KAAK,CAAC,UAAA,GAAG,IAAI,OAAA,IAAI,CAAC,IAAI,CAAC,GAAG,CAAC,KAAK,CAAC,EAApB,CAAoB,CAAC,CAAC;YAC1C,CAAC,CAAC;iBACD,KAAK,CAAC,UAAA,GAAG,IAAI,OAAA,IAAI,CAAC,IAAI,CAAC,GAAG,CAAC,KAAK,CAAC,EAApB,CAAoB,CAAC,CAAC;QAC1C,CAAC,CAAC;aACD,KAAK,CAAC,UAAA,GAAG,IAAI,OAAA,IAAI,CAAC,IAAI,CAAC,GAAG,CAAC,KAAK,CAAC,EAApB,CAAoB,CAAC,CAAC;IAC1C,CAAC,CAAC,CAAC;AACL,CAAC,CAAC,CAAC"}
\ No newline at end of file
diff --git a/node_modules/@tensorflow/tfjs-core/dist/io/model_management.d.ts b/node_modules/@tensorflow/tfjs-core/dist/io/model_management.d.ts
new file mode 100644
index 0000000..483b7e3
--- /dev/null
+++ b/node_modules/@tensorflow/tfjs-core/dist/io/model_management.d.ts
@@ -0,0 +1,17 @@
+import { ModelArtifactsInfo, ModelStoreManager } from './types';
+export declare class ModelStoreManagerRegistry {
+ private static instance;
+ private managers;
+ private constructor();
+ private static getInstance;
+ static registerManager(scheme: string, manager: ModelStoreManager): void;
+ static getManager(scheme: string): ModelStoreManager;
+ static getSchemes(): string[];
+}
+declare function listModels(): Promise<{
+ [url: string]: ModelArtifactsInfo;
+}>;
+declare function removeModel(url: string): Promise;
+declare function copyModel(sourceURL: string, destURL: string): Promise;
+declare function moveModel(sourceURL: string, destURL: string): Promise;
+export { moveModel, copyModel, removeModel, listModels };
diff --git a/node_modules/@tensorflow/tfjs-core/dist/io/model_management.js b/node_modules/@tensorflow/tfjs-core/dist/io/model_management.js
new file mode 100644
index 0000000..e1c7fa4
--- /dev/null
+++ b/node_modules/@tensorflow/tfjs-core/dist/io/model_management.js
@@ -0,0 +1,203 @@
+"use strict";
+var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
+ return new (P || (P = Promise))(function (resolve, reject) {
+ function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
+ function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
+ function step(result) { result.done ? resolve(result.value) : new P(function (resolve) { resolve(result.value); }).then(fulfilled, rejected); }
+ step((generator = generator.apply(thisArg, _arguments || [])).next());
+ });
+};
+var __generator = (this && this.__generator) || function (thisArg, body) {
+ var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;
+ return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
+ function verb(n) { return function (v) { return step([n, v]); }; }
+ function step(op) {
+ if (f) throw new TypeError("Generator is already executing.");
+ while (_) try {
+ if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;
+ if (y = 0, t) op = [op[0] & 2, t.value];
+ switch (op[0]) {
+ case 0: case 1: t = op; break;
+ case 4: _.label++; return { value: op[1], done: false };
+ case 5: _.label++; y = op[1]; op = [0]; continue;
+ case 7: op = _.ops.pop(); _.trys.pop(); continue;
+ default:
+ if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }
+ if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }
+ if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }
+ if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }
+ if (t[2]) _.ops.pop();
+ _.trys.pop(); continue;
+ }
+ op = body.call(thisArg, _);
+ } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }
+ if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };
+ }
+};
+Object.defineProperty(exports, "__esModule", { value: true });
+var util_1 = require("../util");
+var router_registry_1 = require("./router_registry");
+var URL_SCHEME_SUFFIX = '://';
+var ModelStoreManagerRegistry = (function () {
+ function ModelStoreManagerRegistry() {
+ this.managers = {};
+ }
+ ModelStoreManagerRegistry.getInstance = function () {
+ if (ModelStoreManagerRegistry.instance == null) {
+ ModelStoreManagerRegistry.instance = new ModelStoreManagerRegistry();
+ }
+ return ModelStoreManagerRegistry.instance;
+ };
+ ModelStoreManagerRegistry.registerManager = function (scheme, manager) {
+ util_1.assert(scheme != null, 'scheme must not be undefined or null.');
+ if (scheme.endsWith(URL_SCHEME_SUFFIX)) {
+ scheme = scheme.slice(0, scheme.indexOf(URL_SCHEME_SUFFIX));
+ }
+ util_1.assert(scheme.length > 0, 'scheme must not be an empty string.');
+ var registry = ModelStoreManagerRegistry.getInstance();
+ util_1.assert(registry.managers[scheme] == null, "A model store manager is already registered for scheme '" + scheme + "'.");
+ registry.managers[scheme] = manager;
+ };
+ ModelStoreManagerRegistry.getManager = function (scheme) {
+ var manager = this.getInstance().managers[scheme];
+ if (manager == null) {
+ throw new Error("Cannot find model manager for scheme '" + scheme + "'");
+ }
+ return manager;
+ };
+ ModelStoreManagerRegistry.getSchemes = function () {
+ return Object.keys(this.getInstance().managers);
+ };
+ return ModelStoreManagerRegistry;
+}());
+exports.ModelStoreManagerRegistry = ModelStoreManagerRegistry;
+function parseURL(url) {
+ if (url.indexOf(URL_SCHEME_SUFFIX) === -1) {
+ throw new Error("The url string provided does not contain a scheme. " +
+ "Supported schemes are: " +
+ ("" + ModelStoreManagerRegistry.getSchemes().join(',')));
+ }
+ return {
+ scheme: url.split(URL_SCHEME_SUFFIX)[0],
+ path: url.split(URL_SCHEME_SUFFIX)[1],
+ };
+}
+function cloneModelInternal(sourceURL, destURL, deleteSource) {
+ if (deleteSource === void 0) { deleteSource = false; }
+ return __awaiter(this, void 0, void 0, function () {
+ var loadHandlers, loadHandler, saveHandlers, saveHandler, sourceScheme, sourcePath, sameMedium, modelArtifacts, saveResult;
+ return __generator(this, function (_a) {
+ switch (_a.label) {
+ case 0:
+ util_1.assert(sourceURL !== destURL, "Old path and new path are the same: '" + sourceURL + "'");
+ loadHandlers = router_registry_1.IORouterRegistry.getLoadHandlers(sourceURL);
+ util_1.assert(loadHandlers.length > 0, "Copying failed because no load handler is found for source URL " + sourceURL + ".");
+ util_1.assert(loadHandlers.length < 2, "Copying failed because more than one (" + loadHandlers.length + ") " +
+ ("load handlers for source URL " + sourceURL + "."));
+ loadHandler = loadHandlers[0];
+ saveHandlers = router_registry_1.IORouterRegistry.getSaveHandlers(destURL);
+ util_1.assert(saveHandlers.length > 0, "Copying failed because no save handler is found for destination URL " +
+ (destURL + "."));
+ util_1.assert(saveHandlers.length < 2, "Copying failed because more than one (" + loadHandlers.length + ") " +
+ ("save handlers for destination URL " + destURL + "."));
+ saveHandler = saveHandlers[0];
+ sourceScheme = parseURL(sourceURL).scheme;
+ sourcePath = parseURL(sourceURL).path;
+ sameMedium = sourceScheme === parseURL(sourceURL).scheme;
+ return [4, loadHandler.load()];
+ case 1:
+ modelArtifacts = _a.sent();
+ if (!(deleteSource && sameMedium)) return [3, 3];
+ return [4, ModelStoreManagerRegistry.getManager(sourceScheme)
+ .removeModel(sourcePath)];
+ case 2:
+ _a.sent();
+ _a.label = 3;
+ case 3: return [4, saveHandler.save(modelArtifacts)];
+ case 4:
+ saveResult = _a.sent();
+ if (!(deleteSource && !sameMedium)) return [3, 6];
+ return [4, ModelStoreManagerRegistry.getManager(sourceScheme)
+ .removeModel(sourcePath)];
+ case 5:
+ _a.sent();
+ _a.label = 6;
+ case 6: return [2, saveResult.modelArtifactsInfo];
+ }
+ });
+ });
+}
+function listModels() {
+ return __awaiter(this, void 0, void 0, function () {
+ var schemes, out, _i, schemes_1, scheme, schemeOut, path, url;
+ return __generator(this, function (_a) {
+ switch (_a.label) {
+ case 0:
+ schemes = ModelStoreManagerRegistry.getSchemes();
+ out = {};
+ _i = 0, schemes_1 = schemes;
+ _a.label = 1;
+ case 1:
+ if (!(_i < schemes_1.length)) return [3, 4];
+ scheme = schemes_1[_i];
+ return [4, ModelStoreManagerRegistry.getManager(scheme).listModels()];
+ case 2:
+ schemeOut = _a.sent();
+ for (path in schemeOut) {
+ url = scheme + URL_SCHEME_SUFFIX + path;
+ out[url] = schemeOut[path];
+ }
+ _a.label = 3;
+ case 3:
+ _i++;
+ return [3, 1];
+ case 4: return [2, out];
+ }
+ });
+ });
+}
+exports.listModels = listModels;
+function removeModel(url) {
+ return __awaiter(this, void 0, void 0, function () {
+ var schemeAndPath, manager;
+ return __generator(this, function (_a) {
+ switch (_a.label) {
+ case 0:
+ schemeAndPath = parseURL(url);
+ manager = ModelStoreManagerRegistry.getManager(schemeAndPath.scheme);
+ return [4, manager.removeModel(schemeAndPath.path)];
+ case 1: return [2, _a.sent()];
+ }
+ });
+ });
+}
+exports.removeModel = removeModel;
+function copyModel(sourceURL, destURL) {
+ return __awaiter(this, void 0, void 0, function () {
+ var deleteSource;
+ return __generator(this, function (_a) {
+ switch (_a.label) {
+ case 0:
+ deleteSource = false;
+ return [4, cloneModelInternal(sourceURL, destURL, deleteSource)];
+ case 1: return [2, _a.sent()];
+ }
+ });
+ });
+}
+exports.copyModel = copyModel;
+function moveModel(sourceURL, destURL) {
+ return __awaiter(this, void 0, void 0, function () {
+ var deleteSource;
+ return __generator(this, function (_a) {
+ switch (_a.label) {
+ case 0:
+ deleteSource = true;
+ return [4, cloneModelInternal(sourceURL, destURL, deleteSource)];
+ case 1: return [2, _a.sent()];
+ }
+ });
+ });
+}
+exports.moveModel = moveModel;
+//# sourceMappingURL=model_management.js.map
\ No newline at end of file
diff --git a/node_modules/@tensorflow/tfjs-core/dist/io/model_management.js.map b/node_modules/@tensorflow/tfjs-core/dist/io/model_management.js.map
new file mode 100644
index 0000000..a45712f
--- /dev/null
+++ b/node_modules/@tensorflow/tfjs-core/dist/io/model_management.js.map
@@ -0,0 +1 @@
+{"version":3,"file":"model_management.js","sourceRoot":"","sources":["../../src/io/model_management.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AA4BA,gCAA+B;AAE/B,qDAAmD;AAGnD,IAAM,iBAAiB,GAAG,KAAK,CAAC;AAEhC;IAME;QACE,IAAI,CAAC,QAAQ,GAAG,EAAE,CAAC;IACrB,CAAC;IAEc,qCAAW,GAA1B;QACE,IAAI,yBAAyB,CAAC,QAAQ,IAAI,IAAI,EAAE;YAC9C,yBAAyB,CAAC,QAAQ,GAAG,IAAI,yBAAyB,EAAE,CAAC;SACtE;QACD,OAAO,yBAAyB,CAAC,QAAQ,CAAC;IAC5C,CAAC;IAQM,yCAAe,GAAtB,UAAuB,MAAc,EAAE,OAA0B;QAC/D,aAAM,CAAC,MAAM,IAAI,IAAI,EAAE,uCAAuC,CAAC,CAAC;QAChE,IAAI,MAAM,CAAC,QAAQ,CAAC,iBAAiB,CAAC,EAAE;YACtC,MAAM,GAAG,MAAM,CAAC,KAAK,CAAC,CAAC,EAAE,MAAM,CAAC,OAAO,CAAC,iBAAiB,CAAC,CAAC,CAAC;SAC7D;QACD,aAAM,CAAC,MAAM,CAAC,MAAM,GAAG,CAAC,EAAE,qCAAqC,CAAC,CAAC;QACjE,IAAM,QAAQ,GAAG,yBAAyB,CAAC,WAAW,EAAE,CAAC;QACzD,aAAM,CACF,QAAQ,CAAC,QAAQ,CAAC,MAAM,CAAC,IAAI,IAAI,EACjC,6DAA2D,MAAM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E;AAEO,8BAAS"}
\ No newline at end of file
diff --git a/node_modules/@tensorflow/tfjs-core/dist/io/model_management_test.d.ts b/node_modules/@tensorflow/tfjs-core/dist/io/model_management_test.d.ts
new file mode 100644
index 0000000..cb0ff5c
--- /dev/null
+++ b/node_modules/@tensorflow/tfjs-core/dist/io/model_management_test.d.ts
@@ -0,0 +1 @@
+export {};
diff --git a/node_modules/@tensorflow/tfjs-core/dist/io/model_management_test.js b/node_modules/@tensorflow/tfjs-core/dist/io/model_management_test.js
new file mode 100644
index 0000000..5753160
--- /dev/null
+++ b/node_modules/@tensorflow/tfjs-core/dist/io/model_management_test.js
@@ -0,0 +1,376 @@
+"use strict";
+Object.defineProperty(exports, "__esModule", { value: true });
+var tf = require("../index");
+var jasmine_util_1 = require("../jasmine_util");
+var test_util_1 = require("../test_util");
+var indexed_db_1 = require("./indexed_db");
+var local_storage_1 = require("./local_storage");
+jasmine_util_1.describeWithFlags('ModelManagement', test_util_1.CHROME_ENVS, function () {
+ var modelTopology1 = {
+ 'class_name': 'Sequential',
+ 'keras_version': '2.1.4',
+ 'config': [{
+ 'class_name': 'Dense',
+ 'config': {
+ 'kernel_initializer': {
+ 'class_name': 'VarianceScaling',
+ 'config': {
+ 'distribution': 'uniform',
+ 'scale': 1.0,
+ 'seed': null,
+ 'mode': 'fan_avg'
+ }
+ },
+ 'name': 'dense',
+ 'kernel_constraint': null,
+ 'bias_regularizer': null,
+ 'bias_constraint': null,
+ 'dtype': 'float32',
+ 'activation': 'linear',
+ 'trainable': true,
+ 'kernel_regularizer': null,
+ 'bias_initializer': { 'class_name': 'Zeros', 'config': {} },
+ 'units': 1,
+ 'batch_input_shape': [null, 3],
+ 'use_bias': true,
+ 'activity_regularizer': null
+ }
+ }],
+ 'backend': 'tensorflow'
+ };
+ var weightSpecs1 = [
+ {
+ name: 'dense/kernel',
+ shape: [3, 1],
+ dtype: 'float32',
+ },
+ {
+ name: 'dense/bias',
+ shape: [1],
+ dtype: 'float32',
+ }
+ ];
+ var weightData1 = new ArrayBuffer(16);
+ var artifacts1 = {
+ modelTopology: modelTopology1,
+ weightSpecs: weightSpecs1,
+ weightData: weightData1,
+ };
+ beforeEach(function (done) {
+ local_storage_1.purgeLocalStorageArtifacts();
+ indexed_db_1.deleteDatabase().then(function () {
+ done();
+ });
+ });
+ afterEach(function (done) {
+ local_storage_1.purgeLocalStorageArtifacts();
+ indexed_db_1.deleteDatabase().then(function () {
+ done();
+ });
+ });
+ it('List models: 0 result', function (done) {
+ tf.io.listModels()
+ .then(function (out) {
+ expect(out).toEqual({});
+ done();
+ })
+ .catch(function (err) { return done.fail(err.stack); });
+ });
+ it('List models: 1 result', function (done) {
+ var url = 'localstorage://baz/QuxModel';
+ var handler = tf.io.getSaveHandlers(url)[0];
+ handler.save(artifacts1)
+ .then(function (saveResult) {
+ tf.io.listModels()
+ .then(function (out) {
+ expect(Object.keys(out).length).toEqual(1);
+ expect(out[url].modelTopologyType)
+ .toEqual(saveResult.modelArtifactsInfo.modelTopologyType);
+ expect(out[url].modelTopologyBytes)
+ .toEqual(saveResult.modelArtifactsInfo.modelTopologyBytes);
+ expect(out[url].weightSpecsBytes)
+ .toEqual(saveResult.modelArtifactsInfo.weightSpecsBytes);
+ expect(out[url].weightDataBytes)
+ .toEqual(saveResult.modelArtifactsInfo.weightDataBytes);
+ done();
+ })
+ .catch(function (err) { return done.fail(err.stack); });
+ })
+ .catch(function (err) { return done.fail(err.stack); });
+ });
+ it('Manager: List models: 2 results in 2 mediums', function (done) {
+ var url1 = 'localstorage://QuxModel';
+ var url2 = 'indexeddb://QuxModel';
+ var handler1 = tf.io.getSaveHandlers(url1)[0];
+ handler1.save(artifacts1)
+ .then(function (saveResult1) {
+ var handler2 = tf.io.getSaveHandlers(url2)[0];
+ handler2.save(artifacts1)
+ .then(function (saveResult2) {
+ tf.io.listModels()
+ .then(function (out) {
+ expect(Object.keys(out).length).toEqual(2);
+ expect(out[url1].modelTopologyType)
+ .toEqual(saveResult1.modelArtifactsInfo.modelTopologyType);
+ expect(out[url1].modelTopologyBytes)
+ .toEqual(saveResult1.modelArtifactsInfo
+ .modelTopologyBytes);
+ expect(out[url1].weightSpecsBytes)
+ .toEqual(saveResult1.modelArtifactsInfo.weightSpecsBytes);
+ expect(out[url1].weightDataBytes)
+ .toEqual(saveResult1.modelArtifactsInfo.weightDataBytes);
+ expect(out[url2].modelTopologyType)
+ .toEqual(saveResult2.modelArtifactsInfo.modelTopologyType);
+ expect(out[url2].modelTopologyBytes)
+ .toEqual(saveResult2.modelArtifactsInfo
+ .modelTopologyBytes);
+ expect(out[url2].weightSpecsBytes)
+ .toEqual(saveResult2.modelArtifactsInfo.weightSpecsBytes);
+ expect(out[url2].weightDataBytes)
+ .toEqual(saveResult2.modelArtifactsInfo.weightDataBytes);
+ done();
+ })
+ .catch(function (err) { return done.fail(err.stack); });
+ })
+ .catch(function (err) { return done.fail(err.stack); });
+ })
+ .catch(function (err) { return done.fail(err.stack); });
+ });
+ it('Successful removeModel', function (done) {
+ var handler1 = tf.io.getSaveHandlers('localstorage://QuxModel')[0];
+ handler1.save(artifacts1)
+ .then(function (saveResult1) {
+ var handler2 = tf.io.getSaveHandlers('indexeddb://repeat/QuxModel')[0];
+ handler2.save(artifacts1)
+ .then(function (saveResult2) {
+ tf.io.removeModel('indexeddb://repeat/QuxModel')
+ .then(function (deletedInfo) {
+ tf.io.listModels()
+ .then(function (out) {
+ expect(Object.keys(out)).toEqual([
+ 'localstorage://QuxModel'
+ ]);
+ tf.io.removeModel('localstorage://QuxModel')
+ .then(function (out) {
+ tf.io.listModels()
+ .then(function (out) {
+ expect(Object.keys(out)).toEqual([]);
+ done();
+ })
+ .catch(function (err) { return done.fail(err); });
+ })
+ .catch(function (err) { return done.fail(err); });
+ })
+ .catch(function (err) { return done.fail(err); });
+ })
+ .catch(function (err) { return done.fail(err.stack); });
+ })
+ .catch(function (err) { return done.fail(err.stack); });
+ })
+ .catch(function (err) { return done.fail(err.stack); });
+ });
+ it('Successful copyModel between mediums', function (done) {
+ var url1 = 'localstorage://a1/FooModel';
+ var url2 = 'indexeddb://a1/FooModel';
+ var handler1 = tf.io.getSaveHandlers(url1)[0];
+ handler1.save(artifacts1)
+ .then(function (saveResult) {
+ tf.io.copyModel(url1, url2)
+ .then(function (modelInfo) {
+ tf.io.listModels().then(function (out) {
+ expect(Object.keys(out).length).toEqual(2);
+ expect(out[url1].modelTopologyType)
+ .toEqual(saveResult.modelArtifactsInfo.modelTopologyType);
+ expect(out[url1].modelTopologyBytes)
+ .toEqual(saveResult.modelArtifactsInfo.modelTopologyBytes);
+ expect(out[url1].weightSpecsBytes)
+ .toEqual(saveResult.modelArtifactsInfo.weightSpecsBytes);
+ expect(out[url1].weightDataBytes)
+ .toEqual(saveResult.modelArtifactsInfo.weightDataBytes);
+ expect(out[url2].modelTopologyType)
+ .toEqual(saveResult.modelArtifactsInfo.modelTopologyType);
+ expect(out[url2].modelTopologyBytes)
+ .toEqual(saveResult.modelArtifactsInfo.modelTopologyBytes);
+ expect(out[url2].weightSpecsBytes)
+ .toEqual(saveResult.modelArtifactsInfo.weightSpecsBytes);
+ expect(out[url2].weightDataBytes)
+ .toEqual(saveResult.modelArtifactsInfo.weightDataBytes);
+ var handler2 = tf.io.getLoadHandlers(url2)[0];
+ handler2.load()
+ .then(function (loaded) {
+ expect(loaded.modelTopology).toEqual(modelTopology1);
+ expect(loaded.weightSpecs).toEqual(weightSpecs1);
+ expect(new Uint8Array(loaded.weightData))
+ .toEqual(new Uint8Array(weightData1));
+ done();
+ })
+ .catch(function (err) { return done.fail(err.stack); });
+ });
+ })
+ .catch(function (err) { return done.fail(err.stack); });
+ })
+ .catch(function (err) { return done.fail(err.stack); });
+ });
+ it('Successful moveModel between mediums', function (done) {
+ var url1 = 'localstorage://a1/FooModel';
+ var url2 = 'indexeddb://a1/FooModel';
+ var handler1 = tf.io.getSaveHandlers(url1)[0];
+ handler1.save(artifacts1)
+ .then(function (saveResult) {
+ tf.io.moveModel(url1, url2)
+ .then(function (modelInfo) {
+ tf.io.listModels().then(function (out) {
+ expect(Object.keys(out)).toEqual([url2]);
+ expect(out[url2].modelTopologyType)
+ .toEqual(saveResult.modelArtifactsInfo.modelTopologyType);
+ expect(out[url2].modelTopologyBytes)
+ .toEqual(saveResult.modelArtifactsInfo.modelTopologyBytes);
+ expect(out[url2].weightSpecsBytes)
+ .toEqual(saveResult.modelArtifactsInfo.weightSpecsBytes);
+ expect(out[url2].weightDataBytes)
+ .toEqual(saveResult.modelArtifactsInfo.weightDataBytes);
+ var handler2 = tf.io.getLoadHandlers(url2)[0];
+ handler2.load()
+ .then(function (loaded) {
+ expect(loaded.modelTopology).toEqual(modelTopology1);
+ expect(loaded.weightSpecs).toEqual(weightSpecs1);
+ expect(new Uint8Array(loaded.weightData))
+ .toEqual(new Uint8Array(weightData1));
+ done();
+ })
+ .catch(function (err) {
+ done.fail(err.stack);
+ });
+ });
+ })
+ .catch(function (err) { return done.fail(err.stack); });
+ })
+ .catch(function (err) { return done.fail(err.stack); });
+ });
+ it('Failed copyModel to invalid source URL', function (done) {
+ var url1 = 'invalidurl';
+ var url2 = 'localstorage://a1/FooModel';
+ tf.io.copyModel(url1, url2)
+ .then(function (out) {
+ done.fail('Copying from invalid URL succeeded unexpectedly.');
+ })
+ .catch(function (err) {
+ expect(err.message)
+ .toEqual('Copying failed because no load handler is found for ' +
+ 'source URL invalidurl.');
+ done();
+ });
+ });
+ it('Failed copyModel to invalid destination URL', function (done) {
+ var url1 = 'localstorage://a1/FooModel';
+ var url2 = 'invalidurl';
+ var handler1 = tf.io.getSaveHandlers(url1)[0];
+ handler1.save(artifacts1)
+ .then(function (saveResult) {
+ tf.io.copyModel(url1, url2)
+ .then(function (out) {
+ done.fail('Copying to invalid URL succeeded unexpectedly.');
+ })
+ .catch(function (err) {
+ expect(err.message)
+ .toEqual('Copying failed because no save handler is found for ' +
+ 'destination URL invalidurl.');
+ done();
+ });
+ })
+ .catch(function (err) { return done.fail(err.stack); });
+ });
+ it('Failed moveModel to invalid destination URL', function (done) {
+ var url1 = 'localstorage://a1/FooModel';
+ var url2 = 'invalidurl';
+ var handler1 = tf.io.getSaveHandlers(url1)[0];
+ handler1.save(artifacts1)
+ .then(function (saveResult) {
+ tf.io.moveModel(url1, url2)
+ .then(function (out) {
+ done.fail('Copying to invalid URL succeeded unexpectedly.');
+ })
+ .catch(function (err) {
+ expect(err.message)
+ .toEqual('Copying failed because no save handler is found for ' +
+ 'destination URL invalidurl.');
+ tf.io.listModels()
+ .then(function (out) {
+ expect(Object.keys(out)).toEqual([url1]);
+ done();
+ })
+ .catch(function (err) { return done.fail(err.stack); });
+ });
+ })
+ .catch(function (err) { return done.fail(err.stack); });
+ });
+ it('Failed deletedModel: Absent scheme', function (done) {
+ tf.io.removeModel('foo')
+ .then(function (out) {
+ done.fail('Removing model with missing scheme succeeded unexpectedly.');
+ })
+ .catch(function (err) {
+ expect(err.message)
+ .toMatch(/The url string provided does not contain a scheme/);
+ expect(err.message.indexOf('localstorage')).toBeGreaterThan(0);
+ expect(err.message.indexOf('indexeddb')).toBeGreaterThan(0);
+ done();
+ });
+ });
+ it('Failed deletedModel: Invalid scheme', function (done) {
+ tf.io.removeModel('invalidscheme://foo')
+ .then(function (out) {
+ done.fail('Removing nonexistent model succeeded unexpectedly.');
+ })
+ .catch(function (err) {
+ expect(err.message)
+ .toEqual('Cannot find model manager for scheme \'invalidscheme\'');
+ done();
+ });
+ });
+ it('Failed deletedModel: Nonexistent model', function (done) {
+ tf.io.removeModel('indexeddb://nonexistent')
+ .then(function (out) {
+ done.fail('Removing nonexistent model succeeded unexpectedly.');
+ })
+ .catch(function (err) {
+ expect(err.message)
+ .toEqual('Cannot find model with path \'nonexistent\' in IndexedDB.');
+ done();
+ });
+ });
+ it('Failed copyModel', function (done) {
+ tf.io.copyModel('indexeddb://nonexistent', 'indexeddb://destination')
+ .then(function (out) {
+ done.fail('Copying nonexistent model succeeded unexpectedly.');
+ })
+ .catch(function (err) {
+ expect(err.message)
+ .toEqual('Cannot find model with path \'nonexistent\' in IndexedDB.');
+ done();
+ });
+ });
+ it('copyModel: Identical oldPath and newPath leads to Error', function (done) {
+ tf.io.copyModel('a/1', 'a/1')
+ .then(function (out) {
+ done.fail('Copying with identical old & new paths succeeded unexpectedly.');
+ })
+ .catch(function (err) {
+ expect(err.message)
+ .toEqual('Old path and new path are the same: \'a/1\'');
+ done();
+ });
+ });
+ it('moveModel: Identical oldPath and newPath leads to Error', function (done) {
+ tf.io.moveModel('a/1', 'a/1')
+ .then(function (out) {
+ done.fail('Copying with identical old & new paths succeeded unexpectedly.');
+ })
+ .catch(function (err) {
+ expect(err.message)
+ .toEqual('Old path and new path are the same: \'a/1\'');
+ done();
+ });
+ });
+});
+//# sourceMappingURL=model_management_test.js.map
\ No newline at end of file
diff --git a/node_modules/@tensorflow/tfjs-core/dist/io/model_management_test.js.map b/node_modules/@tensorflow/tfjs-core/dist/io/model_management_test.js.map
new file mode 100644
index 0000000..0601d55
--- /dev/null
+++ b/node_modules/@tensorflow/tfjs-core/dist/io/model_management_test.js.map
@@ -0,0 +1 @@
+{"version":3,"file":"model_management_test.js","sourceRoot":"","sources":["../../src/io/model_management_test.ts"],"names":[],"mappings":";;AAiBA,6BAA+B;AAC/B,gDAAkD;AAClD,0CAAyC;AACzC,2CAA4C;AAC5C,iDAA2D;AAI3D,gCAAiB,CAAC,iBAAiB,EAAE,uBAAW,EAAE;IAEhD,IAAM,cAAc,GAAO;QACzB,YAAY,EAAE,YAAY;QAC1B,eAAe,EAAE,OAAO;QACxB,QAAQ,EAAE,CAAC;gBACT,YAAY,EAAE,OAAO;gBACrB,QAAQ,EAAE;oBACR,oBAAoB,EAAE;wBACpB,YAAY,EAAE,iBAAiB;wBAC/B,QAAQ,EAAE;4BACR,cAAc,EAAE,SAAS;4BACzB,OAAO,EAAE,GAAG;4BACZ,MAAM,EAAE,IAAI;4BACZ,MAAM,EAAE,SAAS;yBAClB;qBACF;oBACD,MAAM,EAAE,OAAO;oBACf,mBAAmB,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R,MAAM,CAAC,GAAG,CAAC,OAAO,CAAC;iBACd,OAAO,CAAC,6CAA6C,CAAC,CAAC;YAC5D,IAAI,EAAE,CAAC;QACT,CAAC,CAAC,CAAC;IACT,CAAC,CAAC,CAAC;AACL,CAAC,CAAC,CAAC"}
\ No newline at end of file
diff --git a/node_modules/@tensorflow/tfjs-core/dist/io/passthrough.d.ts b/node_modules/@tensorflow/tfjs-core/dist/io/passthrough.d.ts
new file mode 100644
index 0000000..157be24
--- /dev/null
+++ b/node_modules/@tensorflow/tfjs-core/dist/io/passthrough.d.ts
@@ -0,0 +1,3 @@
+import { IOHandler, ModelArtifacts, SaveResult, WeightsManifestEntry } from './types';
+export declare function fromMemory(modelTopology: {}, weightSpecs?: WeightsManifestEntry[], weightData?: ArrayBuffer): IOHandler;
+export declare function withSaveHandler(saveHandler: (artifacts: ModelArtifacts) => SaveResult): IOHandler;
diff --git a/node_modules/@tensorflow/tfjs-core/dist/io/passthrough.js b/node_modules/@tensorflow/tfjs-core/dist/io/passthrough.js
new file mode 100644
index 0000000..91b9757
--- /dev/null
+++ b/node_modules/@tensorflow/tfjs-core/dist/io/passthrough.js
@@ -0,0 +1,93 @@
+"use strict";
+var __assign = (this && this.__assign) || Object.assign || function(t) {
+ for (var s, i = 1, n = arguments.length; i < n; i++) {
+ s = arguments[i];
+ for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
+ t[p] = s[p];
+ }
+ return t;
+};
+var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
+ return new (P || (P = Promise))(function (resolve, reject) {
+ function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
+ function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
+ function step(result) { result.done ? resolve(result.value) : new P(function (resolve) { resolve(result.value); }).then(fulfilled, rejected); }
+ step((generator = generator.apply(thisArg, _arguments || [])).next());
+ });
+};
+var __generator = (this && this.__generator) || function (thisArg, body) {
+ var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;
+ return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
+ function verb(n) { return function (v) { return step([n, v]); }; }
+ function step(op) {
+ if (f) throw new TypeError("Generator is already executing.");
+ while (_) try {
+ if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;
+ if (y = 0, t) op = [op[0] & 2, t.value];
+ switch (op[0]) {
+ case 0: case 1: t = op; break;
+ case 4: _.label++; return { value: op[1], done: false };
+ case 5: _.label++; y = op[1]; op = [0]; continue;
+ case 7: op = _.ops.pop(); _.trys.pop(); continue;
+ default:
+ if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }
+ if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }
+ if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }
+ if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }
+ if (t[2]) _.ops.pop();
+ _.trys.pop(); continue;
+ }
+ op = body.call(thisArg, _);
+ } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }
+ if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };
+ }
+};
+Object.defineProperty(exports, "__esModule", { value: true });
+var PassthroughLoader = (function () {
+ function PassthroughLoader(modelTopology, weightSpecs, weightData) {
+ this.modelTopology = modelTopology;
+ this.weightSpecs = weightSpecs;
+ this.weightData = weightData;
+ }
+ PassthroughLoader.prototype.load = function () {
+ return __awaiter(this, void 0, void 0, function () {
+ var result;
+ return __generator(this, function (_a) {
+ result = {};
+ if (this.modelTopology != null) {
+ result = __assign({ modelTopology: this.modelTopology }, result);
+ }
+ if (this.weightSpecs != null && this.weightSpecs.length > 0) {
+ result = __assign({ weightSpecs: this.weightSpecs }, result);
+ }
+ if (this.weightData != null && this.weightData.byteLength > 0) {
+ result = __assign({ weightData: this.weightData }, result);
+ }
+ return [2, result];
+ });
+ });
+ };
+ return PassthroughLoader;
+}());
+var PassthroughSaver = (function () {
+ function PassthroughSaver(saveHandler) {
+ this.saveHandler = saveHandler;
+ }
+ PassthroughSaver.prototype.save = function (modelArtifacts) {
+ return __awaiter(this, void 0, void 0, function () {
+ return __generator(this, function (_a) {
+ return [2, this.saveHandler(modelArtifacts)];
+ });
+ });
+ };
+ return PassthroughSaver;
+}());
+function fromMemory(modelTopology, weightSpecs, weightData) {
+ return new PassthroughLoader(modelTopology, weightSpecs, weightData);
+}
+exports.fromMemory = fromMemory;
+function withSaveHandler(saveHandler) {
+ return new PassthroughSaver(saveHandler);
+}
+exports.withSaveHandler = withSaveHandler;
+//# sourceMappingURL=passthrough.js.map
\ No newline at end of file
diff --git a/node_modules/@tensorflow/tfjs-core/dist/io/passthrough.js.map b/node_modules/@tensorflow/tfjs-core/dist/io/passthrough.js.map
new file mode 100644
index 0000000..fffdafa
--- /dev/null
+++ b/node_modules/@tensorflow/tfjs-core/dist/io/passthrough.js.map
@@ -0,0 +1 @@
+{"version":3,"file":"passthrough.js","sourceRoot":"","sources":["../../src/io/passthrough.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAuBA;IACE,2BACqB,aAA8B,EAC9B,WAAoC,EACpC,UAAwB;QAFxB,kBAAa,GAAb,aAAa,CAAiB;QAC9B,gBAAW,GAAX,WAAW,CAAyB;QACpC,eAAU,GAAV,UAAU,CAAc;IAAG,CAAC;IAE3C,gCAAI,GAAV;;;;gBACM,MAAM,GAAG,EAAE,CAAC;gBAChB,IAAI,IAAI,CAAC,aAAa,IAAI,IAAI,EAAE;oBAC9B,MAAM,cAAI,aAAa,EAAE,IAAI,CAAC,aAAa,IAAK,MAAM,CAAC,CAAC;iBACzD;gBACD,IAAI,IAAI,CAAC,WAAW,IAAI,IAAI,IAAI,IAAI,CAAC,WAAW,CAAC,MAAM,GAAG,CAAC,EAAE;oBAC3D,MAAM,cAAI,WAAW,EAAE,IAAI,CAAC,WAAW,IAAK,MAAM,CAAC,CAAC;iBACrD;gBACD,IAAI,IAAI,CAAC,UAAU,IAAI,IAAI,IAAI,IAAI,CAAC,UAAU,CAAC,UAAU,GAAG,CAAC,EAAE;oBAC7D,MAAM,cAAI,UAAU,EAAE,IAAI,CAAC,UAAU,IAAK,MAAM,CAAC,CAAC;iBACnD;gBACD,WAAO,MAAM,EAAC;;;KACf;IACH,wBAAC;AAAD,CAAC,AAnBD,IAmBC;AAED;IACE,0BACqB,WAAsD;QAAtD,gBAAW,GAAX,WAAW,CAA2C;IAC3E,CAAC;IAEK,+BAAI,GAAV,UAAW,cAA8B;;;gBACvC,WAAO,IAAI,CAAC,WAAW,CAAC,cAAc,CAAC,EAAC;;;KACzC;IACH,uBAAC;AAAD,CAAC,AARD,IAQC;AAsBD,oBACI,aAAiB,EAAE,WAAoC,EACvD,UAAwB;IAC1B,OAAO,IAAI,iBAAiB,CAAC,aAAa,EAAE,WAAW,EAAE,UAAU,CAAC,CAAC;AACvE,CAAC;AAJD,gCAIC;AAiBD,yBACI,WAAsD;IACxD,OAAO,IAAI,gBAAgB,CAAC,WAAW,CAAC,CAAC;AAC3C,CAAC;AAHD,0CAGC"}
\ No newline at end of file
diff --git a/node_modules/@tensorflow/tfjs-core/dist/io/passthrough_test.d.ts b/node_modules/@tensorflow/tfjs-core/dist/io/passthrough_test.d.ts
new file mode 100644
index 0000000..cb0ff5c
--- /dev/null
+++ b/node_modules/@tensorflow/tfjs-core/dist/io/passthrough_test.d.ts
@@ -0,0 +1 @@
+export {};
diff --git a/node_modules/@tensorflow/tfjs-core/dist/io/passthrough_test.js b/node_modules/@tensorflow/tfjs-core/dist/io/passthrough_test.js
new file mode 100644
index 0000000..9420360
--- /dev/null
+++ b/node_modules/@tensorflow/tfjs-core/dist/io/passthrough_test.js
@@ -0,0 +1,167 @@
+"use strict";
+var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
+ return new (P || (P = Promise))(function (resolve, reject) {
+ function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
+ function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
+ function step(result) { result.done ? resolve(result.value) : new P(function (resolve) { resolve(result.value); }).then(fulfilled, rejected); }
+ step((generator = generator.apply(thisArg, _arguments || [])).next());
+ });
+};
+var __generator = (this && this.__generator) || function (thisArg, body) {
+ var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;
+ return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
+ function verb(n) { return function (v) { return step([n, v]); }; }
+ function step(op) {
+ if (f) throw new TypeError("Generator is already executing.");
+ while (_) try {
+ if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;
+ if (y = 0, t) op = [op[0] & 2, t.value];
+ switch (op[0]) {
+ case 0: case 1: t = op; break;
+ case 4: _.label++; return { value: op[1], done: false };
+ case 5: _.label++; y = op[1]; op = [0]; continue;
+ case 7: op = _.ops.pop(); _.trys.pop(); continue;
+ default:
+ if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }
+ if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }
+ if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }
+ if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }
+ if (t[2]) _.ops.pop();
+ _.trys.pop(); continue;
+ }
+ op = body.call(thisArg, _);
+ } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }
+ if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };
+ }
+};
+var _this = this;
+Object.defineProperty(exports, "__esModule", { value: true });
+var tf = require("..");
+var jasmine_util_1 = require("../jasmine_util");
+var test_util_1 = require("../test_util");
+var modelTopology1 = {
+ 'class_name': 'Sequential',
+ 'keras_version': '2.1.4',
+ 'config': [{
+ 'class_name': 'Dense',
+ 'config': {
+ 'kernel_initializer': {
+ 'class_name': 'VarianceScaling',
+ 'config': {
+ 'distribution': 'uniform',
+ 'scale': 1.0,
+ 'seed': null,
+ 'mode': 'fan_avg'
+ }
+ },
+ 'name': 'dense',
+ 'kernel_constraint': null,
+ 'bias_regularizer': null,
+ 'bias_constraint': null,
+ 'dtype': 'float32',
+ 'activation': 'linear',
+ 'trainable': true,
+ 'kernel_regularizer': null,
+ 'bias_initializer': { 'class_name': 'Zeros', 'config': {} },
+ 'units': 1,
+ 'batch_input_shape': [null, 3],
+ 'use_bias': true,
+ 'activity_regularizer': null
+ }
+ }],
+ 'backend': 'tensorflow'
+};
+var weightSpecs1 = [
+ {
+ name: 'dense/kernel',
+ shape: [3, 1],
+ dtype: 'float32',
+ },
+ {
+ name: 'dense/bias',
+ shape: [1],
+ dtype: 'float32',
+ }
+];
+var weightData1 = new ArrayBuffer(16);
+var artifacts1 = {
+ modelTopology: modelTopology1,
+ weightSpecs: weightSpecs1,
+ weightData: weightData1,
+};
+jasmine_util_1.describeWithFlags('Passthrough Saver', test_util_1.BROWSER_ENVS, function () {
+ it('passes provided arguments through on save', function () { return __awaiter(_this, void 0, void 0, function () {
+ function saveHandler(artifacts) {
+ savedArtifacts = artifacts;
+ return {
+ modelArtifactsInfo: {
+ dateSaved: testStartDate,
+ modelTopologyType: 'JSON',
+ modelTopologyBytes: JSON.stringify(modelTopology1).length,
+ weightSpecsBytes: JSON.stringify(weightSpecs1).length,
+ weightDataBytes: weightData1.byteLength,
+ }
+ };
+ }
+ var testStartDate, savedArtifacts, saveTrigger, saveResult, artifactsInfo;
+ return __generator(this, function (_a) {
+ switch (_a.label) {
+ case 0:
+ testStartDate = new Date();
+ savedArtifacts = null;
+ saveTrigger = tf.io.withSaveHandler(saveHandler);
+ return [4, saveTrigger.save(artifacts1)];
+ case 1:
+ saveResult = _a.sent();
+ expect(saveResult.errors).toEqual(undefined);
+ artifactsInfo = saveResult.modelArtifactsInfo;
+ expect(artifactsInfo.dateSaved.getTime())
+ .toBeGreaterThanOrEqual(testStartDate.getTime());
+ expect(saveResult.modelArtifactsInfo.modelTopologyBytes)
+ .toEqual(JSON.stringify(modelTopology1).length);
+ expect(saveResult.modelArtifactsInfo.weightSpecsBytes)
+ .toEqual(JSON.stringify(weightSpecs1).length);
+ expect(saveResult.modelArtifactsInfo.weightDataBytes).toEqual(16);
+ expect(savedArtifacts.modelTopology).toEqual(modelTopology1);
+ expect(savedArtifacts.weightSpecs).toEqual(weightSpecs1);
+ expect(savedArtifacts.weightData).toEqual(weightData1);
+ return [2];
+ }
+ });
+ }); });
+});
+jasmine_util_1.describeWithFlags('Passthrough Loader', test_util_1.BROWSER_ENVS, function () {
+ it('load topology and weights', function () { return __awaiter(_this, void 0, void 0, function () {
+ var passthroughHandler, modelArtifacts;
+ return __generator(this, function (_a) {
+ switch (_a.label) {
+ case 0:
+ passthroughHandler = tf.io.fromMemory(modelTopology1, weightSpecs1, weightData1);
+ return [4, passthroughHandler.load()];
+ case 1:
+ modelArtifacts = _a.sent();
+ expect(modelArtifacts.modelTopology).toEqual(modelTopology1);
+ expect(modelArtifacts.weightSpecs).toEqual(weightSpecs1);
+ expect(modelArtifacts.weightData).toEqual(weightData1);
+ return [2];
+ }
+ });
+ }); });
+ it('load model topology only', function () { return __awaiter(_this, void 0, void 0, function () {
+ var passthroughHandler, modelArtifacts;
+ return __generator(this, function (_a) {
+ switch (_a.label) {
+ case 0:
+ passthroughHandler = tf.io.fromMemory(modelTopology1);
+ return [4, passthroughHandler.load()];
+ case 1:
+ modelArtifacts = _a.sent();
+ expect(modelArtifacts.modelTopology).toEqual(modelTopology1);
+ expect(modelArtifacts.weightSpecs).toEqual(undefined);
+ expect(modelArtifacts.weightData).toEqual(undefined);
+ return [2];
+ }
+ });
+ }); });
+});
+//# sourceMappingURL=passthrough_test.js.map
\ No newline at end of file
diff --git a/node_modules/@tensorflow/tfjs-core/dist/io/passthrough_test.js.map b/node_modules/@tensorflow/tfjs-core/dist/io/passthrough_test.js.map
new file mode 100644
index 0000000..1d01ace
--- /dev/null
+++ b/node_modules/@tensorflow/tfjs-core/dist/io/passthrough_test.js.map
@@ -0,0 +1 @@
+{"version":3,"file":"passthrough_test.js","sourceRoot":"","sources":["../../src/io/passthrough_test.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAqBA,iBAgHA;;AAhHA,uBAAyB;AACzB,gDAAkD;AAClD,0CAA0C;AAE1C,IAAM,cAAc,GAAO;IACzB,YAAY,EAAE,YAAY;IAC1B,eAAe,EAAE,OAAO;IACxB,QAAQ,EAAE,CAAC;YACT,YAAY,EAAE,OAAO;YACrB,QAAQ,EAAE;gBACR,oBAAoB,EAAE;oBACpB,YAAY,EAAE,iBAAiB;oBAC/B,QAAQ,EAAE;wBACR,cAAc,EAAE,SAAS;wBACzB,OAAO,EAAE,GAAG;wBACZ,MAAM,EAAE,IAAI;wBACZ,MAAM,EAAE,SAAS;qBAClB;iBACF;gBACD,MAAM,EAAE,OAAO;gBACf,mBAAmB,EAAE,IAAI;gBACzB,kBAAkB,EAAE,IAAI;gBACxB,iBAAiB,EAAE,IAAI;gBACvB,OAAO,EAAE,SAAS;gBAClB,YAAY,EAAE,QAAQ;gBACtB,WAAW,EAAE,IAAI;gBACjB,oBAAoB,EAAE,IAAI;gBAC1B,kBAAkB,EAAE,EAAC,YAAY,EAAE,OAAO,EAAE,QAAQ,EAAE,EAAE,EAAC;gBACzD,OAAO,EAAE,CAAC;gBACV,mBAAmB,EAAE,CAAC,IAAI,EAAE,CAAC,CAAC;gBAC9B,UAAU,EAAE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YAAY,CAAC,CAAC;oBACzD,MAAM,CAAC,cAAc,CAAC,UAAU,CAAC,CAAC,OAAO,CAAC,WAAW,CAAC,CAAC;;;;SACxD,CAAC,CAAC;IAEH,EAAE,CAAC,0BAA0B,EAAE;;;;;oBACvB,kBAAkB,GAAG,EAAE,CAAC,EAAE,CAAC,UAAU,CAAC,cAAc,CAAC,CAAC;oBACrC,WAAM,kBAAkB,CAAC,IAAI,EAAE,EAAA;;oBAAhD,cAAc,GAAG,SAA+B;oBACtD,MAAM,CAAC,cAAc,CAAC,aAAa,CAAC,CAAC,OAAO,CAAC,cAAc,CAAC,CAAC;oBAC7D,MAAM,CAAC,cAAc,CAAC,WAAW,CAAC,CAAC,OAAO,CAAC,SAAS,CAAC,CAAC;oBACtD,MAAM,CAAC,cAAc,CAAC,UAAU,CAAC,CAAC,OAAO,CAAC,SAAS,CAAC,CAAC;;;;SACtD,CAAC,CAAC;AACL,CAAC,CAAC,CAAC"}
\ No newline at end of file
diff --git a/node_modules/@tensorflow/tfjs-core/dist/io/router_registry.d.ts b/node_modules/@tensorflow/tfjs-core/dist/io/router_registry.d.ts
new file mode 100644
index 0000000..e5cc6bc
--- /dev/null
+++ b/node_modules/@tensorflow/tfjs-core/dist/io/router_registry.d.ts
@@ -0,0 +1,14 @@
+import { IOHandler } from './types';
+export declare type IORouter = (url: string) => IOHandler;
+export declare class IORouterRegistry {
+ private static instance;
+ private saveRouters;
+ private loadRouters;
+ private constructor();
+ private static getInstance;
+ static registerSaveRouter(saveRouter: IORouter): void;
+ static registerLoadRouter(loadRouter: IORouter): void;
+ static getSaveHandlers(url: string): IOHandler[];
+ static getLoadHandlers(url: string): IOHandler[];
+ private static getHandlers;
+}
diff --git a/node_modules/@tensorflow/tfjs-core/dist/io/router_registry.js b/node_modules/@tensorflow/tfjs-core/dist/io/router_registry.js
new file mode 100644
index 0000000..e57dd46
--- /dev/null
+++ b/node_modules/@tensorflow/tfjs-core/dist/io/router_registry.js
@@ -0,0 +1,41 @@
+"use strict";
+Object.defineProperty(exports, "__esModule", { value: true });
+var IORouterRegistry = (function () {
+ function IORouterRegistry() {
+ this.saveRouters = [];
+ this.loadRouters = [];
+ }
+ IORouterRegistry.getInstance = function () {
+ if (IORouterRegistry.instance == null) {
+ IORouterRegistry.instance = new IORouterRegistry();
+ }
+ return IORouterRegistry.instance;
+ };
+ IORouterRegistry.registerSaveRouter = function (saveRouter) {
+ IORouterRegistry.getInstance().saveRouters.push(saveRouter);
+ };
+ IORouterRegistry.registerLoadRouter = function (loadRouter) {
+ IORouterRegistry.getInstance().loadRouters.push(loadRouter);
+ };
+ IORouterRegistry.getSaveHandlers = function (url) {
+ return IORouterRegistry.getHandlers(url, 'save');
+ };
+ IORouterRegistry.getLoadHandlers = function (url) {
+ return IORouterRegistry.getHandlers(url, 'load');
+ };
+ IORouterRegistry.getHandlers = function (url, handlerType) {
+ var validHandlers = [];
+ var routers = handlerType === 'load' ? this.getInstance().loadRouters :
+ this.getInstance().saveRouters;
+ routers.forEach(function (router) {
+ var handler = router(url);
+ if (handler !== null) {
+ validHandlers.push(handler);
+ }
+ });
+ return validHandlers;
+ };
+ return IORouterRegistry;
+}());
+exports.IORouterRegistry = IORouterRegistry;
+//# sourceMappingURL=router_registry.js.map
\ No newline at end of file
diff --git a/node_modules/@tensorflow/tfjs-core/dist/io/router_registry.js.map b/node_modules/@tensorflow/tfjs-core/dist/io/router_registry.js.map
new file mode 100644
index 0000000..ec91550
--- /dev/null
+++ b/node_modules/@tensorflow/tfjs-core/dist/io/router_registry.js.map
@@ -0,0 +1 @@
+{"version":3,"file":"router_registry.js","sourceRoot":"","sources":["../../src/io/router_registry.ts"],"names":[],"mappings":";;AAqBA;IAOE;QACE,IAAI,CAAC,WAAW,GAAG,EAAE,CAAC;QACtB,IAAI,CAAC,WAAW,GAAG,EAAE,CAAC;IACxB,CAAC;IAEc,4BAAW,GAA1B;QACE,IAAI,gBAAgB,CAAC,QAAQ,IAAI,IAAI,EAAE;YACrC,gBAAgB,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_registry_test.d.ts
new file mode 100644
index 0000000..cb0ff5c
--- /dev/null
+++ b/node_modules/@tensorflow/tfjs-core/dist/io/router_registry_test.d.ts
@@ -0,0 +1 @@
+export {};
diff --git a/node_modules/@tensorflow/tfjs-core/dist/io/router_registry_test.js b/node_modules/@tensorflow/tfjs-core/dist/io/router_registry_test.js
new file mode 100644
index 0000000..65ec045
--- /dev/null
+++ b/node_modules/@tensorflow/tfjs-core/dist/io/router_registry_test.js
@@ -0,0 +1,62 @@
+"use strict";
+Object.defineProperty(exports, "__esModule", { value: true });
+var tf = require("../index");
+var jasmine_util_1 = require("../jasmine_util");
+var test_util_1 = require("../test_util");
+var indexed_db_1 = require("./indexed_db");
+var local_storage_1 = require("./local_storage");
+var router_registry_1 = require("./router_registry");
+jasmine_util_1.describeWithFlags('IORouterRegistry', test_util_1.BROWSER_ENVS, function () {
+ var localStorageRouter = function (url) {
+ var scheme = 'localstorage://';
+ if (url.startsWith(scheme)) {
+ return local_storage_1.browserLocalStorage(url.slice(scheme.length));
+ }
+ else {
+ return null;
+ }
+ };
+ var indexedDBRouter = function (url) {
+ var scheme = 'indexeddb://';
+ if (url.startsWith(scheme)) {
+ return indexed_db_1.browserIndexedDB(url.slice(scheme.length));
+ }
+ else {
+ return null;
+ }
+ };
+ var tempRegistryInstance = null;
+ beforeEach(function () {
+ tempRegistryInstance = router_registry_1.IORouterRegistry.instance;
+ router_registry_1.IORouterRegistry.instance = null;
+ });
+ afterEach(function () {
+ router_registry_1.IORouterRegistry.instance = tempRegistryInstance;
+ });
+ it('getSaveHandler succeeds', function () {
+ router_registry_1.IORouterRegistry.registerSaveRouter(localStorageRouter);
+ router_registry_1.IORouterRegistry.registerSaveRouter(indexedDBRouter);
+ var out1 = tf.io.getSaveHandlers('localstorage://foo-model');
+ expect(out1.length).toEqual(1);
+ expect(out1[0] instanceof local_storage_1.BrowserLocalStorage).toEqual(true);
+ var out2 = tf.io.getSaveHandlers('indexeddb://foo-model');
+ expect(out2.length).toEqual(1);
+ expect(out2[0] instanceof indexed_db_1.BrowserIndexedDB).toEqual(true);
+ });
+ it('getLoadHandler succeeds', function () {
+ router_registry_1.IORouterRegistry.registerLoadRouter(localStorageRouter);
+ router_registry_1.IORouterRegistry.registerLoadRouter(indexedDBRouter);
+ var out1 = tf.io.getLoadHandlers('localstorage://foo-model');
+ expect(out1.length).toEqual(1);
+ expect(out1[0] instanceof local_storage_1.BrowserLocalStorage).toEqual(true);
+ var out2 = tf.io.getLoadHandlers('indexeddb://foo-model');
+ expect(out2.length).toEqual(1);
+ expect(out2[0] instanceof indexed_db_1.BrowserIndexedDB).toEqual(true);
+ });
+ it('getSaveHandler fails', function () {
+ router_registry_1.IORouterRegistry.registerSaveRouter(localStorageRouter);
+ expect(tf.io.getSaveHandlers('invalidscheme://foo-model')).toEqual([]);
+ expect(tf.io.getLoadHandlers('localstorage://foo-model')).toEqual([]);
+ });
+});
+//# sourceMappingURL=router_registry_test.js.map
\ No newline at end of file
diff --git a/node_modules/@tensorflow/tfjs-core/dist/io/router_registry_test.js.map b/node_modules/@tensorflow/tfjs-core/dist/io/router_registry_test.js.map
new file mode 100644
index 0000000..984f9d3
--- /dev/null
+++ b/node_modules/@tensorflow/tfjs-core/dist/io/router_registry_test.js.map
@@ -0,0 +1 @@
+{"version":3,"file":"router_registry_test.js","sourceRoot":"","sources":["../../src/io/router_registry_test.ts"],"names":[],"mappings":";;AAiBA,6BAA+B;AAC/B,gDAAkD;AAClD,0CAA0C;AAC1C,2CAAgE;AAChE,iDAAyE;AACzE,qDAAmD;AAEnD,gCAAiB,CAAC,kBAAkB,EAAE,wBAAY,EAAE;IAClD,IAAM,kBAAkB,GAAG,UAAC,GAAW;QACrC,IAAM,MAAM,GAAG,iBAAiB,CAAC;QACjC,IAAI,GAAG,CAAC,UAAU,CAAC,MAAM,CAAC,EAAE;YAC1B,OAAO,mCAAmB,CAAC,GAAG,CAAC,KAAK,CAAC,MAAM,CAAC,MAAM,CAAC,CAAC,CAAC;SACtD;a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C,IAAI,CAAC,CAAC;IAC5D,CAAC,CAAC,CAAC;IAEH,EAAE,CAAC,yBAAyB,EAAE;QAC5B,kCAAgB,CAAC,kBAAkB,CAAC,kBAAkB,CAAC,CAAC;QACxD,kCAAgB,CAAC,kBAAkB,CAAC,eAAe,CAAC,CAAC;QAErD,IAAM,IAAI,GAAG,EAAE,CAAC,EAAE,CAAC,eAAe,CAAC,0BAA0B,CAAC,CAAC;QAC/D,MAAM,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC,CAAC;QAC/B,MAAM,CAAC,IAAI,CAAC,CAAC,CAAC,YAAY,mCAAmB,CAAC,CAAC,OAAO,CAAC,IAAI,CAAC,CAAC;QAC7D,IAAM,IAAI,GAAG,EAAE,CAAC,EAAE,CAAC,eAAe,CAAC,uBAAuB,CAAC,CAAC;QAC5D,MAAM,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC,CAAC;QAC/B,MAAM,CAAC,IAAI,CAAC,CAAC,CAAC,YAAY,6BAAgB,CAAC,CAAC,OAAO,CAAC,IAAI,CAAC,CAAC;IAC5D,CAAC,CAAC,CAAC;IAEH,EAAE,CAAC,sBAAsB,EAAE;QACzB,kCAAgB,CAAC,kBAAkB,CAAC,kBAAkB,CAAC,CAAC;QAExD,MAAM,CAAC,EAAE,CAAC,EAAE,CAAC,eAAe,CAAC,2BAA2B,CAAC,CAAC,CAAC,OAAO,CAAC,EAAE,CAAC,CAAC;QAEvE,MAAM,CAAC,EAAE,CAAC,EAAE,CAAC,eAAe,CAAC,0BAA0B,CAAC,CAAC,CAAC,OAAO,CAAC,EAAE,CAAC,CAAC;IACxE,CAAC,CAAC,CAAC;AACL,CAAC,CAAC,CAAC"}
\ No newline at end of file
diff --git a/node_modules/@tensorflow/tfjs-core/dist/io/types.d.ts b/node_modules/@tensorflow/tfjs-core/dist/io/types.d.ts
new file mode 100644
index 0000000..979c9d3
--- /dev/null
+++ b/node_modules/@tensorflow/tfjs-core/dist/io/types.d.ts
@@ -0,0 +1,50 @@
+export declare const DTYPE_VALUE_SIZE_MAP: {
+ [dtype: string]: number;
+};
+export declare type WeightsManifestConfig = WeightsManifestGroupConfig[];
+export declare interface WeightsManifestGroupConfig {
+ paths: string[];
+ weights: WeightsManifestEntry[];
+}
+export declare interface WeightsManifestEntry {
+ name: string;
+ shape: number[];
+ dtype: 'float32' | 'int32' | 'bool';
+ quantization?: {
+ scale: number;
+ min: number;
+ dtype: 'uint16' | 'uint8';
+ };
+}
+export interface SaveConfig {
+ trainableOnly?: boolean;
+}
+export interface SaveResult {
+ modelArtifactsInfo: ModelArtifactsInfo;
+ responses?: Response[];
+ errors?: Array<{} | string>;
+}
+export declare interface ModelArtifactsInfo {
+ dateSaved: Date;
+ modelTopologyType: 'JSON' | 'GraphDef';
+ modelTopologyBytes?: number;
+ weightSpecsBytes?: number;
+ weightDataBytes?: number;
+}
+export declare interface ModelArtifacts {
+ modelTopology?: {} | ArrayBuffer;
+ weightSpecs?: WeightsManifestEntry[];
+ weightData?: ArrayBuffer;
+}
+export declare type LoadHandler = () => Promise;
+export declare type SaveHandler = (modelArtifact: ModelArtifacts) => Promise;
+export interface IOHandler {
+ save?: SaveHandler;
+ load?: LoadHandler;
+}
+export interface ModelStoreManager {
+ listModels(): Promise<{
+ [path: string]: ModelArtifactsInfo;
+ }>;
+ removeModel(path: string): Promise;
+}
diff --git a/node_modules/@tensorflow/tfjs-core/dist/io/types.js b/node_modules/@tensorflow/tfjs-core/dist/io/types.js
new file mode 100644
index 0000000..cf52e5c
--- /dev/null
+++ b/node_modules/@tensorflow/tfjs-core/dist/io/types.js
@@ -0,0 +1,10 @@
+"use strict";
+Object.defineProperty(exports, "__esModule", { value: true });
+exports.DTYPE_VALUE_SIZE_MAP = {
+ 'float32': 4,
+ 'int32': 4,
+ 'uint16': 2,
+ 'uint8': 1,
+ 'bool': 1,
+};
+//# sourceMappingURL=types.js.map
\ No newline at end of file
diff --git a/node_modules/@tensorflow/tfjs-core/dist/io/types.js.map b/node_modules/@tensorflow/tfjs-core/dist/io/types.js.map
new file mode 100644
index 0000000..cc5eec8
--- /dev/null
+++ b/node_modules/@tensorflow/tfjs-core/dist/io/types.js.map
@@ -0,0 +1 @@
+{"version":3,"file":"types.js","sourceRoot":"","sources":["../../src/io/types.ts"],"names":[],"mappings":";;AAsBa,QAAA,oBAAoB,GAA8B;IAC7D,SAAS,EAAE,CAAC;IACZ,OAAO,EAAE,CAAC;IACV,QAAQ,EAAE,CAAC;IACX,OAAO,EAAE,CAAC;IACV,MAAM,EAAE,CAAC;CACV,CAAC"}
\ No newline at end of file
diff --git a/node_modules/@tensorflow/tfjs-core/dist/io/weights_loader.d.ts b/node_modules/@tensorflow/tfjs-core/dist/io/weights_loader.d.ts
new file mode 100644
index 0000000..aa0a2a2
--- /dev/null
+++ b/node_modules/@tensorflow/tfjs-core/dist/io/weights_loader.d.ts
@@ -0,0 +1,4 @@
+import { NamedTensorMap } from '../tensor_types';
+import { WeightsManifestConfig } from './types';
+export declare function loadWeightsAsArrayBuffer(fetchURLs: string[], requestOptions?: RequestInit): Promise;
+export declare function loadWeights(manifest: WeightsManifestConfig, filePathPrefix?: string, weightNames?: string[], requestOptions?: RequestInit): Promise;
diff --git a/node_modules/@tensorflow/tfjs-core/dist/io/weights_loader.js b/node_modules/@tensorflow/tfjs-core/dist/io/weights_loader.js
new file mode 100644
index 0000000..07d10ab
--- /dev/null
+++ b/node_modules/@tensorflow/tfjs-core/dist/io/weights_loader.js
@@ -0,0 +1,200 @@
+"use strict";
+var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
+ return new (P || (P = Promise))(function (resolve, reject) {
+ function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
+ function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
+ function step(result) { result.done ? resolve(result.value) : new P(function (resolve) { resolve(result.value); }).then(fulfilled, rejected); }
+ step((generator = generator.apply(thisArg, _arguments || [])).next());
+ });
+};
+var __generator = (this && this.__generator) || function (thisArg, body) {
+ var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;
+ return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
+ function verb(n) { return function (v) { return step([n, v]); }; }
+ function step(op) {
+ if (f) throw new TypeError("Generator is already executing.");
+ while (_) try {
+ if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;
+ if (y = 0, t) op = [op[0] & 2, t.value];
+ switch (op[0]) {
+ case 0: case 1: t = op; break;
+ case 4: _.label++; return { value: op[1], done: false };
+ case 5: _.label++; y = op[1]; op = [0]; continue;
+ case 7: op = _.ops.pop(); _.trys.pop(); continue;
+ default:
+ if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }
+ if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }
+ if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }
+ if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }
+ if (t[2]) _.ops.pop();
+ _.trys.pop(); continue;
+ }
+ op = body.call(thisArg, _);
+ } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }
+ if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };
+ }
+};
+Object.defineProperty(exports, "__esModule", { value: true });
+var ops_1 = require("../ops/ops");
+var util = require("../util");
+var types_1 = require("./types");
+function loadWeightsAsArrayBuffer(fetchURLs, requestOptions) {
+ return __awaiter(this, void 0, void 0, function () {
+ var requests, responses, buffers;
+ return __generator(this, function (_a) {
+ switch (_a.label) {
+ case 0:
+ requests = fetchURLs.map(function (fetchURL) { return fetch(fetchURL, requestOptions); });
+ return [4, Promise.all(requests)];
+ case 1:
+ responses = _a.sent();
+ return [4, Promise.all(responses.map(function (response) { return response.arrayBuffer(); }))];
+ case 2:
+ buffers = _a.sent();
+ return [2, buffers];
+ }
+ });
+ });
+}
+exports.loadWeightsAsArrayBuffer = loadWeightsAsArrayBuffer;
+function loadWeights(manifest, filePathPrefix, weightNames, requestOptions) {
+ if (filePathPrefix === void 0) { filePathPrefix = ''; }
+ return __awaiter(this, void 0, void 0, function () {
+ var groupIndicesToFetchMap, groupWeightsToFetch, weightsFound, allManifestWeightNames, weightsNotFound, groupIndicesToFetch, fetchUrls, buffers, weightsTensorMap, bufferIndexOffset;
+ return __generator(this, function (_a) {
+ switch (_a.label) {
+ case 0:
+ groupIndicesToFetchMap = manifest.map(function () { return false; });
+ groupWeightsToFetch = {};
+ weightsFound = weightNames != null ? weightNames.map(function () { return false; }) : [];
+ allManifestWeightNames = [];
+ manifest.forEach(function (manifestGroupConfig, groupIndex) {
+ var groupOffset = 0;
+ manifestGroupConfig.weights.forEach(function (weightsEntry) {
+ var rawDtype = ('quantization' in weightsEntry) ?
+ weightsEntry.quantization.dtype :
+ weightsEntry.dtype;
+ var weightsBytes = types_1.DTYPE_VALUE_SIZE_MAP[rawDtype] *
+ util.sizeFromShape(weightsEntry.shape);
+ var enqueueWeightsForFetchingFn = function () {
+ groupIndicesToFetchMap[groupIndex] = true;
+ if (groupWeightsToFetch[groupIndex] == null) {
+ groupWeightsToFetch[groupIndex] = [];
+ }
+ groupWeightsToFetch[groupIndex].push({
+ manifestEntry: weightsEntry,
+ groupOffset: groupOffset,
+ sizeBytes: weightsBytes
+ });
+ };
+ if (weightNames != null) {
+ weightNames.forEach(function (weightName, weightIndex) {
+ if (weightName === weightsEntry.name) {
+ enqueueWeightsForFetchingFn();
+ weightsFound[weightIndex] = true;
+ }
+ });
+ }
+ else {
+ enqueueWeightsForFetchingFn();
+ }
+ allManifestWeightNames.push(weightsEntry.name);
+ groupOffset += weightsBytes;
+ });
+ });
+ if (!weightsFound.every(function (found) { return found; })) {
+ weightsNotFound = weightNames.filter(function (weight, i) { return !weightsFound[i]; });
+ throw new Error("Could not find weights in manifest with names: " +
+ (weightsNotFound.join(', ') + ". \n") +
+ "Manifest JSON has weights with names: " +
+ (allManifestWeightNames.join(', ') + "."));
+ }
+ groupIndicesToFetch = groupIndicesToFetchMap.reduce(function (accumulator, shouldFetch, i) {
+ if (shouldFetch) {
+ accumulator.push(i);
+ }
+ return accumulator;
+ }, []);
+ fetchUrls = [];
+ groupIndicesToFetch.forEach(function (i) {
+ manifest[i].paths.forEach(function (filepath) {
+ var fetchUrl = filePathPrefix +
+ (!filePathPrefix.endsWith('/') ? '/' : '') + filepath;
+ fetchUrls.push(fetchUrl);
+ });
+ });
+ return [4, loadWeightsAsArrayBuffer(fetchUrls, requestOptions)];
+ case 1:
+ buffers = _a.sent();
+ weightsTensorMap = {};
+ bufferIndexOffset = 0;
+ groupIndicesToFetch.forEach(function (i) {
+ var numBuffers = manifest[i].paths.length;
+ var groupBytes = 0;
+ for (var i_1 = 0; i_1 < numBuffers; i_1++) {
+ groupBytes += buffers[bufferIndexOffset + i_1].byteLength;
+ }
+ var groupBuffer = new ArrayBuffer(groupBytes);
+ var groupByteBuffer = new Uint8Array(groupBuffer);
+ var groupBufferOffset = 0;
+ for (var i_2 = 0; i_2 < numBuffers; i_2++) {
+ var buffer = new Uint8Array(buffers[bufferIndexOffset + i_2]);
+ groupByteBuffer.set(buffer, groupBufferOffset);
+ groupBufferOffset += buffer.byteLength;
+ }
+ var weightsEntries = groupWeightsToFetch[i];
+ weightsEntries.forEach(function (weightsEntry) {
+ var byteBuffer = groupBuffer.slice(weightsEntry.groupOffset, weightsEntry.groupOffset + weightsEntry.sizeBytes);
+ var typedArray;
+ var dtype = weightsEntry.manifestEntry.dtype;
+ if ('quantization' in weightsEntry.manifestEntry) {
+ var quantization_1 = weightsEntry.manifestEntry.quantization;
+ if (quantization_1.dtype !== 'uint8' && quantization_1.dtype !== 'uint16') {
+ throw new Error("Weight " + weightsEntry.manifestEntry.name + " has unknown " +
+ ("quantization dtype " + quantization_1.dtype + "."));
+ }
+ var quantizedArray = (quantization_1.dtype === 'uint8') ?
+ new Uint8Array(byteBuffer) :
+ new Uint16Array(byteBuffer);
+ if (dtype === 'float32') {
+ typedArray = Float32Array.from(quantizedArray, function (v) { return v * quantization_1.scale + quantization_1.min; });
+ }
+ else if (dtype === 'int32') {
+ typedArray = Int32Array.from(quantizedArray, function (v) { return Math.round(v * quantization_1.scale + quantization_1.min); });
+ }
+ else {
+ throw new Error("Weight " + weightsEntry.manifestEntry.name + " has a dtype not " +
+ ("supported by quantization: " + dtype));
+ }
+ }
+ else {
+ if (dtype === 'float32') {
+ typedArray = new Float32Array(byteBuffer);
+ }
+ else if (dtype === 'int32') {
+ typedArray = new Int32Array(byteBuffer);
+ }
+ else if (dtype === 'bool') {
+ typedArray = new Uint8Array(byteBuffer);
+ }
+ else {
+ throw new Error("Weight " + weightsEntry.manifestEntry.name + " has unknown dtype " +
+ (dtype + "."));
+ }
+ }
+ var weightName = weightsEntry.manifestEntry.name;
+ if (weightsTensorMap[weightName] != null) {
+ throw new Error("Duplicate weight with name " + weightName + ". " +
+ "Please make sure weights names are unique in the manifest JSON.");
+ }
+ weightsTensorMap[weightName] = ops_1.tensor(typedArray, weightsEntry.manifestEntry.shape, weightsEntry.manifestEntry.dtype);
+ });
+ bufferIndexOffset += numBuffers;
+ });
+ return [2, weightsTensorMap];
+ }
+ });
+ });
+}
+exports.loadWeights = loadWeights;
+//# sourceMappingURL=weights_loader.js.map
\ No newline at end of file
diff --git a/node_modules/@tensorflow/tfjs-core/dist/io/weights_loader.js.map b/node_modules/@tensorflow/tfjs-core/dist/io/weights_loader.js.map
new file mode 100644
index 0000000..f47b706
--- /dev/null
+++ b/node_modules/@tensorflow/tfjs-core/dist/io/weights_loader.js.map
@@ -0,0 +1 @@
+{"version":3,"file":"weights_loader.js","sourceRoot":"","sources":["../../src/io/weights_loader.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gB,CAAC,UAAU,CAAC,IAAI,IAAI,EAAE;gCACxC,MAAM,IAAI,KAAK,CACX,gCAA8B,UAAU,OAAI;oCAC5C,iEAAiE,CAAC,CAAC;6BACxE;4BACD,gBAAgB,CAAC,UAAU,CAAC,GAAG,YAAM,CACjC,UAAU,EAAE,YAAY,CAAC,aAAa,CAAC,KAAK,EAC5C,YAAY,CAAC,aAAa,CAAC,KAAK,CAAC,CAAC;wBACxC,CAAC,CAAC,CAAC;wBAEH,iBAAiB,IAAI,UAAU,CAAC;oBAClC,CAAC,CAAC,CAAC;oBAEH,WAAO,gBAAgB,EAAC;;;;CACzB;AA3KD,kCA2KC"}
\ No newline at end of file
diff --git a/node_modules/@tensorflow/tfjs-core/dist/io/weights_loader_test.d.ts b/node_modules/@tensorflow/tfjs-core/dist/io/weights_loader_test.d.ts
new file mode 100644
index 0000000..cb0ff5c
--- /dev/null
+++ b/node_modules/@tensorflow/tfjs-core/dist/io/weights_loader_test.d.ts
@@ -0,0 +1 @@
+export {};
diff --git a/node_modules/@tensorflow/tfjs-core/dist/io/weights_loader_test.js b/node_modules/@tensorflow/tfjs-core/dist/io/weights_loader_test.js
new file mode 100644
index 0000000..e7ce1de
--- /dev/null
+++ b/node_modules/@tensorflow/tfjs-core/dist/io/weights_loader_test.js
@@ -0,0 +1,531 @@
+"use strict";
+var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
+ return new (P || (P = Promise))(function (resolve, reject) {
+ function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
+ function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
+ function step(result) { result.done ? resolve(result.value) : new P(function (resolve) { resolve(result.value); }).then(fulfilled, rejected); }
+ step((generator = generator.apply(thisArg, _arguments || [])).next());
+ });
+};
+var __generator = (this && this.__generator) || function (thisArg, body) {
+ var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;
+ return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
+ function verb(n) { return function (v) { return step([n, v]); }; }
+ function step(op) {
+ if (f) throw new TypeError("Generator is already executing.");
+ while (_) try {
+ if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;
+ if (y = 0, t) op = [op[0] & 2, t.value];
+ switch (op[0]) {
+ case 0: case 1: t = op; break;
+ case 4: _.label++; return { value: op[1], done: false };
+ case 5: _.label++; y = op[1]; op = [0]; continue;
+ case 7: op = _.ops.pop(); _.trys.pop(); continue;
+ default:
+ if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }
+ if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }
+ if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }
+ if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }
+ if (t[2]) _.ops.pop();
+ _.trys.pop(); continue;
+ }
+ op = body.call(thisArg, _);
+ } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }
+ if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };
+ }
+};
+var _this = this;
+Object.defineProperty(exports, "__esModule", { value: true });
+var tf = require("../index");
+var jasmine_util_1 = require("../jasmine_util");
+var test_util_1 = require("../test_util");
+jasmine_util_1.describeWithFlags('loadWeights', test_util_1.BROWSER_ENVS, function () {
+ var setupFakeWeightFiles = function (fileBufferMap) {
+ spyOn(window, 'fetch').and.callFake(function (path) {
+ return new Response(fileBufferMap[path]);
+ });
+ };
+ it('1 group, 1 weight, 1 requested weight', function (done) {
+ setupFakeWeightFiles({ './weightfile0': new Float32Array([1, 2, 3]) });
+ var manifest = [{
+ 'paths': ['weightfile0'],
+ 'weights': [{ 'name': 'weight0', 'dtype': 'float32', 'shape': [3] }]
+ }];
+ var weightsNamesToFetch = ['weight0'];
+ tf.io.loadWeights(manifest, './', weightsNamesToFetch)
+ .then(function (weights) {
+ expect(window.fetch.calls.count()).toBe(1);
+ var weightNames = Object.keys(weights);
+ expect(weightNames.length).toEqual(weightsNamesToFetch.length);
+ var weight0 = weights['weight0'];
+ test_util_1.expectArraysClose(weight0, [1, 2, 3]);
+ expect(weight0.shape).toEqual([3]);
+ expect(weight0.dtype).toEqual('float32');
+ })
+ .then(done)
+ .catch(done.fail);
+ });
+ it('1 group, 2 weights, fetch 1st weight', function (done) {
+ setupFakeWeightFiles({ './weightfile0': new Float32Array([1, 2, 3, 4, 5]) });
+ var manifest = [{
+ 'paths': ['weightfile0'],
+ 'weights': [
+ { 'name': 'weight0', 'dtype': 'float32', 'shape': [2] },
+ { 'name': 'weight1', 'dtype': 'float32', 'shape': [3] }
+ ]
+ }];
+ tf.io.loadWeights(manifest, './', ['weight0'])
+ .then(function (weights) {
+ expect(window.fetch.calls.count()).toBe(1);
+ var weightNames = Object.keys(weights);
+ expect(weightNames.length).toEqual(1);
+ var weight0 = weights['weight0'];
+ test_util_1.expectArraysClose(weight0, [1, 2]);
+ expect(weight0.shape).toEqual([2]);
+ expect(weight0.dtype).toEqual('float32');
+ })
+ .then(done)
+ .catch(done.fail);
+ });
+ it('1 group, 2 weights, fetch 2nd weight', function (done) {
+ setupFakeWeightFiles({ './weightfile0': new Float32Array([1, 2, 3, 4, 5]) });
+ var manifest = [{
+ 'paths': ['weightfile0'],
+ 'weights': [
+ { 'name': 'weight0', 'dtype': 'float32', 'shape': [2] },
+ { 'name': 'weight1', 'dtype': 'float32', 'shape': [3] }
+ ]
+ }];
+ tf.io.loadWeights(manifest, './', ['weight1'])
+ .then(function (weights) {
+ expect(window.fetch.calls.count()).toBe(1);
+ var weightNames = Object.keys(weights);
+ expect(weightNames.length).toEqual(1);
+ var weight1 = weights['weight1'];
+ test_util_1.expectArraysClose(weight1, [3, 4, 5]);
+ expect(weight1.shape).toEqual([3]);
+ expect(weight1.dtype).toEqual('float32');
+ })
+ .then(done)
+ .catch(done.fail);
+ });
+ it('1 group, 2 weights, fetch all weights', function (done) {
+ setupFakeWeightFiles({ './weightfile0': new Float32Array([1, 2, 3, 4, 5]) });
+ var manifest = [{
+ 'paths': ['weightfile0'],
+ 'weights': [
+ { 'name': 'weight0', 'dtype': 'float32', 'shape': [2] },
+ { 'name': 'weight1', 'dtype': 'float32', 'shape': [3] }
+ ]
+ }];
+ tf.io.loadWeights(manifest, './', ['weight0', 'weight1'])
+ .then(function (weights) {
+ expect(window.fetch.calls.count()).toBe(1);
+ var weightNames = Object.keys(weights);
+ expect(weightNames.length).toEqual(2);
+ var weight0 = weights['weight0'];
+ test_util_1.expectArraysClose(weight0, [1, 2]);
+ expect(weight0.shape).toEqual([2]);
+ expect(weight0.dtype).toEqual('float32');
+ var weight1 = weights['weight1'];
+ test_util_1.expectArraysClose(weight1, [3, 4, 5]);
+ expect(weight1.shape).toEqual([3]);
+ expect(weight1.dtype).toEqual('float32');
+ })
+ .then(done)
+ .catch(done.fail);
+ });
+ it('1 group, multiple weights, different dtypes', function (done) {
+ var buffer = new ArrayBuffer(5 * 4 + 1);
+ var view = new DataView(buffer);
+ view.setInt32(0, 1, true);
+ view.setInt32(4, 2, true);
+ view.setUint8(8, 1);
+ view.setFloat32(9, 3., true);
+ view.setFloat32(13, 4., true);
+ view.setFloat32(17, 5., true);
+ setupFakeWeightFiles({ './weightfile0': buffer });
+ var manifest = [{
+ 'paths': ['weightfile0'],
+ 'weights': [
+ { 'name': 'weight0', 'dtype': 'int32', 'shape': [2] },
+ { 'name': 'weight1', 'dtype': 'bool', 'shape': [] },
+ { 'name': 'weight2', 'dtype': 'float32', 'shape': [3] },
+ ]
+ }];
+ tf.io.loadWeights(manifest, './', ['weight0', 'weight1', 'weight2'])
+ .then(function (weights) {
+ expect(window.fetch.calls.count()).toBe(1);
+ var weightNames = Object.keys(weights);
+ expect(weightNames.length).toEqual(3);
+ var weight0 = weights['weight0'];
+ test_util_1.expectArraysClose(weight0, [1, 2]);
+ expect(weight0.shape).toEqual([2]);
+ expect(weight0.dtype).toEqual('int32');
+ var weight1 = weights['weight1'];
+ test_util_1.expectArraysClose(weight1, [1]);
+ expect(weight1.shape).toEqual([]);
+ expect(weight1.dtype).toEqual('bool');
+ var weight2 = weights['weight2'];
+ test_util_1.expectArraysClose(weight2, [3, 4, 5]);
+ expect(weight2.shape).toEqual([3]);
+ expect(weight2.dtype).toEqual('float32');
+ })
+ .then(done)
+ .catch(done.fail);
+ });
+ it('1 group, sharded 1 weight across multiple files', function (done) {
+ var shard0 = new Float32Array([1, 2, 3, 4, 5]);
+ var shard1 = new Float32Array([1.1, 2.2]);
+ var shard2 = new Float32Array([10, 20, 30]);
+ setupFakeWeightFiles({
+ './weightfile0': shard0,
+ './weightsfile1': shard1,
+ './weightsfile2': shard2
+ });
+ var manifest = [{
+ 'paths': ['weightfile0', 'weightsfile1', 'weightsfile2'],
+ 'weights': [{ 'name': 'weight0', 'dtype': 'float32', 'shape': [5, 2] }]
+ }];
+ tf.io.loadWeights(manifest, './', ['weight0'])
+ .then(function (weights) {
+ expect(window.fetch.calls.count()).toBe(3);
+ var weightNames = Object.keys(weights);
+ expect(weightNames.length).toEqual(1);
+ var weight0 = weights['weight0'];
+ test_util_1.expectArraysClose(weight0, [1, 2, 3, 4, 5, 1.1, 2.2, 10, 20, 30]);
+ expect(weight0.shape).toEqual([5, 2]);
+ expect(weight0.dtype).toEqual('float32');
+ })
+ .then(done)
+ .catch(done.fail);
+ });
+ it('1 group, sharded 2 weights across multiple files', function (done) {
+ var shard0 = new Int32Array([1, 2, 3, 4, 5]);
+ var shard1 = new ArrayBuffer(5 * 4);
+ var intBuffer = new Int32Array(shard1, 0, 2);
+ intBuffer.set([10, 20]);
+ var floatBuffer = new Float32Array(shard1, intBuffer.byteLength, 3);
+ floatBuffer.set([3.0, 4.0, 5.0]);
+ var shard2 = new Float32Array([10, 20, 30]);
+ setupFakeWeightFiles({
+ './weightfile0': shard0,
+ './weightsfile1': shard1,
+ './weightsfile2': shard2
+ });
+ var manifest = [{
+ 'paths': ['weightfile0', 'weightsfile1', 'weightsfile2'],
+ 'weights': [
+ { 'name': 'weight0', 'dtype': 'int32', 'shape': [7, 1] },
+ { 'name': 'weight1', 'dtype': 'float32', 'shape': [3, 2] }
+ ]
+ }];
+ tf.io.loadWeights(manifest, './', ['weight0', 'weight1'])
+ .then(function (weights) {
+ expect(window.fetch.calls.count()).toBe(3);
+ var weightNames = Object.keys(weights);
+ expect(weightNames.length).toEqual(2);
+ var weight0 = weights['weight0'];
+ test_util_1.expectArraysClose(weight0, [1, 2, 3, 4, 5, 10, 20]);
+ expect(weight0.shape).toEqual([7, 1]);
+ expect(weight0.dtype).toEqual('int32');
+ var weight1 = weights['weight1'];
+ test_util_1.expectArraysClose(weight1, [3.0, 4.0, 5.0, 10, 20, 30]);
+ expect(weight1.shape).toEqual([3, 2]);
+ expect(weight1.dtype).toEqual('float32');
+ })
+ .then(done)
+ .catch(done.fail);
+ });
+ it('2 group, 4 weights, fetches one group', function (done) {
+ setupFakeWeightFiles({
+ './weightfile0': new Float32Array([1, 2, 3, 4, 5]),
+ './weightfile1': new Float32Array([6, 7, 8, 9])
+ });
+ var manifest = [
+ {
+ 'paths': ['weightfile0'],
+ 'weights': [
+ { 'name': 'weight0', 'dtype': 'float32', 'shape': [2] },
+ { 'name': 'weight1', 'dtype': 'float32', 'shape': [3] }
+ ]
+ },
+ {
+ 'paths': ['weightfile1'],
+ 'weights': [
+ { 'name': 'weight2', 'dtype': 'float32', 'shape': [3, 1] },
+ { 'name': 'weight3', 'dtype': 'float32', 'shape': [] }
+ ]
+ }
+ ];
+ tf.io.loadWeights(manifest, './', ['weight0', 'weight1'])
+ .then(function (weights) {
+ expect(window.fetch.calls.count()).toBe(1);
+ var weightNames = Object.keys(weights);
+ expect(weightNames.length).toEqual(2);
+ var weight0 = weights['weight0'];
+ test_util_1.expectArraysClose(weight0, [1, 2]);
+ expect(weight0.shape).toEqual([2]);
+ expect(weight0.dtype).toEqual('float32');
+ var weight1 = weights['weight1'];
+ test_util_1.expectArraysClose(weight1, [3, 4, 5]);
+ expect(weight1.shape).toEqual([3]);
+ expect(weight1.dtype).toEqual('float32');
+ })
+ .then(done)
+ .catch(done.fail);
+ });
+ it('2 group, 4 weights, one weight from each group', function (done) {
+ setupFakeWeightFiles({
+ './weightfile0': new Float32Array([1, 2, 3, 4, 5]),
+ './weightfile1': new Float32Array([6, 7, 8, 9])
+ });
+ var manifest = [
+ {
+ 'paths': ['weightfile0'],
+ 'weights': [
+ { 'name': 'weight0', 'dtype': 'float32', 'shape': [2] },
+ { 'name': 'weight1', 'dtype': 'float32', 'shape': [3] }
+ ]
+ },
+ {
+ 'paths': ['weightfile1'],
+ 'weights': [
+ { 'name': 'weight2', 'dtype': 'float32', 'shape': [3, 1] },
+ { 'name': 'weight3', 'dtype': 'float32', 'shape': [] }
+ ]
+ }
+ ];
+ tf.io.loadWeights(manifest, './', ['weight0', 'weight2'])
+ .then(function (weights) {
+ expect(window.fetch.calls.count()).toBe(2);
+ var weightNames = Object.keys(weights);
+ expect(weightNames.length).toEqual(2);
+ var weight0 = weights['weight0'];
+ test_util_1.expectArraysClose(weight0, [1, 2]);
+ expect(weight0.shape).toEqual([2]);
+ expect(weight0.dtype).toEqual('float32');
+ var weight2 = weights['weight2'];
+ test_util_1.expectArraysClose(weight2, [6, 7, 8]);
+ expect(weight2.shape).toEqual([3, 1]);
+ expect(weight2.dtype).toEqual('float32');
+ })
+ .then(done)
+ .catch(done.fail);
+ });
+ it('2 group, 4 weights, dont specify weights fetchs all', function (done) {
+ setupFakeWeightFiles({
+ './weightfile0': new Float32Array([1, 2, 3, 4, 5]),
+ './weightfile1': new Float32Array([6, 7, 8, 9])
+ });
+ var manifest = [
+ {
+ 'paths': ['weightfile0'],
+ 'weights': [
+ { 'name': 'weight0', 'dtype': 'float32', 'shape': [2] },
+ { 'name': 'weight1', 'dtype': 'float32', 'shape': [3] }
+ ]
+ },
+ {
+ 'paths': ['weightfile1'],
+ 'weights': [
+ { 'name': 'weight2', 'dtype': 'float32', 'shape': [3, 1] },
+ { 'name': 'weight3', 'dtype': 'float32', 'shape': [] }
+ ]
+ }
+ ];
+ tf.io.loadWeights(manifest, './')
+ .then(function (weights) {
+ expect(window.fetch.calls.count()).toBe(2);
+ var weightNames = Object.keys(weights);
+ expect(weightNames.length).toEqual(4);
+ var weight0 = weights['weight0'];
+ test_util_1.expectArraysClose(weight0, [1, 2]);
+ expect(weight0.shape).toEqual([2]);
+ expect(weight0.dtype).toEqual('float32');
+ var weight1 = weights['weight1'];
+ test_util_1.expectArraysClose(weight1, [3, 4, 5]);
+ expect(weight1.shape).toEqual([3]);
+ expect(weight1.dtype).toEqual('float32');
+ var weight2 = weights['weight2'];
+ test_util_1.expectArraysClose(weight2, [6, 7, 8]);
+ expect(weight2.shape).toEqual([3, 1]);
+ expect(weight2.dtype).toEqual('float32');
+ var weight3 = weights['weight3'];
+ test_util_1.expectArraysClose(weight3, [9]);
+ expect(weight3.shape).toEqual([]);
+ expect(weight3.dtype).toEqual('float32');
+ })
+ .then(done)
+ .catch(done.fail);
+ });
+ it('throws if requested weight not found', function (done) { return __awaiter(_this, void 0, void 0, function () {
+ var manifest, weightsNamesToFetch, e_1;
+ return __generator(this, function (_a) {
+ switch (_a.label) {
+ case 0:
+ setupFakeWeightFiles({ './weightfile0': new Float32Array([1, 2, 3]) });
+ manifest = [{
+ 'paths': ['weightfile0'],
+ 'weights': [{ 'name': 'weight0', 'dtype': 'float32', 'shape': [3] }]
+ }];
+ weightsNamesToFetch = ['doesntexist'];
+ _a.label = 1;
+ case 1:
+ _a.trys.push([1, 3, , 4]);
+ return [4, tf.io.loadWeights(manifest, './', weightsNamesToFetch)];
+ case 2:
+ _a.sent();
+ done.fail();
+ return [3, 4];
+ case 3:
+ e_1 = _a.sent();
+ done();
+ return [3, 4];
+ case 4: return [2];
+ }
+ });
+ }); });
+ it('throws if requested weight has unknown dtype', function (done) { return __awaiter(_this, void 0, void 0, function () {
+ var manifest, weightsNamesToFetch, e_2;
+ return __generator(this, function (_a) {
+ switch (_a.label) {
+ case 0:
+ setupFakeWeightFiles({ './weightfile0': new Float32Array([1, 2, 3]) });
+ manifest = [{
+ 'paths': ['weightfile0'],
+ 'weights': [{
+ 'name': 'weight0',
+ 'dtype': 'null',
+ 'shape': [3]
+ }]
+ }];
+ weightsNamesToFetch = ['weight0'];
+ _a.label = 1;
+ case 1:
+ _a.trys.push([1, 3, , 4]);
+ return [4, tf.io.loadWeights(manifest, './', weightsNamesToFetch)];
+ case 2:
+ _a.sent();
+ done.fail();
+ return [3, 4];
+ case 3:
+ e_2 = _a.sent();
+ done();
+ return [3, 4];
+ case 4: return [2];
+ }
+ });
+ }); });
+ it('should use request option', function (done) {
+ setupFakeWeightFiles({ './weightfile0': new Float32Array([1, 2, 3]) });
+ var manifest = [{
+ 'paths': ['weightfile0'],
+ 'weights': [{ 'name': 'weight0', 'dtype': 'float32', 'shape': [3] }]
+ }];
+ var weightsNamesToFetch = ['weight0'];
+ tf.io
+ .loadWeights(manifest, './', weightsNamesToFetch, { credentials: 'include' })
+ .then(function (weights) {
+ expect(window.fetch.calls.count()).toBe(1);
+ expect(window.fetch).toHaveBeenCalledWith('./weightfile0', {
+ credentials: 'include'
+ });
+ })
+ .then(done)
+ .catch(done.fail);
+ });
+ var quantizationTest = function (quantizationDtype, done) {
+ var arrayType = quantizationDtype === 'uint8' ? Uint8Array : Uint16Array;
+ setupFakeWeightFiles({ './weightfile0': new arrayType([0, 48, 255, 0, 48, 255]) });
+ var manifest = [{
+ 'paths': ['weightfile0'],
+ 'weights': [
+ {
+ 'name': 'weight0',
+ 'dtype': 'float32',
+ 'shape': [3],
+ 'quantization': { 'min': -1, 'scale': 0.1, 'dtype': quantizationDtype }
+ },
+ {
+ 'name': 'weight1',
+ 'dtype': 'int32',
+ 'shape': [3],
+ 'quantization': { 'min': -1, 'scale': 0.1, 'dtype': quantizationDtype }
+ }
+ ]
+ }];
+ var weightsNamesToFetch = ['weight0', 'weight1'];
+ tf.io.loadWeights(manifest, './', weightsNamesToFetch)
+ .then(function (weights) {
+ expect(window.fetch.calls.count()).toBe(1);
+ var weightNames = Object.keys(weights);
+ expect(weightNames.length).toEqual(weightsNamesToFetch.length);
+ var weight0 = weights['weight0'];
+ test_util_1.expectArraysClose(weight0, [-1, 3.8, 24.5]);
+ expect(weight0.shape).toEqual([3]);
+ expect(weight0.dtype).toEqual('float32');
+ var weight1 = weights['weight1'];
+ test_util_1.expectArraysEqual(weight1, [-1, 4, 25]);
+ expect(weight1.shape).toEqual([3]);
+ expect(weight1.dtype).toEqual('int32');
+ })
+ .then(done)
+ .catch(done.fail);
+ };
+ it('quantized weights (uint8)', function (done) {
+ quantizationTest('uint8', done);
+ });
+ it('quantized weights (uint16)', function (done) {
+ quantizationTest('uint16', done);
+ });
+ it('2 groups, 1 quantized, 1 unquantized', function (done) {
+ setupFakeWeightFiles({
+ './weightfile0': new Uint8Array([0, 48, 255, 0, 48, 255]),
+ './weightfile1': new Float32Array([6, 7, 8, 9])
+ });
+ var manifest = [
+ {
+ 'paths': ['weightfile0'],
+ 'weights': [
+ {
+ 'name': 'weight0',
+ 'dtype': 'float32',
+ 'shape': [3],
+ 'quantization': { 'min': -1, 'scale': 0.1, 'dtype': 'uint8' }
+ },
+ {
+ 'name': 'weight1',
+ 'dtype': 'int32',
+ 'shape': [3],
+ 'quantization': { 'min': -1, 'scale': 0.1, 'dtype': 'uint8' }
+ }
+ ]
+ },
+ {
+ 'paths': ['weightfile1'],
+ 'weights': [
+ { 'name': 'weight2', 'dtype': 'float32', 'shape': [3, 1] },
+ { 'name': 'weight3', 'dtype': 'float32', 'shape': [] }
+ ]
+ }
+ ];
+ tf.io.loadWeights(manifest, './', ['weight0', 'weight2'])
+ .then(function (weights) {
+ expect(window.fetch.calls.count()).toBe(2);
+ var weightNames = Object.keys(weights);
+ expect(weightNames.length).toEqual(2);
+ var weight0 = weights['weight0'];
+ test_util_1.expectArraysClose(weight0, [-1, 3.8, 24.5]);
+ expect(weight0.shape).toEqual([3]);
+ expect(weight0.dtype).toEqual('float32');
+ var weight2 = weights['weight2'];
+ test_util_1.expectArraysClose(weight2, [6, 7, 8]);
+ expect(weight2.shape).toEqual([3, 1]);
+ expect(weight2.dtype).toEqual('float32');
+ })
+ .then(done)
+ .catch(done.fail);
+ });
+});
+//# sourceMappingURL=weights_loader_test.js.map
\ No newline at end of file
diff --git a/node_modules/@tensorflow/tfjs-core/dist/io/weights_loader_test.js.map b/node_modules/@tensorflow/tfjs-core/dist/io/weights_loader_test.js.map
new file mode 100644
index 0000000..4487850
--- /dev/null
+++ b/node_modules/@tensorflow/tfjs-core/dist/io/weights_loader_test.js.map
@@ -0,0 +1 @@
+{"version":3,"file":"weights_loader_test.js","sourceRoot":"","sources":["../../src/io/weights_loader_test.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAgBA,iBA8jBA;;AA9jBA,6BAA+B;AAC/B,gDAAkD;AAClD,0CAAgF;AAGhF,gCAAiB,CAAC,aAAa,EAAE,wBAAY,EAAE;IAC7C,IAAM,oBAAoB,GAAG,UAAC,aAG7B;QACC,KAAK,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC,GAAG,CAAC,QAAQ,CAAC,UAAC,IAAY;YAC/C,OAAO,IAAI,QAAQ,CAAC,aAAa,CAAC,IAAI,CAAC,CAAC,CAAC;QAC3C,CAAC,CAAC,CAAC;IACL,CAAC,CAAC;IAEF,EAAE,CAAC,uCAAuC,EAAE,UAAA,IAAI;QAC9C,oBAAoB,CAAC,EAAC,eAAe,EAAE,IAAI,YAAY,CAAC,CAAC,CAAC,EAAE,CAAC,EAAE,CAAC,CAAC,CAAC,EAAC,CAAC,CAAC;QAErE,IAAM,QAAQ,GAA0B,CAAC;gBACvC,OAAO,EAAE,CAAC,aAAa,CAAC;gBACxB,SAAS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C,EAAE,CAAC,CAAC,CAAC,CAAC;YACtC,MAAM,CAAC,OAAO,CAAC,KAAK,CAAC,CAAC,OAAO,CAAC,SAAS,CAAC,CAAC;QAC3C,CAAC,CAAC;aACD,IAAI,CAAC,IAAI,CAAC;aACV,KAAK,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;IACxB,CAAC,CAAC,CAAC;AACL,CAAC,CAAC,CAAC"}
\ No newline at end of file
diff --git a/node_modules/@tensorflow/tfjs-core/dist/jasmine_util.d.ts b/node_modules/@tensorflow/tfjs-core/dist/jasmine_util.d.ts
new file mode 100644
index 0000000..ecb6501
--- /dev/null
+++ b/node_modules/@tensorflow/tfjs-core/dist/jasmine_util.d.ts
@@ -0,0 +1,14 @@
+import { Features } from './environment_util';
+import { KernelBackend } from './kernels/backend';
+import { MathBackendCPU } from './kernels/backend_cpu';
+export declare function envSatisfiesConstraints(constraints: Features): boolean;
+export declare function parseKarmaFlags(args: string[]): TestEnv;
+export declare function describeWithFlags(name: string, constraints: Features, tests: () => void): void;
+export interface TestEnv {
+ name: string;
+ factory: () => KernelBackend;
+ features: Features;
+}
+export declare let TEST_ENVS: TestEnv[];
+export declare const CPU_FACTORY: () => MathBackendCPU;
+export declare function setTestEnvs(testEnvs: TestEnv[]): void;
diff --git a/node_modules/@tensorflow/tfjs-core/dist/jasmine_util.js b/node_modules/@tensorflow/tfjs-core/dist/jasmine_util.js
new file mode 100644
index 0000000..1642252
--- /dev/null
+++ b/node_modules/@tensorflow/tfjs-core/dist/jasmine_util.js
@@ -0,0 +1,112 @@
+"use strict";
+Object.defineProperty(exports, "__esModule", { value: true });
+var environment_1 = require("./environment");
+var backend_cpu_1 = require("./kernels/backend_cpu");
+var backend_webgl_1 = require("./kernels/backend_webgl");
+Error.stackTraceLimit = Infinity;
+function envSatisfiesConstraints(constraints) {
+ for (var key in constraints) {
+ var value = constraints[key];
+ if (environment_1.ENV.get(key) !== value) {
+ return false;
+ }
+ }
+ return true;
+}
+exports.envSatisfiesConstraints = envSatisfiesConstraints;
+function parseKarmaFlags(args) {
+ var features;
+ var backend;
+ var name = '';
+ args.forEach(function (arg, i) {
+ if (arg === '--features') {
+ features = JSON.parse(args[i + 1]);
+ }
+ else if (arg === '--backend') {
+ var type = args[i + 1];
+ name = type;
+ if (type.toLowerCase() === 'cpu') {
+ backend = function () { return new backend_cpu_1.MathBackendCPU(); };
+ }
+ else if (type.toLowerCase() === 'webgl') {
+ backend = function () { return new backend_webgl_1.MathBackendWebGL(); };
+ }
+ else {
+ throw new Error("Unknown value " + type + " for flag --backend. " +
+ "Allowed values are 'cpu' or 'webgl'.");
+ }
+ }
+ });
+ if (features == null && backend == null) {
+ return null;
+ }
+ if (features != null && backend == null) {
+ throw new Error('--backend flag is required when --features is present. ' +
+ 'Available values are "webgl" or "cpu".');
+ }
+ return { features: features || {}, factory: backend, name: name };
+}
+exports.parseKarmaFlags = parseKarmaFlags;
+function describeWithFlags(name, constraints, tests) {
+ exports.TEST_ENVS.forEach(function (testEnv) {
+ environment_1.ENV.setFeatures(testEnv.features);
+ if (envSatisfiesConstraints(constraints)) {
+ var testName = name + ' ' + testEnv.name + ' ' + JSON.stringify(testEnv.features);
+ executeTests(testName, tests, testEnv);
+ }
+ });
+}
+exports.describeWithFlags = describeWithFlags;
+exports.TEST_ENVS = [
+ {
+ name: 'test-webgl1',
+ factory: function () { return new backend_webgl_1.MathBackendWebGL(); },
+ features: { 'WEBGL_VERSION': 1 }
+ },
+ {
+ name: 'test-webgl2',
+ factory: function () { return new backend_webgl_1.MathBackendWebGL(); },
+ features: { 'WEBGL_VERSION': 2 }
+ },
+ {
+ name: 'test-cpu',
+ factory: function () { return new backend_cpu_1.MathBackendCPU(); },
+ features: { 'HAS_WEBGL': false }
+ }
+];
+exports.CPU_FACTORY = function () { return new backend_cpu_1.MathBackendCPU(); };
+if (typeof __karma__ !== 'undefined') {
+ var testEnv = parseKarmaFlags(__karma__.config.args);
+ if (testEnv) {
+ setTestEnvs([testEnv]);
+ }
+}
+function setTestEnvs(testEnvs) {
+ exports.TEST_ENVS = testEnvs;
+}
+exports.setTestEnvs = setTestEnvs;
+function executeTests(testName, tests, testEnv) {
+ describe(testName, function () {
+ var backendName = 'test-' + testEnv.name;
+ beforeAll(function () {
+ environment_1.ENV.reset();
+ environment_1.ENV.setFeatures(testEnv.features);
+ environment_1.ENV.set('IS_TEST', true);
+ environment_1.ENV.registerBackend(backendName, testEnv.factory, 1000);
+ environment_1.Environment.setBackend(backendName);
+ });
+ beforeEach(function () {
+ environment_1.ENV.engine.startScope();
+ });
+ afterEach(function () {
+ environment_1.ENV.engine.endScope();
+ environment_1.Environment.disposeVariables();
+ });
+ afterAll(function () {
+ environment_1.ENV.removeBackend(backendName);
+ environment_1.ENV.reset();
+ });
+ tests();
+ });
+}
+//# sourceMappingURL=jasmine_util.js.map
\ No newline at end of file
diff --git a/node_modules/@tensorflow/tfjs-core/dist/jasmine_util.js.map b/node_modules/@tensorflow/tfjs-core/dist/jasmine_util.js.map
new file mode 100644
index 0000000..83f7141
--- /dev/null
+++ b/node_modules/@tensorflow/tfjs-core/dist/jasmine_util.js.map
@@ -0,0 +1 @@
+{"version":3,"file":"jasmine_util.js","sourceRoot":"","sources":["../src/jasmine_util.ts"],"names":[],"mappings":";;AAiBA,6CAA+C;AAG/C,qDAAqD;AACrD,yDAAyD;AAEzD,KAAK,CAAC,eAAe,GAAG,QAAQ,CAAC;AAGjC,iCAAwC,WAAqB;IAC3D,KAAK,IAAM,GAAG,IAAI,WAAW,EAAE;QAC7B,IAAM,KAAK,GAAG,WAAW,CAAC,GAAqB,CAAC,CAAC;QACjD,IAAI,iBAAG,CAAC,GAAG,CAAC,GAAqB,CAAC,KAAK,KAAK,EAAE;YAC5C,OAAO,KAAK,CAAC;SACd;KACF;IACD,OAAO,IAAI,CAAC;AACd,CAAC;AARD,0DAQC;AAKD,yBAAgC,IAAc;IAC5C,IAAI,QAAkB,CAAC;IACvB,IAAI,OAA4B,CAAC;IACjC,IAAI,IAAI,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AAG,OAAO,GAAG,OAAO,CAAC,IAAI,CAAC;QAE3C,SAAS,CAAC;YACR,iBAAG,CAAC,KAAK,EAAE,CAAC;YACZ,iBAAG,CAAC,WAAW,CAAC,OAAO,CAAC,QAAQ,CAAC,CAAC;YAClC,iBAAG,CAAC,GAAG,CAAC,SAAS,EAAE,IAAI,CAAC,CAAC;YACzB,iBAAG,CAAC,eAAe,CAAC,WAAW,EAAE,OAAO,CAAC,OAAO,EAAE,IAAI,CAAC,CAAC;YACxD,yBAAW,CAAC,UAAU,CAAC,WAAW,CAAC,CAAC;QACtC,CAAC,CAAC,CAAC;QAEH,UAAU,CAAC;YACT,iBAAG,CAAC,MAAM,CAAC,UAAU,EAAE,CAAC;QAC1B,CAAC,CAAC,CAAC;QAEH,SAAS,CAAC;YACR,iBAAG,CAAC,MAAM,CAAC,QAAQ,EAAE,CAAC;YACtB,yBAAW,CAAC,gBAAgB,EAAE,CAAC;QACjC,CAAC,CAAC,CAAC;QAEH,QAAQ,CAAC;YACP,iBAAG,CAAC,aAAa,CAAC,WAAW,CAAC,CAAC;YAC/B,iBAAG,CAAC,KAAK,EAAE,CAAC;QACd,CAAC,CAAC,CAAC;QAEH,KAAK,EAAE,CAAC;IACV,CAAC,CAAC,CAAC;AACL,CAAC"}
\ No newline at end of file
diff --git a/node_modules/@tensorflow/tfjs-core/dist/jasmine_util_test.d.ts b/node_modules/@tensorflow/tfjs-core/dist/jasmine_util_test.d.ts
new file mode 100644
index 0000000..cb0ff5c
--- /dev/null
+++ b/node_modules/@tensorflow/tfjs-core/dist/jasmine_util_test.d.ts
@@ -0,0 +1 @@
+export {};
diff --git a/node_modules/@tensorflow/tfjs-core/dist/jasmine_util_test.js b/node_modules/@tensorflow/tfjs-core/dist/jasmine_util_test.js
new file mode 100644
index 0000000..1fe5341
--- /dev/null
+++ b/node_modules/@tensorflow/tfjs-core/dist/jasmine_util_test.js
@@ -0,0 +1,61 @@
+"use strict";
+Object.defineProperty(exports, "__esModule", { value: true });
+var tf = require("./index");
+var jasmine_util_1 = require("./jasmine_util");
+var backend_cpu_1 = require("./kernels/backend_cpu");
+var backend_webgl_1 = require("./kernels/backend_webgl");
+var test_util_1 = require("./test_util");
+describe('jasmine_util.envSatisfiesConstraints', function () {
+ it('ENV satisfies empty constraints', function () {
+ expect(jasmine_util_1.envSatisfiesConstraints({})).toBe(true);
+ });
+ it('ENV satisfies matching constraints', function () {
+ var c = { TEST_EPSILON: tf.ENV.get('TEST_EPSILON') };
+ expect(jasmine_util_1.envSatisfiesConstraints(c)).toBe(true);
+ });
+ it('ENV does not satisfy mismatching constraints', function () {
+ var c = { TEST_EPSILON: tf.ENV.get('TEST_EPSILON') + 0.1 };
+ expect(jasmine_util_1.envSatisfiesConstraints(c)).toBe(false);
+ });
+});
+describe('jasmine_util.parseKarmaFlags', function () {
+ it('parse empty args', function () {
+ var res = jasmine_util_1.parseKarmaFlags([]);
+ expect(res).toBeNull();
+ });
+ it('--backend cpu', function () {
+ var res = jasmine_util_1.parseKarmaFlags(['--backend', 'cpu']);
+ expect(res.name).toBe('cpu');
+ expect(res.features).toEqual({});
+ expect(res.factory() instanceof backend_cpu_1.MathBackendCPU).toBe(true);
+ });
+ it('--backend cpu --features {"IS_NODE": true}', function () {
+ var res = jasmine_util_1.parseKarmaFlags(['--backend', 'cpu', '--features', '{"IS_NODE": true}']);
+ expect(res.name).toBe('cpu');
+ expect(res.features).toEqual({ IS_NODE: true });
+ expect(res.factory() instanceof backend_cpu_1.MathBackendCPU).toBe(true);
+ });
+ it('"--backend unknown" throws error', function () {
+ expect(function () { return jasmine_util_1.parseKarmaFlags(['--backend', 'unknown']); }).toThrowError();
+ });
+ it('"--features {}" throws error since --backend is missing', function () {
+ expect(function () { return jasmine_util_1.parseKarmaFlags(['--features', '{}']); }).toThrowError();
+ });
+ it('"--backend cpu --features" throws error since features value is missing', function () {
+ expect(function () { return jasmine_util_1.parseKarmaFlags(['--backend', 'cpu', '--features']); })
+ .toThrowError();
+ });
+ it('"--backend cpu --features notJson" throws error', function () {
+ expect(function () { return jasmine_util_1.parseKarmaFlags(['--backend', 'cpu', '--features', 'notJson']); })
+ .toThrowError();
+ });
+});
+jasmine_util_1.describeWithFlags('jasmine_util.envSatisfiesConstraints', test_util_1.WEBGL_ENVS, function () {
+ it('--backend webgl', function () {
+ var res = jasmine_util_1.parseKarmaFlags(['--backend', 'webgl']);
+ expect(res.name).toBe('webgl');
+ expect(res.features).toEqual({});
+ expect(res.factory() instanceof backend_webgl_1.MathBackendWebGL).toBe(true);
+ });
+});
+//# sourceMappingURL=jasmine_util_test.js.map
\ No newline at end of file
diff --git a/node_modules/@tensorflow/tfjs-core/dist/jasmine_util_test.js.map b/node_modules/@tensorflow/tfjs-core/dist/jasmine_util_test.js.map
new file mode 100644
index 0000000..97e2e82
--- /dev/null
+++ b/node_modules/@tensorflow/tfjs-core/dist/jasmine_util_test.js.map
@@ -0,0 +1 @@
+{"version":3,"file":"jasmine_util_test.js","sourceRoot":"","sources":["../src/jasmine_util_test.ts"],"names":[],"mappings":";;AAiBA,4BAA8B;AAC9B,+CAA2F;AAC3F,qDAAqD;AACrD,yDAAyD;AACzD,yCAAuC;AAEvC,QAAQ,CAAC,sCAAsC,EAAE;IAC/C,EAAE,CAAC,iCAAiC,EAAE;QACpC,MAAM,CAAC,sCAAuB,CAAC,EAAE,CAAC,CAAC,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;IACjD,CAAC,CAAC,CAAC;IAEH,EAAE,CAAC,oCAAoC,EAAE;QACvC,IAAM,CAAC,GAAG,EAAC,YAAY,EAAE,EAAE,CAAC,GAAG,CAAC,GAAG,CAAC,cAAc,CAAC,EAAC,CAAC;QACrD,MAAM,CAAC,sCAAuB,CAAC,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;IAChD,CAAC,CAAC,CAAC;IAEH,EAAE,CAAC,8CAA8C,EAAE;QACjD,IAAM,CAAC,GAAG,EAAC,YAAY,EAAE,EAAE,CAAC,G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AC,CAAC,CAAC"}
\ No newline at end of file
diff --git a/node_modules/@tensorflow/tfjs-core/dist/kernels/backend.d.ts b/node_modules/@tensorflow/tfjs-core/dist/kernels/backend.d.ts
new file mode 100644
index 0000000..86bd06e
--- /dev/null
+++ b/node_modules/@tensorflow/tfjs-core/dist/kernels/backend.d.ts
@@ -0,0 +1,125 @@
+import { Conv2DInfo } from '../ops/conv_util';
+import { DataId, Tensor, Tensor1D, Tensor2D, Tensor3D, Tensor4D } from '../tensor';
+import { DataType, Rank, ShapeMap, TypedArray } from '../types';
+export interface BackendTimingInfo {
+ kernelMs: number;
+}
+export interface TensorStorage {
+ read(dataId: DataId): Promise;
+ readSync(dataId: DataId): TypedArray;
+ disposeData(dataId: DataId): void;
+ write(dataId: DataId, values: TypedArray): void;
+ fromPixels(pixels: ImageData | HTMLImageElement | HTMLCanvasElement | HTMLVideoElement, numChannels: number): Tensor3D;
+ register(dataId: DataId, shape: number[], dtype: DataType): void;
+ memory(): {
+ unreliable: boolean;
+ };
+}
+export interface BackendTimer {
+ time(f: () => void): Promise;
+}
+export interface KernelBackend extends TensorStorage, BackendTimer {
+ matMul(a: Tensor2D, b: Tensor2D, transposeA: boolean, transposeB: boolean): Tensor2D;
+ slice(x: T, begin: number[], size: number[]): T;
+ stridedSlice(x: T, begin: number[], end: number[], strides: number[], beginMask: number, endMask: number): T;
+ reverse(a: T, axis: number[]): T;
+ concat(a: Tensor2D, b: Tensor2D): Tensor2D;
+ neg(a: T): T;
+ add(a: Tensor, b: Tensor): Tensor;
+ addN(tensors: T[]): T;
+ subtract(a: Tensor, b: Tensor): Tensor;
+ multiply(a: Tensor, b: Tensor): Tensor;
+ realDivide(a: Tensor, b: Tensor): Tensor;
+ floorDiv(a: Tensor, b: Tensor): Tensor;
+ sum(x: Tensor, axes: number[]): Tensor;
+ unsortedSegmentSum(x: T, segmentIds: Tensor1D, numSegments: number): Tensor;
+ argMin(x: Tensor, axis: number): Tensor;
+ argMax(x: Tensor, axis: number): Tensor;
+ equal(a: Tensor, b: Tensor): Tensor;
+ notEqual(a: Tensor, b: Tensor): Tensor;
+ less(a: Tensor, b: Tensor): Tensor;
+ lessEqual(a: Tensor, b: Tensor): Tensor;
+ greater(a: Tensor, b: Tensor): Tensor;
+ greaterEqual(a: Tensor, b: Tensor): Tensor;
+ logicalNot(a: T): T;
+ logicalAnd(a: Tensor, b: Tensor): Tensor;
+ logicalOr(a: Tensor, b: Tensor): Tensor;
+ where(condition: Tensor): Tensor2D;
+ select(condition: Tensor, a: Tensor, b: Tensor): Tensor;
+ topk(x: T, k: number, sorted: boolean): [T, T];
+ min(x: Tensor, axes: number[]): Tensor;
+ minimum(a: Tensor, b: Tensor): Tensor;
+ mod(a: Tensor, b: Tensor): Tensor;
+ max(x: Tensor, axes: number[]): Tensor;
+ maximum(a: Tensor, b: Tensor): Tensor;
+ all(x: Tensor, axes: number[]): Tensor;
+ any(x: Tensor, axes: number[]): Tensor;
+ squaredDifference(a: Tensor, b: Tensor): Tensor;
+ ceil(x: T): T;
+ floor(x: T): T;
+ round(x: T): T;
+ sign(x: T): T;
+ pow(a: T, b: Tensor): T;
+ exp(x: T): T;
+ expm1(x: T): T;
+ log(x: T): T;
+ log1p(x: T): T;
+ sqrt(x: T): T;
+ rsqrt(x: T): T;
+ square(x: T): T;
+ reciprocal(x: T): T;
+ relu(x: T): T;
+ elu(x: T): T;
+ eluDer(dy: T, y: T): T;
+ selu(x: T): T;
+ int(x: T): T;
+ clip(x: T, min: number, max: number): T;
+ abs(x: T): T;
+ sigmoid(x: T): T;
+ softplus(x: T): T;
+ sin(x: T): T;
+ cos(x: T): T;
+ tan(x: T): T;
+ asin(x: T): T;
+ acos(x: T): T;
+ atan(x: T): T;
+ atan2(a: T, b: T): T;
+ sinh(x: T): T;
+ cosh(x: T): T;
+ tanh(x: T): T;
+ asinh(x: T): T;
+ acosh(x: T): T;
+ atanh(x: T): T;
+ erf(x: T): T;
+ step(x: T, alpha: number): T;
+ conv2d(x: Tensor4D, filter: Tensor4D, convInfo: Conv2DInfo): Tensor4D;
+ conv2dDerInput(dy: Tensor4D, filter: Tensor4D, convInfo: Conv2DInfo): Tensor4D;
+ conv2dDerFilter(x: Tensor4D, dY: Tensor4D, convInfo: Conv2DInfo): Tensor4D;
+ depthwiseConv2D(input: Tensor4D, filter: Tensor4D, convInfo: Conv2DInfo): Tensor4D;
+ depthwiseConv2DDerInput(dy: Tensor4D, filter: Tensor4D, convInfo: Conv2DInfo): Tensor4D;
+ depthwiseConv2DDerFilter(x: Tensor4D, dY: Tensor4D, convInfo: Conv2DInfo): Tensor4D;
+ maxPool(x: Tensor4D, convInfo: Conv2DInfo): Tensor4D;
+ maxPoolBackprop(dy: Tensor4D, x: Tensor4D, y: Tensor4D, convInfo: Conv2DInfo): Tensor4D;
+ avgPool(x: Tensor4D, convInfo: Conv2DInfo): Tensor4D;
+ avgPoolBackprop(dy: Tensor4D, x: Tensor4D, convInfo: Conv2DInfo): Tensor4D;
+ reshape(x: T, shape: ShapeMap[R]): Tensor;
+ cast