ml5
Version:
A friendly machine learning library for the web.
363 lines (362 loc) • 5.6 MB
JavaScript
(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 = 968);
/******/ })
/************************************************************************/
/******/ ([
/* 0 */
/***/ (function(module, __webpack_exports__, __webpack_require__) {
"use strict";
__webpack_require__.r(__webpack_exports__);
/* WEBPACK VAR INJECTION */(function(process, global, Buffer, setImmediate) {/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "AdadeltaOptimizer", function() { return Vh; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "AdagradOptimizer", function() { return Gh; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "AdamOptimizer", function() { return qh; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "AdamaxOptimizer", function() { return Hh; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "DataStorage", function() { return Gr; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ENV", function() { return s; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "Environment", function() { return a; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "KernelBackend", function() { return qr; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "MomentumOptimizer", function() { return jh; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "Optimizer", function() { return zh; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "RMSPropOptimizer", function() { return Kh; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "Rank", function() { return ft; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "Reduction", function() { return Yl; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "SGDOptimizer", function() { return $h; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "Tensor", function() { return ht; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "TensorBuffer", function() { return st; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "Variable", function() { return pt; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "abs", function() { return rs; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "acos", function() { return os; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "acosh", function() { return as; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "add", function() { return Yu; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "addN", function() { return Qu; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "addStrict", function() { return Ju; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "all", function() { return Nu; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "any", function() { return ku; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "argMax", function() { return Au; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "argMin", function() { return Tu; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "asin", function() { return is; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "asinh", function() { return ss; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "atan", function() { return us; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "atan2", function() { return Zu; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "atanh", function() { return ls; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "avgPool", function() { return xu; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "backend", function() { return He; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "backend_util", function() { return so; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "basicLSTMCell", function() { return Ml; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "batchNorm", function() { return Ks; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "batchNorm2d", function() { return Xs; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "batchNorm3d", function() { return Ys; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "batchNorm4d", function() { return Qs; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "batchNormalization", function() { return js; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "batchNormalization2d", function() { return qs; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "batchNormalization3d", function() { return Hs; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "batchNormalization4d", function() { return $s; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "batchToSpaceND", function() { return Kn; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "browser", function() { return kh; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "buffer", function() { return $n; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "cast", function() { return Xn; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ceil", function() { return cs; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "clipByValue", function() { return hs; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "clone", function() { return Yn; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "complex", function() { return cn; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "concat", function() { return An; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "concat1d", function() { return Tn; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "concat2d", function() { return Dn; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "concat3d", function() { return _n; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "concat4d", function() { return On; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "conv1d", function() { return eu; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "conv2d", function() { return nu; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "conv2dDerFilter", function() { return ou; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "conv2dTranspose", function() { return su; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "conv3d", function() { return ru; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "cos", function() { return ps; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "cosh", function() { return fs; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "cumsum", function() { return Qn; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "customGrad", function() { return Wr; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "deprecationWarn", function() { return Te; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "depthToSpace", function() { return Jn; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "depthwiseConv2d", function() { return au; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "disableDeprecationWarnings", function() { return Ae; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "dispose", function() { return Me; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "disposeVariables", function() { return De; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "div", function() { return tl; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "divStrict", function() { return el; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "dot", function() { return lu; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "dropout", function() { return Kl; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "elu", function() { return El; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "enableDebugMode", function() { return ke; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "enableProdMode", function() { return Ne; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "environment", function() { return l; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "equal", function() { return Lu; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "equalStrict", function() { return Wu; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "erf", function() { return ds; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "exp", function() { return vs; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "expandDims", function() { return Zn; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "expm1", function() { return ms; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "eye", function() { return tr; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "fft", function() { return zl; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "fill", function() { return Rn; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "findBackend", function() { return Ve; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "findBackendFactory", function() { return Ge; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "floor", function() { return gs; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "floorDiv", function() { return nl; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "frame", function() { return Zl; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "fused", function() { return Ec; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "gather", function() { return Ol; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "gatherND", function() { return jl; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "getBackend", function() { return Ue; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "grad", function() { return Fr; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "grads", function() { return Mr; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "greater", function() { return Uu; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "greaterEqual", function() { return zu; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "greaterEqualStrict", function() { return Vu; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "greaterStrict", function() { return Gu; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "hammingWindow", function() { return Jl; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "hannWindow", function() { return Ql; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ifft", function() { return Vl; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "imag", function() { return pn; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "image", function() { return wc; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "io", function() { return Rh; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "irfft", function() { return ql; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "isFinite", function() { return As; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "isInf", function() { return ks; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "isNaN", function() { return Ns; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "keep", function() { return Be; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "leakyRelu", function() { return Rl; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "less", function() { return qu; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "lessEqual", function() { return Hu; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "lessEqualStrict", function() { return $u; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "lessStrict", function() { return ju; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "linalg", function() { return dc; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "linspace", function() { return In; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "localResponseNormalization", function() { return Al; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "log", function() { return ys; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "log1p", function() { return xs; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "logSigmoid", function() { return bs; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "logSoftmax", function() { return Vr; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "logSumExp", function() { return Du; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "logicalAnd", function() { return gl; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "logicalNot", function() { return yl; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "logicalOr", function() { return xl; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "logicalXor", function() { return bl; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "losses", function() { return cc; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "matMul", function() { return uu; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "math", function() { return Sh; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "max", function() { return _u; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "maxPool", function() { return yu; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "maximum", function() { return rl; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "maximumStrict", function() { return ol; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "mean", function() { return Ou; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "memory", function() { return _e; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "min", function() { return Fu; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "minimum", function() { return al; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "minimumStrict", function() { return il; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "mod", function() { return sl; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "modStrict", function() { return ul; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "moments", function() { return Mu; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "movingAverage", function() { return Pl; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "mul", function() { return ll; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "mulStrict", function() { return cl; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "multiRNNCell", function() { return Bl; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "multinomial", function() { return er; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "neg", function() { return ws; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "nextFrame", function() { return Jh; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "norm", function() { return Tl; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "notEqual", function() { return Ku; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "notEqualStrict", function() { return Xu; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "oneHot", function() { return nr; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ones", function() { return Cn; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "onesLike", function() { return Nn; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "op", function() { return ln; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "outerProduct", function() { return cu; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "pad", function() { return rr; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "pad1d", function() { return or; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "pad2d", function() { return ar; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "pad3d", function() { return ir; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "pad4d", function() { return sr; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "pool", function() { return bu; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "pow", function() { return hl; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "powStrict", function() { return pl; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "prelu", function() { return Il; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "print", function() { return jn; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "prod", function() { return Pu; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "profile", function() { return Oe; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "rand", function() { return ur; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "randomNormal", function() { return lr; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "randomUniform", function() { return cr; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "range", function() { return Sn; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ready", function() { return We; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "real", function() { return hn; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "reciprocal", function() { return Cs; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "registerBackend", function() { return qe; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "relu", function() { return Sl; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "removeBackend", function() { return ze; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "reshape", function() { return hr; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "reverse", function() { return hu; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "reverse1d", function() { return pu; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "reverse2d", function() { return fu; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "reverse3d", function() { return du; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "reverse4d", function() { return vu; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "rfft", function() { return Gl; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "round", function() { return Es; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "rsqrt", function() { return Rs; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "scalar", function() { return vn; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "scatterND", function() { return Ul; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "selu", function() { return Nl; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "separableConv2d", function() { return iu; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "serialization", function() { return _h; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "setBackend", function() { return Le; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "setPlatform", function() { return $e; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "setdiff1dAsync", function() { return yr; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "sigmoid", function() { return Is; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "sign", function() { return Ss; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "signal", function() { return tc; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "sin", function() { return Ts; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "sinh", function() { return Ds; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "slice", function() { return wu; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "slice1d", function() { return Cu; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "slice2d", function() { return Eu; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "slice3d", function() { return Ru; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "slice4d", function() { return Iu; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "softmax", function() { return zr; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "softplus", function() { return _s; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "spaceToBatchND", function() { return pr; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "sparseToDense", function() { return $l; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "spectral", function() { return Hl; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "split", function() { return Fn; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "sqrt", function() { return Os; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "square", function() { return Fs; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "squaredDifference", function() { return fl; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "squaredDifferenceStrict", function() { return dl; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "squeeze", function() { return fr; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "stack", function() { return dr; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "step", function() { return Ms; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "stridedSlice", function() { return Ll; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "sub", function() { return vl; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "subStrict", function() { return ml; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "sum", function() { return Bu; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "tan", function() { return Bs; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "tanh", function() { return Ps; });
/* 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 gn; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "tensor3d", function() { return yn; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "tensor4d", function() { return xn; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "tensor5d", function() { return bn; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "tensor6d", function() { return wn; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "tensor_util", function() { return St; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "test_util", function() { return Lh; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "tidy", function() { return Fe; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "tile", function() { return vr; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "time", function() { return Pe; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "topk", function() { return Wl; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "train", function() { return Yh; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "transpose", function() { return kl; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "truncatedNormal", function() { return mr; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "unsortedSegmentSum", function() { return Fl; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "unstack", function() { return gr; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "util", function() { return Q; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "valueAndGrad", function() { return Br; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "valueAndGrads", function() { return Pr; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "variable", function() { return yt; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "variableGrads", function() { return Lr; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "version_core", function() { return Wh; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "webgl", function() { return Uh; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "where", function() { return wl; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "whereAsync", function() { return Cl; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "zeros", function() { return En; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "zerosLike", function() { return kn; });
/**
* @license
* Copyright 2019 Google LLC. All Rights Reserved.
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
* =============================================================================
*/
var 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)}var n=function(){return(n=Object.assign||function(t){for(var e,n=1,r=arguments.length;n<r;n++)for(var o in e=arguments[n])Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t}).apply(this,arguments)};function r(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 o(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 a=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=i(this.global.location.search);if("tfjsflags"in e)e.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 i(t){var e={};return t.replace(/[?&]([^=?&]+)(?:=([^&]*))?/g,function(t){for(var n=[],r=1;r<arguments.length;r++)n[r-1]=arguments[r];return function(t,e,n){t[decodeURIComponent(e)]=decodeURIComponent(n||"")}(e,n[0],n[1]),n.join("=")}),e}var s=null;function u(t){s=t}var l=Object.freeze({Environment:a,getQueryParams:i,get ENV(){return s},setEnvironmentGlobal:u});function c(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 h(t,e,n){return Math.max(t,Math.min(e,n))}function p(t){return t%2==0?t:t+1}function f(t){for(var e=0,n=0;n<t.length;n++)e+=t[n];return e}function d(t,e){if(!t)throw new Error("string"==typeof e?e:e())}function v(t,e,n){void 0===n&&(n=""),d(x(t,e),function(){return n+" Shapes "+t+" and "+e+" must match"})}function m(t){d(null!=t,function(){return"The input to the tensor constructor must be a non-null value."})}function g(t,e){if(void 0===e&&(e=[]),null==e&&(e=[]),Array.isArray(t)||F(t))for(var n=0;n<t.length;++n)g(t[n],e);else e.push(t);return e}function y(t){if(0===t.length)return 1;for(var e=t[0],n=1;n<t.length;n++)e*=t[n];return e}function x(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 b(t){return t%1==0}function w(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 C(t){var e=Math.ceil(Math.sqrt(t));return[e,Math.ceil(t/e)]}function E(t,e){return e<=t.length?t:t+" ".repeat(e-t.length)}function R(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{var s=e(++a);null!=n&&a>=n?o():setTimeout(i,s)}};i()})}function I(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 S(t,e){var n=e.length;return d((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}),d(t.every(function(t){return b(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 N(t,e){for(var n=[],r=[],o=null==e?null:S(e,t).sort(),a=0,i=0;i<t.length;++i){if(null!=o){if(o[a]===i&&1!==t[i])throw new Error("Can't squeeze axis "+i+" since its dim '"+t[i]+"' is not 1");(null==o[a]||o[a]>i)&&1===t[i]&&(n.push(t[i]),r.push(i)),o[a]<=i&&a++}1!==t[i]&&(n.push(t[i]),r.push(i))}return{newShape:n,keptDims:r}}function k(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 A(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 T(t,e,n){if("float32"===e)for(var r=0;r<t.length;r++){var o=t[r];if(isNaN(o)||!isFinite(o))throw Error("The result of the '"+n+"' is "+o+".")}}function D(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 _(t){return"bool"===t||"complex64"===t||"float32"===t||"int32"===t||"string"===t}function O(t,e){return"complex64"!==e&&(("float32"!==e||"complex64"===t)&&(("int32"!==e||"float32"===t||"complex64"===t)&&("bool"!==e||"bool"!==t)))}function F(t){return t instanceof Float32Array||t instanceof Int32Array||t instanceof Uint8Array}function M(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 B(t){if(null==t)return 0;var e=0;return t.forEach(function(t){return e+=2*t.length}),e}function P(t){return"string"==typeof t||t instanceof String}function L(t){return"boolean"==typeof t}function W(t){return"number"==typeof t}function U(t){return Array.isArray(t)?U(t[0]):t instanceof Float32Array?"float32":t instanceof Int32Array||t instanceof Uint8Array?"int32":W(t)?"float32":P(t)?"string":L(t)?"bool":"float32"}function z(t){return!!(t&&t.constructor&&t.call&&t.apply)}function V(t,e){for(var n=e;n<t;++n)if(t%n==0)return n;return t}function G(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=g(t)),n&&D(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 H(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 $(t,e){for(var n=j(t,e),r=0;r<n.length;r++)n[r]=1;return n}function j(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 K(){if("undefined"!=typeof performance)return performance.now();if("undefined"!=typeof process){var t=process.hrtime();return 1e3*t[0]+t[1]/1e6}throw new Error("Cannot measure time in this environment. You should run tf.js in the browser or in Node.js")}function X(t){t.forEach(function(e){d(Number.isInteger(e)&&e>=0,function(){return"Tensor must have a shape comprised of positive integers but got shape ["+t+"]."})})}function Y(t,e){return s.platform.fetch(t,e)}var Q=Object.freeze({shuffle:c,clamp:h,nearestLargerEven:p,sum:f,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:d,assertShapesMatch:v,assertNonNull:m,flatten:g,sizeFromShape:y,isScalarShape:function(t){return 0===t.length},arraysEqual:x,isInt:b,tanh:w,sizeToSquarishShape:C,createShuffledIndices:function(t){for(var e=new Uint32Array(t),n=0;n<t;++n)e[n]=n;return c(e),e},rightPad:E,repeatedTry:R,inferFromImplicitShape:I,parseAxisParam:S,squeezeShape:N,getTypedArrayFromDType:k,getArrayFromDType:A,checkComputationForErrors:T,checkConversionForErrors:D,isValidDtype:_,hasEncodingLoss:O,isTypedArray:F,bytesPerElement:M,bytesFromStringArray:B,isString:P,isBoolean:L,isNumber:W,inferDtype:U,isFunction:z,nearestDivisor:V,computeStrides:G,toTypedArray:q,toNestedArray:H,makeOnesTypedArray:$,makeZerosTypedArray:j,now:K,assertNonNegativeIntegerDimensions:X,fetch:Y}),J=function(){function t(t,e){this.backendTimer=t,this.logger=e,null==e&&(this.logger=new Z)}return t.prototype.profileKernel=function(t,e){var n,r=this,o=this.backendTimer.time(function(){n=e()});return(Array.isArray(n)?n:[n]).forEach(function(e){var n=e.dataSync();T(n,e.dtype,t),o.then(function(o){var a="";null!=o.getExtraProfileInfo&&(a=o.getExtraProfileInfo()),r.logger.logKernelProfile(t,e,n,o.kernelMs,a)})}),n},t}(),Z=function(){function t(){}return t.prototype.logKernelProfile=function(t,e,n,r,o){var a=E(r+"ms",9),i=E(t,25),s=e.rank,u=e.size,l=E(e.shape.toString(),14);console.log("%c"+i+"\t%c"+a+"\t%c"+s+"D "+l+"\t%c"+u+"\t%c"+o,"font-weight:bold","color:red","color:blue","color: orange","color: green")},t}(),tt=20,et=3,nt=7;function rt(t,e,n,r){var o=G(e),a=function(t,e,n,r){var o=y(e),a=r[r.length-1],i=new Array(a).fill(0),s=e.length,u="complex64"===n?it(t):t;if(s>1)for(var l=0;l<o/a;l++)for(var c=l*a,h=0;h<a;h++)i[h]=Math.max(i[h],ot(u[c+h],0,n).length);return i}(t,e,n,o),i=e.length,s=function t(e,n,r,o,a,i){void 0===i&&(i=!0);var s="complex64"===r?2:1;var u=n[0];var l=n.length;if(0===l){if("complex64"===r){var c=it(e);return[ot(c[0],0,r)]}return"bool"===r?[at(e[0])]:[e[0].toString()]}if(1===l){if(u>tt){var h=et*s,p=Array.from(e.slice(0,h)),f=Array.from(e.slice(u-et*s,u));return"complex64"===r&&(p=it(p),f=it(f)),["["+p.map(function(t,e){return ot(t,a[e],r)}).join(", ")+", ..., "+f.map(function(t,e){return ot(t,a[u-et+e],r)}).join(", ")+"]"]}var d="complex64"===r?it(e):Array.from(e);return["["+d.map(function(t,e){return ot(t,a[e],r)}).join(", ")+"]"]}var v=n.slice(1);var m=o.slice(1);var g=o[0]*s;var y=[];if(u>tt){for(var x=0;x<et;x++){var b=x*g,w=b+g;y.push.apply(y,t(e.slice(b,w),v,r,m,a,!1))}y.push("...");for(var x=u-et;x<u;x++){var b=x*g,w=b+g;y.push.apply(y,t(e.slice(b,w),v,r,m,a,x===u-1))}}else for(var x=0;x<u;x++){var b=x*g,w=b+g;y.push.apply(y,t(e.slice(b,w),v,r,m,a,x===u-1))}var C=2===l?",":"";y[0]="["+y[0]+C;for(var x=1;x<y.length-1;x++)y[x]=" "+y[x]+C;var E=",\n";for(var x=2;x<l;x++)E+="\n";y[y.length-1]=" "+y[y.length-1]+"]"+(i?"":E);return y}(t,e,n,o,a),u=["Tensor"];return r&&(u.push(" dtype: "+n),u.push(" rank: "+i),u.push(" shape: ["+e+"]"),u.push(" values:")),u.push(s.map(function(t){return" "+t}).join("\n")),u.join("\n")}function ot(t,e,n){return E(Array.isArray(t)?parseFloat(t[0].toFixed(nt))+" + "+parseFloat(t[1].toFixed(nt))+"j":P(t)?"'"+t+"'":"bool"===n?at(t):parseFloat(t.toFixed(nt)).toString(),e)}function at(t){return 0===t?"false":"true"}function it(t){for(var e=[],n=0;n<t.length;n+=2)e.push([t[n],t[n+1]]);return e}var st=function(){function t(t,e,n){var r=this;if(this.dtype=e,this.shape=t.slice(),this.size=y(t),null!=n){var o=n.length;d(o===this.size,function(){return"Length of values '"+o+"' does not match the size inferred by the shape '"+r.size+"'."})}if("complex64"===e)throw new Error("complex64 dtype TensorBuffers are not supported. Please create a TensorBuffer for the real and imaginary parts separately and call tf.complex(real, imag).");this.values=n||A(e,this.size),this.strides=G(t)}return t.prototype.set=function(t){for(var e=this,n=[],r=1;r<arguments.length;r++)n[r-1]=arguments[r];0===n.length&&(n=[0]),d(n.length===this.rank,function(){return"The number of provided coordinates ("+n.length+") must match the rank ("+e.rank+")"});var o=this.locToIndex(n);this.values[o]=t},t.prototype.get=function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];0===t.length&&(t=[0]);for(var n=0,r=0,o=t;r<o.length;r++){var a=o[r];if(a<0||a>=this.shape[n]){var i="Requested out of range element at "+t+". Buffer shape="+this.shape;throw new Error(i)}n++}for(var s=t[t.length-1],u=0;u<t.length-1;++u)s+=this.strides[u]*t[u];return this.values[s]},t.prototype.locToIndex=function(t){if(0===this.rank)return 0;if(1===this.rank)return t[0];for(var e=t[t.length-1],n=0;n<t.length-1;++n)e+=this.strides[n]*t[n];return e},t.prototype.indexToLoc=function(t){if(0===this.rank)return[];if(1===this.rank)return[t];for(var e=new Array(this.shape.length),n=0;n<e.length-1;++n)e[n]=Math.floor(t/this.strides[n]),t-=e[n]*this.strides[n];return e[e.length-1]=t,e},Object.defineProperty(t.prototype,"rank",{get:function(){return this.shape.length},enumerable:!0,configurable:!0}),t.prototype.toTensor=function(){return ht.make(this.shape,{values:this.values},this.dtype)},t}(),ut=null,lt=null,ct=null;var ht=function(){function t(t,e,n,r,o){this.kept=!1,this.isDisposedInternal=!1,this.shape=t.slice(),this.dtype=e||"float32",this.size=y(t),this.strides=G(t),this.dataId=null!=r?r:{},this.id=ut().nextTensorId(),this.rankType=this.rank<5?this.rank.toString():"higher",ut().registerTensor(this,o),null!=n&&ut().write(o,this.dataId,n)}return t.make=function(e,n,r,o){return new t(e,r,n.values,n.dataId,o)},t.prototype.flatten=function(){return this.throwIfDisposed(),this.as1D()},t.prototype.asScalar=function(){return this.throwIfDisposed(),d(1===this.size,function(){return"The array must have only 1 element."}),this.reshape([])},t.prototype.as1D=function(){return this.throwIfDisposed(),this.reshape([this.size])},t.prototype.as2D=funct