UNPKG

ml5

Version:

A friendly machine learning library for the web.

401 lines (400 loc) 6.57 MB
(function webpackUniversalModuleDefinition(root, factory) { if(typeof exports === 'object' && typeof module === 'object') module.exports = factory(); else if(typeof define === 'function' && define.amd) define([], factory); else if(typeof exports === 'object') exports["ml5"] = factory(); else root["ml5"] = factory(); })(window, function() { return /******/ (function(modules) { // webpackBootstrap /******/ // The module cache /******/ var installedModules = {}; /******/ /******/ // The require function /******/ function __webpack_require__(moduleId) { /******/ /******/ // Check if module is in cache /******/ if(installedModules[moduleId]) { /******/ return installedModules[moduleId].exports; /******/ } /******/ // Create a new module (and put it into the cache) /******/ var module = installedModules[moduleId] = { /******/ i: moduleId, /******/ l: false, /******/ exports: {} /******/ }; /******/ /******/ // Execute the module function /******/ modules[moduleId].call(module.exports, module, module.exports, __webpack_require__); /******/ /******/ // Flag the module as loaded /******/ module.l = true; /******/ /******/ // Return the exports of the module /******/ return module.exports; /******/ } /******/ /******/ /******/ // expose the modules object (__webpack_modules__) /******/ __webpack_require__.m = modules; /******/ /******/ // expose the module cache /******/ __webpack_require__.c = installedModules; /******/ /******/ // define getter function for harmony exports /******/ __webpack_require__.d = function(exports, name, getter) { /******/ if(!__webpack_require__.o(exports, name)) { /******/ Object.defineProperty(exports, name, { /******/ configurable: false, /******/ enumerable: true, /******/ get: getter /******/ }); /******/ } /******/ }; /******/ /******/ // define __esModule on exports /******/ __webpack_require__.r = function(exports) { /******/ Object.defineProperty(exports, '__esModule', { value: true }); /******/ }; /******/ /******/ // getDefaultExport function for compatibility with non-harmony modules /******/ __webpack_require__.n = function(module) { /******/ var getter = module && module.__esModule ? /******/ function getDefault() { return module['default']; } : /******/ function getModuleExports() { return module; }; /******/ __webpack_require__.d(getter, 'a', getter); /******/ return getter; /******/ }; /******/ /******/ // Object.prototype.hasOwnProperty.call /******/ __webpack_require__.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); }; /******/ /******/ // __webpack_public_path__ /******/ __webpack_require__.p = "/"; /******/ /******/ /******/ // Load entry module and return exports /******/ return __webpack_require__(__webpack_require__.s = 581); /******/ }) /************************************************************************/ /******/ ([ /* 0 */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* WEBPACK VAR INJECTION */(function(global, process, Buffer, setImmediate) {/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "AdadeltaOptimizer", function() { return Yd; }); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "AdagradOptimizer", function() { return $d; }); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "AdamOptimizer", function() { return Qd; }); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "AdamaxOptimizer", function() { return Jd; }); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "Add", function() { return xr; }); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "AddN", function() { return br; }); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "BroadcastTo", function() { return Sr; }); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "DataStorage", function() { return ca; }); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "Div", function() { return wr; }); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ENV", function() { return s; }); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "Environment", function() { return o; }); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "FromPixels", function() { return Fr; }); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "FusedBatchNorm", function() { return Cr; }); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "Identity", function() { return Tr; }); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "KernelBackend", function() { return la; }); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "MaxPoolWithArgmax", function() { return _r; }); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "MomentumOptimizer", function() { return tp; }); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "NonMaxSuppressionV5", function() { return kr; }); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "OneHot", function() { return Ar; }); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "Optimizer", function() { return Xd; }); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "PadV2", function() { return Nr; }); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "RMSPropOptimizer", function() { return ep; }); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "Rank", function() { return Ct; }); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "Reduction", function() { return Nh; }); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "SGDOptimizer", function() { return Zd; }); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "Square", function() { return Rr; }); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "SquaredDifference", function() { return Er; }); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "Tensor", function() { return wt; }); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "TensorBuffer", function() { return mt; }); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "Tile", function() { return Dr; }); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "Transpose", function() { return Ir; }); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "Variable", function() { return St; }); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "abs", function() { return Lr; }); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "acos", function() { return Wr; }); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "acosh", function() { return Ur; }); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "add", function() { return Or; }); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "addN", function() { return $u; }); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "addStrict", function() { return xo; }); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "all", function() { return ql; }); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "any", function() { return Kl; }); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "argMax", function() { return jl; }); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "argMin", function() { return Xl; }); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "asin", function() { return Vr; }); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "asinh", function() { return zr; }); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "atan", function() { return Gr; }); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "atan2", function() { return bo; }); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "atanh", function() { return Hr; }); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "avgPool", function() { return Ol; }); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "avgPool3d", function() { return Pl; }); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "backend", function() { return hn; }); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "backend_util", function() { return Sa; }); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "basicLSTMCell", function() { return lh; }); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "batchNorm", function() { return nc; }); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "batchNorm2d", function() { return ac; }); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "batchNorm3d", function() { return uc; }); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "batchNorm4d", function() { return hc; }); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "batchNormalization", function() { return ec; }); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "batchNormalization2d", function() { return oc; }); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "batchNormalization3d", function() { return sc; }); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "batchNormalization4d", function() { return lc; }); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "batchToSpaceND", function() { return rr; }); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "booleanMaskAsync", function() { return ul; }); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "broadcastTo", function() { return fc; }); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "browser", function() { return Vd; }); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "buffer", function() { return er; }); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "cast", function() { return or; }); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ceil", function() { return qr; }); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "clipByValue", function() { return Kr; }); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "clone", function() { return dc; }); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "complex", function() { return Tn; }); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "concat", function() { return Yn; }); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "concat1d", function() { return $n; }); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "concat2d", function() { return Qn; }); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "concat3d", function() { return Jn; }); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "concat4d", function() { return Zn; }); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "conv1d", function() { return fl; }); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "conv2d", function() { return dl; }); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "conv2dTranspose", function() { return wl; }); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "conv3d", function() { return pl; }); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "conv3dTranspose", function() { return Cl; }); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "cos", function() { return jr; }); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "cosh", function() { return Xr; }); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "cumsum", function() { return ar; }); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "customGrad", function() { return oa; }); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "deprecationWarn", function() { return Xe; }); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "depthToSpace", function() { return ir; }); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "depthwiseConv2d", function() { return ml; }); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "diag", function() { return Eh; }); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "disableDeprecationWarnings", function() { return je; }); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "dispose", function() { return tn; }); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "disposeVariables", function() { return Ye; }); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "div", function() { return Bo; }); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "divNoNan", function() { return bc; }); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "divStrict", function() { return wo; }); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "dot", function() { return Rl; }); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "dropout", function() { return Rh; }); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "elu", function() { return nh; }); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "enableDebugMode", function() { return Ke; }); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "enableProdMode", function() { return qe; }); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "engine", function() { return $e; }); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "env", function() { return i; }); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "equal", function() { return Kc; }); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "equalStrict", function() { return jc; }); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "erf", function() { return Yr; }); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "exp", function() { return $r; }); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "expandDims", function() { return sr; }); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "expm1", function() { return Qr; }); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "eye", function() { return Cc; }); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "fft", function() { return gh; }); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "fill", function() { return Hn; }); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "findBackend", function() { return un; }); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "findBackendFactory", function() { return cn; }); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "floor", function() { return Jr; }); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "floorDiv", function() { return Co; }); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "frame", function() { return Ah; }); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "fused", function() { return hf; }); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "gather", function() { return il; }); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "gatherND", function() { return Ch; }); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "gather_util", function() { return Lo; }); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "getBackend", function() { return an; }); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "getGradient", function() { return h; }); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "getKernel", function() { return l; }); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "getKernelsForBackend", function() { return f; }); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "grad", function() { return Zo; }); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "grads", function() { return ta; }); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "greater", function() { return Xc; }); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "greaterEqual", function() { return Yc; }); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "greaterEqualStrict", function() { return $c; }); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "greaterStrict", function() { return Qc; }); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "hammingWindow", function() { return Sh; }); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "hannWindow", function() { return kh; }); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ifft", function() { return mh; }); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "imag", function() { return Nn; }); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "image", function() { return nf; }); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "inTopKAsync", function() { return Fh; }); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "io", function() { return Bd; }); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "irfft", function() { return xh; }); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "isFinite", function() { return lo; }); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "isInf", function() { return co; }); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "isNaN", function() { return uo; }); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "keep", function() { return en; }); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "leakyRelu", function() { return rh; }); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "less", function() { return Jc; }); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "lessEqual", function() { return Zc; }); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "lessEqualStrict", function() { return tl; }); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "lessStrict", function() { return el; }); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "linalg", function() { return jh; }); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "linspace", function() { return qn; }); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "localResponseNormalization", function() { return uh; }); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "log", function() { return Zr; }); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "log1p", function() { return to; }); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "logSigmoid", function() { return eo; }); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "logSoftmax", function() { return sa; }); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "logSumExp", function() { return Yl; }); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "logicalAnd", function() { return pc; }); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "logicalNot", function() { return vc; }); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "logicalOr", function() { return gc; }); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "logicalXor", function() { return mc; }); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "losses", function() { return zh; }); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "matMul", function() { return El; }); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "math", function() { return Wd; }); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "max", function() { return $l; }); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "maxPool", function() { return _l; }); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "maxPool3d", function() { return Bl; }); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "maxPoolWithArgmax", function() { return Ll; }); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "maximum", function() { return Eo; }); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "maximumStrict", function() { return Ro; }); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "mean", function() { return Ql; }); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "memory", function() { return Qe; }); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "min", function() { return Jl; }); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "minimum", function() { return Io; }); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "minimumStrict", function() { return ko; }); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "mod", function() { return So; }); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "modStrict", function() { return Ao; }); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "moments", function() { return Zl; }); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "movingAverage", function() { return fh; }); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "mul", function() { return To; }); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "mulStrict", function() { return Do; }); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "multiRNNCell", function() { return hh; }); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "multinomial", function() { return Ec; }); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "neg", function() { return no; }); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "nextFrame", function() { return ap; }); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "norm", function() { return ch; }); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "notEqual", function() { return nl; }); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "notEqualStrict", function() { return rl; }); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "oneHot", function() { return Rc; }); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ones", function() { return zn; }); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "onesLike", function() { return jn; }); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "op", function() { return An; }); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "outerProduct", function() { return Il; }); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "pad", function() { return Ic; }); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "pad1d", function() { return kc; }); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "pad2d", function() { return Sc; }); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "pad3d", function() { return Ac; }); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "pad4d", function() { return Tc; }); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "pool", function() { return Ml; }); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "pow", function() { return No; }); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "powStrict", function() { return Fo; }); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "prelu", function() { return oh; }); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "print", function() { return nr; }); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "prod", function() { return eh; }); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "profile", function() { return Je; }); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "rand", function() { return Dc; }); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "randomGamma", function() { return Uc; }); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "randomNormal", function() { return Vc; }); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "randomUniform", function() { return zc; }); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "range", function() { return Kn; }); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ready", function() { return on; }); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "real", function() { return Dn; }); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "reciprocal", function() { return ro; }); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "registerBackend", function() { return ln; }); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "registerGradient", function() { return p; }); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "registerKernel", function() { return d; }); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "relu", function() { return ah; }); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "relu6", function() { return ih; }); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "removeBackend", function() { return sn; }); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "reshape", function() { return ur; }); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "reverse", function() { return kl; }); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "reverse1d", function() { return Sl; }); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "reverse2d", function() { return Al; }); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "reverse3d", function() { return Tl; }); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "reverse4d", function() { return Dl; }); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "rfft", function() { return yh; }); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "round", function() { return oo; }); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "rsqrt", function() { return ao; }); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "scalar", function() { return On; }); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "scatterND", function() { return vh; }); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "scatter_util", function() { return Ho; }); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "selu", function() { return sh; }); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "separableConv2d", function() { return bl; }); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "serialization", function() { return qd; }); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "setBackend", function() { return rn; }); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "setPlatform", function() { return fn; }); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "setdiff1dAsync", function() { return dr; }); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "sigmoid", function() { return io; }); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "sign", function() { return so; }); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "signal", function() { return Dh; }); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "sin", function() { return ho; }); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "sinh", function() { return fo; }); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "slice", function() { return Wl; }); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "slice1d", function() { return Ul; }); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "slice2d", function() { return Vl; }); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "slice3d", function() { return zl; }); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "slice4d", function() { return Gl; }); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "slice_util", function() { return Jo; }); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "softmax", function() { return ia; }); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "softplus", function() { return po; }); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "spaceToBatchND", function() { return cr; }); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "sparseToDense", function() { return wh; }); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "spectral", function() { return bh; }); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "split", function() { return tr; }); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "sqrt", function() { return vo; }); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "square", function() { return Gc; }); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "squaredDifference", function() { return Hc; }); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "squaredDifferenceStrict", function() { return _o; }); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "squeeze", function() { return lr; }); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "stack", function() { return hr; }); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "step", function() { return go; }); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "stft", function() { return Th; }); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "stridedSlice", function() { return dh; }); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "sub", function() { return Oo; }); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "subStrict", function() { return Mo; }); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "sum", function() { return th; }); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "sumOutType", function() { return Dt; }); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "tan", function() { return mo; }); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "tanh", function() { return yo; }); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "tensor", function() { return Fn; }); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "tensor1d", function() { return Mn; }); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "tensor2d", function() { return Bn; }); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "tensor3d", function() { return Pn; }); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "tensor4d", function() { return Ln; }); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "tensor5d", function() { return Wn; }); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "tensor6d", function() { return Un; }); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "tensor_util", function() { return Mt; }); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "test_util", function() { return Bc; }); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "tidy", function() { return Ze; }); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "tile", function() { return wc; }); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "time", function() { return nn; }); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "topk", function() { return ph; }); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "train", function() { return rp; }); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "transpose", function() { return ua; }); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "truncatedNormal", function() { return qc; }); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "unregisterGradient", function() { return g; }); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "unregisterKernel", function() { return v; }); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "unsortedSegmentSum", function() { return sl; }); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "unstack", function() { return fr; }); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "util", function() { return st; }); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "valueAndGrad", function() { return ea; }); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "valueAndGrads", function() { return na; }); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "variable", function() { return Vn; }); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "variableGrads", function() { return ra; }); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "version_core", function() { return Kd; }); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "webgl", function() { return jd; }); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "where", function() { return yc; }); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "whereAsync", function() { return xc; }); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "zeros", function() { return Gn; }); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "zerosLike", function() { return Xn; }); /** * @license * Copyright 2020 Google LLC. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. * ============================================================================= */ var t=function(e,n){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n])})(e,n)};function e(e,n){function r(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}function n(t,e,n,r){return new(n||(n=Promise))((function(o,a){function i(t){try{u(r.next(t))}catch(t){a(t)}}function s(t){try{u(r.throw(t))}catch(t){a(t)}}function u(t){t.done?o(t.value):new n((function(e){e(t.value)})).then(i,s)}u((r=r.apply(t,e||[])).next())}))}function r(t,e){var n,r,o,a,i={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return a={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(a[Symbol.iterator]=function(){return this}),a;function s(a){return function(s){return function(a){if(n)throw new TypeError("Generator is already executing.");for(;i;)try{if(n=1,r&&(o=2&a[0]?r.return:a[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,a[1])).done)return o;switch(r=0,o&&(a=[2&a[0],o.value]),a[0]){case 0:case 1:o=a;break;case 4:return i.label++,{value:a[1],done:!1};case 5:i.label++,r=a[1],a=[0];continue;case 7:a=i.ops.pop(),i.trys.pop();continue;default:if(!(o=(o=i.trys).length>0&&o[o.length-1])&&(6===a[0]||2===a[0])){i=0;continue}if(3===a[0]&&(!o||a[1]>o[0]&&a[1]<o[3])){i.label=a[1];break}if(6===a[0]&&i.label<o[1]){i.label=o[1],o=a;break}if(o&&i.label<o[2]){i.label=o[2],i.ops.push(a);break}o[2]&&i.ops.pop(),i.trys.pop();continue}a=e.call(t,i)}catch(t){a=[6,t],r=0}finally{n=o=0}if(5&a[0])throw a[1];return{value:a[0]?a[1]:void 0,done:!0}}([a,s])}}}var o=function(){function t(t){this.global=t,this.flags={},this.flagRegistry={},this.urlFlags={},this.populateURLFlags()}return t.prototype.setPlatform=function(t,e){null!=this.platform&&console.warn("Platform "+this.platformName+" has already been set. Overwriting the platform with "+e+"."),this.platformName=t,this.platform=e},t.prototype.registerFlag=function(t,e,n){if(this.flagRegistry[t]={evaluationFn:e,setHook:n},null!=this.urlFlags[t]){var r=this.urlFlags[t];console.warn("Setting feature override from URL "+t+": "+r+"."),this.set(t,r)}},t.prototype.get=function(t){return t in this.flags?this.flags[t]:(this.flags[t]=this.evaluateFlag(t),this.flags[t])},t.prototype.getNumber=function(t){return this.get(t)},t.prototype.getBool=function(t){return this.get(t)},t.prototype.getFlags=function(){return this.flags},Object.defineProperty(t.prototype,"features",{get:function(){return this.flags},enumerable:!0,configurable:!0}),t.prototype.set=function(t,e){if(null==this.flagRegistry[t])throw new Error("Cannot set flag "+t+" as it has not been registered.");this.flags[t]=e,null!=this.flagRegistry[t].setHook&&this.flagRegistry[t].setHook(e)},t.prototype.evaluateFlag=function(t){if(null==this.flagRegistry[t])throw new Error("Cannot evaluate flag '"+t+"': no evaluation function found.");return this.flagRegistry[t].evaluationFn()},t.prototype.setFlags=function(t){this.flags=Object.assign({},t)},t.prototype.reset=function(){this.flags={},this.urlFlags={},this.populateURLFlags()},t.prototype.populateURLFlags=function(){var t=this;if(void 0!==this.global&&void 0!==this.global.location&&void 0!==this.global.location.search){var e,n,r=(e=this.global.location.search,n={},e.replace(/[?&]([^=?&]+)(?:=([^&]*))?/g,(function(t){for(var e=[],r=1;r<arguments.length;r++)e[r-1]=arguments[r];return a(n,e[0],e[1]),e.join("=")})),n);if("tfjsflags"in r)r.tfjsflags.split(",").forEach((function(e){var n=e.split(":"),r=n[0],o=n[1];t.urlFlags[r]=function(t,e){if("true"===(e=e.toLowerCase())||"false"===e)return"true"===e;if(""+ +e===e)return+e;throw new Error("Could not parse value flag value "+e+" for flag "+t+".")}(r,o)}))}},t}();function a(t,e,n){t[decodeURIComponent(e)]=decodeURIComponent(n||"")}function i(){return s}var s=null;var u=new Map,c=new Map;function l(t,e){var n=m(t,e);return u.get(n)}function h(t){return c.get(t)}function f(t){for(var e=u.entries(),n=[];;){var r=e.next(),o=r.done,a=r.value;if(o)break;var i=a[0],s=a[1];i.split("_")[0]===t&&n.push(s)}return n}function d(t){var e=t.kernelName,n=t.backendName,r=m(e,n);if(u.has(r))throw new Error("The kernel '"+e+"' for backend '"+n+"' is already registered");u.set(r,t)}function p(t){var e=t.kernelName;c.has(e)&&console.warn("Overriding the gradient for '"+e+"'"),c.set(e,t)}function v(t,e){var n=m(t,e);if(!u.has(n))throw new Error("The kernel '"+t+"' for backend '"+e+"' is not registered");u.delete(n)}function g(t){if(!c.has(t))throw new Error("The gradient '"+t+"' for backend is not registered");c.delete(t)}function m(t,e){return e+"_"+t}function y(t){for(var e=t.length,n=0,r=0;e>0;)r=Math.random()*e|0,n=t[--e],t[e]=t[r],t[r]=n}function x(t,e,n){return Math.max(t,Math.min(e,n))}function b(t){return t%2==0?t:t+1}function w(t){for(var e=0,n=0;n<t.length;n++)e+=t[n];return e}function C(t,e){if(!t)throw new Error("string"==typeof e?e:e())}function E(t,e,n){void 0===n&&(n=""),C(S(t,e),(function(){return n+" Shapes "+t+" and "+e+" must match"}))}function R(t){C(null!=t,(function(){return"The input to the tensor constructor must be a non-null value."}))}function I(t,e,n){if(void 0===e&&(e=[]),void 0===n&&(n=!1),null==e&&(e=[]),Array.isArray(t)||V(t)&&!n)for(var r=0;r<t.length;++r)I(t[r],e,n);else e.push(t);return e}function k(t){if(0===t.length)return 1;for(var e=t[0],n=1;n<t.length;n++)e*=t[n];return e}function S(t,e){if(t===e)return!0;if(null==t||null==e)return!1;if(t.length!==e.length)return!1;for(var n=0;n<t.length;n++)if(t[n]!==e[n])return!1;return!0}function A(t){return t%1==0}function T(t){if(null!=Math.tanh)return Math.tanh(t);if(t===1/0)return 1;if(t===-1/0)return-1;var e=Math.exp(2*t);return(e-1)/(e+1)}function D(t){var e=Math.ceil(Math.sqrt(t));return[e,Math.ceil(t/e)]}function N(t,e){return e<=t.length?t:t+" ".repeat(e-t.length)}function F(t,e,n){return void 0===e&&(e=function(t){return 0}),new Promise((function(r,o){var a=0,i=function(){if(t())r();else{a++;var s=e(a);null!=n&&a>=n?o():setTimeout(i,s)}};i()}))}function _(t,e){for(var n=1,r=-1,o=0;o<t.length;++o)if(t[o]>=0)n*=t[o];else if(-1===t[o]){if(-1!==r)throw Error("Shapes can only have 1 implicit size. Found -1 at dim "+r+" and dim "+o);r=o}else if(t[o]<0)throw Error("Shapes can not be < 0. Found "+t[o]+" at dim "+o);if(-1===r){if(e>0&&e!==n)throw Error("Size("+e+") must match the product of shape "+t);return t}if(0===n)throw Error("Cannot infer the missing size in ["+t+"] when there are 0 elements");if(e%n!=0)throw Error("The implicit shape can't be a fractional number. Got "+e+" / "+n);var a=t.slice();return a[r]=e/n,a}function O(t,e){var n=e.length;return C((t=null==t?e.map((function(t,e){return e})):[].concat(t)).every((function(t){return t>=-n&&t<n})),(function(){return"All values in axis param must be in range [-"+n+", "+n+") but got axis "+t})),C(t.every((function(t){return A(t)})),(function(){return"All values in axis param must be integers but got axis "+t})),t.map((function(t){return t<0?n+t:t}))}function M(t,e){for(var n=[],r=[],o=null!=e&&Array.isArray(e)&&0===e.length,a=null==e||o?null:O(e,t).sort(),i=0,s=0;s<t.length;++s){if(null!=a){if(a[i]===s&&1!==t[s])throw new Error("Can't squeeze axis "+s+" since its dim '"+t[s]+"' is not 1");(null==a[i]||a[i]>s)&&1===t[s]&&(n.push(t[s]),r.push(s)),a[i]<=s&&i++}1!==t[s]&&(n.push(t[s]),r.push(s))}return{newShape:n,keptDims:r}}function B(t,e){var n=null;if(null==t||"float32"===t)n=new Float32Array(e);else if("int32"===t)n=new Int32Array(e);else{if("bool"!==t)throw new Error("Unknown data type "+t);n=new Uint8Array(e)}return n}function P(t,e){var n=null;if(null==t||"float32"===t)n=new Float32Array(e);else if("int32"===t)n=new Int32Array(e);else if("bool"===t)n=new Uint8Array(e);else{if("string"!==t)throw new Error("Unknown data type "+t);n=new Array(e)}return n}function L(t,e){for(var n=0;n<t.length;n++){var r=t[n];if(isNaN(r)||!isFinite(r))throw Error("A tensor of type "+e+" being uploaded contains "+r+".")}}function W(t){return"bool"===t||"complex64"===t||"float32"===t||"int32"===t||"string"===t}function U(t,e){return"complex64"!==e&&(("float32"!==e||"complex64"===t)&&(("int32"!==e||"float32"===t||"complex64"===t)&&("bool"!==e||"bool"!==t)))}function V(t){return t instanceof Float32Array||t instanceof Int32Array||t instanceof Uint8Array}function z(t){if("float32"===t||"int32"===t)return 4;if("complex64"===t)return 8;if("bool"===t)return 1;throw new Error("Unknown dtype "+t)}function G(t){if(null==t)return 0;var e=0;return t.forEach((function(t){return e+=t.length})),e}function H(t){return"string"==typeof t||t instanceof String}function q(t){return"boolean"==typeof t}function K(t){return"number"==typeof t}function j(t){return Array.isArray(t)?j(t[0]):t instanceof Float32Array?"float32":t instanceof Int32Array||t instanceof Uint8Array?"int32":K(t)?"float32":H(t)?"string":q(t)?"bool":"float32"}function X(t){return!!(t&&t.constructor&&t.call&&t.apply)}function Y(t,e){for(var n=e;n<t;++n)if(t%n==0)return n;return t}function $(t){var e=t.length;if(e<2)return[];var n=new Array(e-1);n[e-2]=t[e-1];for(var r=e-3;r>=0;--r)n[r]=n[r+1]*t[r+1];return n}function Q(t,e,n){if("string"===e)throw new Error("Cannot convert a string[] to a TypedArray");if(Array.isArray(t)&&(t=I(t)),n&&L(t,e),function(t,e){return t instanceof Float32Array&&"float32"===e||t instanceof Int32Array&&"int32"===e||t instanceof Uint8Array&&"bool"===e}(t,e))return t;if(null==e||"float32"===e||"complex64"===e)return new Float32Array(t);if("int32"===e)return new Int32Array(t);if("bool"===e){for(var r=new Uint8Array(t.length),o=0;o<r.length;++o)0!==Math.round(t[o])&&(r[o]=1);return r}throw new Error("Unknown data type "+e)}function J(t,e){if(0===t.length)return e[0];var n=t.reduce((function(t,e){return t*e}));if(0===n)return[];if(n!==e.length)throw new Error("["+t+"] does not match the input size.");return function t(e,n,r){var o=new Array;if(1===n.length)for(var a=n[0],i=0;i<a;i++)o[i]=r[e+i];else{a=n[0];var s=n.slice(1),u=s.reduce((function(t,e){return t*e}));for(i=0;i<a;i++)o[i]=t(e+i*u,s,r)}return o}(0,t,e)}function Z(t,e){for(var n=tt(t,e),r=0;r<n.length;r++)n[r]=1;return n}function tt(t,e){if(null==e||"float32"===e||"complex64"===e)return new Float32Array(t);if("int32"===e)return new Int32Array(t);if("bool"===e)return new Uint8Array(t);throw new Error("Unknown data type "+e)}function et(){return i().platform.now()}function nt(t){t.forEach((function(e){C(Number.isInteger(e)&&e>=0,(function(){return"Tensor must have a shape comprised of positive integers but got shape ["+t+"]."}))}))}function rt(t,e){return void 0===e&&(e="utf-8"),e=e||"utf-8",i().platform.encode(t,e)}function ot(t,e){return void 0===e&&(e="utf-8"),e=e||"utf-8",i().platform.decode(t,e)}function at(t,e,n){if(0===e)return 0;if(1===e)return t[0];for(var r=t[t.length-1],o=0;o<t.length-1;++o)r+=n[o]*t[o];return r}function it(t,e,n){if(0===e)return[];if(1===e)return[t];for(var r=new Array(e),o=0;o<r.length-1;++o)r[o]=Math.floor(t/n[o]),t-=r[o]*n[o];return r[r.length-1]=t,r}var st=Object.freeze({shuffle:y,clamp:x,nearestLargerEven:b,sum:w,randUniform:function(t,e){var n=Math.random();return e*n+(1-n)*t},distSquared:function(t,e){for(var n=0,r=0;r<t.length;r++){var o=Number(t[r])-Number(e[r]);n+=o*o}return n},assert:C,assertShapesMatch:E,assertNonNull:R,flatten:I,sizeFromShape:k,isScalarShape:function(t){return 0===t.length},arraysEqual:S,isInt:A,tanh:T,sizeToSquarishShape:D,createShuffledIndices:function(t){for(var e=new Uint32Array(t),n=0;n<t;++n)e[n]=n;return y(e),e},rightPad:N,repeatedTry:F,inferFromImplicitShape:_,parseAxisParam:O,squeezeShape:M,getTypedArrayFromDType:B,getArrayFromDType:P,checkConversionForErrors:L,isValidDtype:W,hasEncodingLoss:U,isTypedArray:V,bytesPerElement:z,bytesFromStringArray:G,isString:H,isBoolean:q,isNumber:K,inferDtype:j,isFunction:X,nearestDivisor:Y,computeStrides:$,toTypedArray:Q,toNestedArray:J,makeOnesTypedArray:Z,makeZerosTypedArray:tt,now:et,assertNonNegativeIntegerDimensions:nt,fetch:function(t,e){return i().platform.fetch(t,e)},encodeString:rt,decodeString:ot,locToIndex:at,indexToLoc:it}),ut=function(){function t