text: /**
   * @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.
   * =============================================================================
   */
  !function(e,t){"object"==typeof exports&&"undefined"!=typeof module?t(exports,require("@tensorflow/tfjs-core")):"function"==typeof define&&define.amd?define(["exports","@tensorflow/tfjs-core"],t):t(e.tf=e.tf||{},e.tf)}(this,function(e,t){"use strict";var a=function(){return(a=Object.assign||function(e){for(var t,a=1,r=arguments.length;a<r;a++)for(var n in t=arguments[a])Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n]);return e}).apply(this,arguments)};function r(e,t,a,r){return new(a||(a=Promise))(function(n,s){function o(e){try{i(r.next(e))}catch(e){s(e)}}function p(e){try{i(r.throw(e))}catch(e){s(e)}}function i(e){e.done?n(e.value):new a(function(t){t(e.value)}).then(o,p)}i((r=r.apply(e,t||[])).next())})}function n(e,t){var a,r,n,s,o={label:0,sent:function(){if(1&n[0])throw n[1];return n[1]},trys:[],ops:[]};return s={next:p(0),throw:p(1),return:p(2)},"function"==typeof Symbol&&(s[Symbol.iterator]=function(){return this}),s;function p(s){return function(p){return function(s){if(a)throw new TypeError("Generator is already executing.");for(;o;)try{if(a=1,r&&(n=2&s[0]?r.return:s[0]?r.throw||((n=r.return)&&n.call(r),0):r.next)&&!(n=n.call(r,s[1])).done)return n;switch(r=0,n&&(s=[2&s[0],n.value]),s[0]){case 0:case 1:n=s;break;case 4:return o.label++,{value:s[1],done:!1};case 5:o.label++,r=s[1],s=[0];continue;case 7:s=o.ops.pop(),o.trys.pop();continue;default:if(!(n=(n=o.trys).length>0&&n[n.length-1])&&(6===s[0]||2===s[0])){o=0;continue}if(3===s[0]&&(!n||s[1]>n[0]&&s[1]<n[3])){o.label=s[1];break}if(6===s[0]&&o.label<n[1]){o.label=n[1],n=s;break}if(n&&o.label<n[2]){o.label=n[2],o.ops.push(s);break}n[2]&&o.ops.pop(),o.trys.pop();continue}s=t.call(e,o)}catch(e){s=[6,e],r=0}finally{a=n=0}if(5&s[0])throw s[1];return{value:s[0]?s[1]:void 0,done:!0}}([s,p])}}}var s,o,p={};function i(e,t){var a={tfOpName:e,category:"custom",inputs:[],attrs:[],customExecutor:t};p[e]=a}function u(e){return p[e]}function m(e,t,a,r){var n=t.inputParams[e];if(n&&void 0!==n.inputIndexStart){var s=n.inputIndexStart,o=0===n.inputIndexEnd?void 0:void 0===n.inputIndexEnd?s+1:n.inputIndexEnd;if("tensor"===n.type)return c(t.inputNames[n.inputIndexStart],a,r);if("tensors"===n.type)return t.inputNames.slice(s,o).map(function(e){return c(e,a,r)});var p=Array.prototype.slice.call(c(t.inputNames.slice(s)[0],a,r).dataSync());return"number"===n.type?p[0]:p}var i=t.attrParams[e];return i&&i.value}function c(e,t,a){var r=l(e),n=r[0],s=r[1],o=a.currentContextIds.find(function(e){return!!t[y(n,e)]});return void 0!==o?t[y(n,o)][s]:void 0}function d(e,t){var a=l(e),r=a[0],n=a[1];return[y(r,t&&t.currentContextId),n]}function y(e,t){return t?e+"-"+t:e}function l(e){var t=e.lastIndexOf(":");return-1===t?[e,0]:[e.substring(0,t),Number(e.substring(t+1))]}function f(e,t){for(var a=[],r=0;r<e.length;r+=t)a.push(e.slice(r,r+t));return a}!function(e){e[e.DT_INVALID=0]="DT_INVALID",e[e.DT_FLOAT=1]="DT_FLOAT",e[e.DT_DOUBLE=2]="DT_DOUBLE",e[e.DT_INT32=3]="DT_INT32",e[e.DT_UINT8=4]="DT_UINT8",e[e.DT_INT16=5]="DT_INT16",e[e.DT_INT8=6]="DT_INT8",e[e.DT_STRING=7]="DT_STRING",e[e.DT_COMPLEX64=8]="DT_COMPLEX64",e[e.DT_INT64=9]="DT_INT64",e[e.DT_BOOL=10]="DT_BOOL",e[e.DT_QINT8=11]="DT_QINT8",e[e.DT_QUINT8=12]="DT_QUINT8",e[e.DT_QINT32=13]="DT_QINT32",e[e.DT_BFLOAT16=14]="DT_BFLOAT16",e[e.DT_FLOAT_REF=101]="DT_FLOAT_REF",e[e.DT_DOUBLE_REF=102]="DT_DOUBLE_REF",e[e.DT_INT32_REF=103]="DT_INT32_REF",e[e.DT_UINT8_REF=104]="DT_UINT8_REF",e[e.DT_INT16_REF=105]="DT_INT16_REF",e[e.DT_INT8_REF=106]="DT_INT8_REF",e[e.DT_STRING_REF=107]="DT_STRING_REF",e[e.DT_COMPLEX64_REF=108]="DT_COMPLEX64_REF",e[e.DT_INT64_REF=109]="DT_INT64_REF",e[e.DT_BOOL_REF=110]="DT_BOOL_REF",e[e.DT_QINT8_REF=111]="DT_QINT8_REF",e[e.DT_QUINT8_REF=112]="DT_QUINT8_REF",e[e.DT_QINT32_REF=113]="DT_QINT32_REF",e[e.DT_BFLOAT16_REF=114]="DT_BFLOAT16_REF"}(s||(s={})),function(e){!function(e){e[e.LEGACY=0]="LEGACY",e[e.V1=1]="V1",e[e.V2=2]="V2"}(e.CheckpointFormatVersion||(e.CheckpointFormatVersion={}))}(o||(o={}));var h=Object.freeze({json:[{tfOpName:"Add",category:"arithmetic",inputs:[{start:0,name:"a",type:"tensor"},{start:1,name:"b",type:"tensor"}],attrs:[{tfName:"T",name:"dtype",type:"dtype",notSupported:!0}]},{tfOpName:"AddV2",category:"arithmetic",inputs:[{start:0,name:"a",type:"tensor"},{start:1,name:"b",type:"tensor"}],attrs:[{tfName:"T",name:"dtype",type:"dtype",notSupported:!0}]},{tfOpName:"AddN",category:"arithmetic",inputs:[{start:0,end:0,name:"tensors",type:"tensors"}]},{tfOpName:"BiasAdd",category:"arithmetic",inputs:[{start:0,name:"a",type:"tensor"},{start:1,name:"b",type:"tensor"}],attrs:[{tfName:"T",name:"dtype",type:"dtype",notSupported:!0}]},{tfOpName:"Sub",category:"arithmetic",inputs:[{start:0,name:"a",type:"tensor"},{start:1,name:"b",type:"tensor"}],attrs:[{tfName:"T",name:"dtype",type:"dtype",notSupported:!0}]},{tfOpName:"RealDiv",category:"arithmetic",inputs:[{start:0,name:"a",type:"tensor"},{start:1,name:"b",type:"tensor"}],attrs:[{tfName:"T",name:"dtype",type:"dtype",notSupported:!0}]},{tfOpName:"Div",category:"arithmetic",inputs:[{start:0,name:"a",type:"tensor"},{start:1,name:"b",type:"tensor"}],attrs:[{tfName:"T",name:"dtype",type:"dtype",notSupported:!0}]},{tfOpName:"FloorDiv",category:"arithmetic",inputs:[{start:0,name:"a",type:"tensor"},{start:1,name:"b",type:"tensor"}],attrs:[{tfName:"T",name:"dtype",type:"dtype",notSupported:!0}]},{tfOpName:"Mul",category:"arithmetic",inputs:[{start:0,name:"a",type:"tensor"},{start:1,name:"b",type:"tensor"}],attrs:[{tfName:"T",name:"dtype",type:"dtype",notSupported:!0}]},{tfOpName:"Maximum",category:"arithmetic",inputs:[{start:0,name:"a",type:"tensor"},{start:1,name:"b",type:"tensor"}]},{tfOpName:"Minimum",category:"arithmetic",inputs:[{start:0,name:"a",type:"tensor"},{start:1,name:"b",type:"tensor"}]},{tfOpName:"Pow",category:"arithmetic",inputs:[{start:0,name:"a",type:"tensor"},{start:1,name:"b",type:"tensor"}],attrs:[{tfName:"T",name:"dtype",type:"dtype",notSupported:!0}]},{tfOpName:"SquaredDifference",category:"arithmetic",inputs:[{start:0,name:"a",type:"tensor"},{start:1,name:"b",type:"tensor"}],attrs:[{tfName:"T",name:"dtype",type:"dtype",notSupported:!0}]},{tfOpName:"Mod",category:"arithmetic",inputs:[{start:0,name:"a",type:"tensor"},{start:1,name:"b",type:"tensor"}],attrs:[{tfName:"T",name:"dtype",type:"dtype",notSupported:!0}]},{tfOpName:"FloorMod",category:"arithmetic",inputs:[{start:0,name:"a",type:"tensor"},{start:1,name:"b",type:"tensor"}],attrs:[{tfName:"T",name:"dtype",type:"dtype",notSupported:!0}]}]}),N=Object.freeze({json:[{tfOpName:"Abs",category:"basic_math",inputs:[{start:0,name:"x",type:"tensor"}],attrs:[{tfName:"T",name:"dtype",type:"dtype",notSupported:!0}]},{tfOpName:"Acos",category:"basic_math",inputs:[{start:0,name:"x",type:"tensor"}],attrs:[{tfName:"T",name:"dtype",type:"dtype",notSupported:!0}]},{tfOpName:"Asin",category:"basic_math",inputs:[{start:0,name:"x",type:"tensor"}],attrs:[{tfName:"T",name:"dtype",type:"dtype",notSupported:!0}]},{tfOpName:"Atan",category:"basic_math",inputs:[{start:0,name:"x",type:"tensor"}],attrs:[{tfName:"T",name:"dtype",type:"dtype",notSupported:!0}]},{tfOpName:"Atan2",category:"basic_math",inputs:[{start:0,name:"x",type:"tensor"},{start:1,name:"y",type:"tensor"}],attrs:[{tfName:"T",name:"dtype",type:"dtype",notSupported:!0}]},{tfOpName:"Ceil",category:"basic_math",inputs:[{start:0,name:"x",type:"tensor"}],attrs:[{tfName:"T",name:"dtype",type:"dtype",notSupported:!0}]},{tfOpName:"ClipByValue",category:"basic_math",inputs:[{start:0,name:"x",type:"tensor"}],attrs:[{tfName:"clip_value_min",name:"clipValueMin",type:"number"},{tfName:"clip_value_max",name:"clipValueMax",type:"number"}]},{tfOpName:"Complex",category:"basic_math",inputs:[{start:0,name:"real",type:"tensor"},{start:1,name:"imag",type:"tensor"}],attrs:[{tfName:"T",name:"dtype",type:"dtype",notSupported:!0}]},{tfOpName:"ComplexAbs",category:"basic_math",inputs:[{start:0,name:"x",type:"tensor"}],attrs:[{tfName:"T",name:"dtype",type:"dtype",notSupported:!0}]},{tfOpName:"Cos",category:"basic_math",inputs:[{start:0,name:"x",type:"tensor"}],attrs:[{tfName:"T",name:"dtype",type:"dtype",notSupported:!0}]},{tfOpName:"Cosh",category:"basic_math",inputs:[{start:0,name:"x",type:"tensor"}],attrs:[{tfName:"T",name:"dtype",type:"dtype",notSupported:!0}]},{tfOpName:"Elu",category:"basic_math",inputs:[{start:0,name:"x",type:"tensor"}],attrs:[{tfName:"T",name:"dtype",type:"dtype",notSupported:!0}]},{tfOpName:"Exp",category:"basic_math",inputs:[{start:0,name:"x",type:"tensor"}],attrs:[{tfName:"T",name:"dtype",type:"dtype",notSupported:!0}]},{tfOpName:"Floor",category:"basic_math",inputs:[{start:0,name:"x",type:"tensor"}],attrs:[{tfName:"T",name:"dtype",type:"dtype",notSupported:!0}]},{tfOpName:"Log",category:"basic_math",inputs:[{start:0,name:"x",type:"tensor"}],attrs:[{tfName:"T",name:"dtype",type:"dtype",notSupported:!0}]},{tfOpName:"Neg",category:"basic_math",inputs:[{start:0,name:"x",type:"tensor"}],attrs:[{tfName:"T",name:"dtype",type:"dtype",notSupported:!0}]},{tfOpName:"Relu",category:"basic_math",inputs:[{start:0,name:"x",type:"tensor"}],attrs:[{tfName:"T",name:"dtype",type:"dtype",notSupported:!0}]},{tfOpName:"Relu6",category:"basic_math",inputs:[{start:0,name:"x",type:"tensor"}],attrs:[{tfName:"T",name:"dtype",type:"dtype",notSupported:!0},{tfName:"clipValueMin",name:"clipValueMin",type:"number",defaultValue:0},{tfName:"clipValueMax",name:"clipValueMax",type:"number",defaultValue:6}]},{tfOpName:"Selu",category:"basic_math",inputs:[{start:0,name:"x",type:"tensor"}],attrs:[{tfName:"T",name:"dtype",type:"dtype",notSupported:!0}]},{tfOpName:"Sigmoid",category:"basic_math",inputs:[{start:0,name:"x",type:"tensor"}],attrs:[{tfName:"T",name:"dtype",type:"dtype",notSupported:!0}]},{tfOpName:"Sin",category:"basic_math",inputs:[{start:0,name:"x",type:"tensor"}],attrs:[{tfName:"T",name:"dtype",type:"dtype",notSupported:!0}]},{tfOpName:"Sinh",category:"basic_math",inputs:[{start:0,name:"x",type:"tensor"}],attrs:[{tfName:"T",name:"dtype",type:"dtype",notSupported:!0}]},{tfOpName:"Sqrt",category:"basic_math",inputs:[{start:0,name:"x",type:"tensor"}],attrs:[{tfName:"T",name:"dtype",type:"dtype",notSupported:!0}]},{tfOpName:"Rsqrt",category:"basic_math",inputs:[{start:0,name:"x",type:"tensor"}],attrs:[{tfName:"T",name:"dtype",type:"dtype",notSupported:!0}]},{tfOpName:"Square",category:"basic_math",inputs:[{start:0,name:"x",type:"tensor"}],attrs:[{tfName:"T",name:"dtype",type:"dtype",notSupported:!0}]},{tfOpName:"Tan",category:"basic_math",inputs:[{start:0,name:"x",type:"tensor"}],attrs:[{tfName:"T",name:"dtype",type:"dtype",notSupported:!0}]},{tfOpName:"Tanh",category:"basic_math",inputs:[{start:0,name:"x",type:"tensor"}],attrs:[{tfName:"T",name:"dtype",type:"dtype",notSupported:!0}]},{tfOpName:"Sign",category:"basic_math",inputs:[{start:0,name:"x",type:"tensor"}],attrs:[{tfName:"T",name:"dtype",type:"dtype",notSupported:!0}]},{tfOpName:"Round",category:"basic_math",inputs:[{start:0,name:"x",type:"tensor"}],attrs:[{tfName:"T",name:"dtype",type:"dtype",notSupported:!0}]},{tfOpName:"Expm1",category:"basic_math",inputs:[{start:0,name:"x",type:"tensor"}],attrs:[{tfName:"T",name:"dtype",type:"dtype",notSupported:!0}]},{tfOpName:"Log1p",category:"basic_math",inputs:[{start:0,name:"x",type:"tensor"}],attrs:[{tfName:"T",name:"dtype",type:"dtype",notSupported:!0}]},{tfOpName:"Reciprocal",category:"basic_math",inputs:[{start:0,name:"x",type:"tensor"}],attrs:[{tfName:"T",name:"dtype",type:"dtype",notSupported:!0}]},{tfOpName:"Softplus",category:"basic_math",inputs:[{start:0,name:"x",type:"tensor"}],attrs:[{tfName:"T",name:"dtype",type:"dtype",notSupported:!0}]},{tfOpName:"Asinh",category:"basic_math",inputs:[{start:0,name:"x",type:"tensor"}],attrs:[{tfName:"T",name:"dtype",type:"dtype",notSupported:!0}]},{tfOpName:"Acosh",category:"basic_math",inputs:[{start:0,name:"x",type:"tensor"}],attrs:[{tfName:"T",name:"dtype",type:"dtype",notSupported:!0}]},{tfOpName:"Atanh",category:"basic_math",inputs:[{start:0,name:"x",type:"tensor"}],attrs:[{tfName:"T",name:"dtype",type:"dtype",notSupported:!0}]},{tfOpName:"Erf",category:"basic_math",inputs:[{start:0,name:"x",type:"tensor"}],attrs:[{tfName:"T",name:"dtype",type:"dtype",notSupported:!0}]},{tfOpName:"Prod",category:"basic_math",inputs:[{start:0,name:"x",type:"tensor"},{start:1,name:"axes",type:"number[]"}],attrs:[{tfName:"keep_dims",name:"keepDims",type:"bool",notSupported:!0},{tfName:"T",name:"dtype",type:"dtype",notSupported:!0}]},{tfOpName:"LeakyRelu",category:"basic_math",inputs:[{start:0,name:"x",type:"tensor"}],attrs:[{tfName:"alpha",name:"alpha",type:"number",defaultValue:.2},{tfName:"T",name:"dtype",type:"dtype",notSupported:!0}]}]}),g=Object.freeze({json:[{tfOpName:"LoopCond",category:"control",inputs:[{start:0,name:"pred",type:"tensor"}]},{tfOpName:"Switch",category:"control",inputs:[{start:0,name:"data",type:"tensor"},{start:1,name:"pred",type:"tensor"}]},{tfOpName:"Merge",category:"control",inputs:[{start:0,end:0,name:"tensors",type:"tensors"}]},{tfOpName:"Enter",category:"control",inputs:[{start:0,name:"tensor",type:"tensor"}],attrs:[{tfName:"T",name:"dtype",type:"dtype",notSupported:!0},{tfName:"frame_name",name:"frameName",type:"string"},{tfName:"is_constant",name:"isConstant",type:"bool"}]},{tfOpName:"Exit",category:"control",inputs:[{start:0,name:"tensor",type:"tensor"}],attrs:[{tfName:"T",name:"dtype",type:"dtype",notSupported:!0}]},{tfOpName:"NextIteration",category:"control",inputs:[{start:0,name:"tensor",type:"tensor"}],attrs:[{tfName:"T",name:"dtype",type:"dtype",notSupported:!0}]},{tfOpName:"TensorArrayV3",category:"control",inputs:[{start:0,name:"size",type:"number"}],attrs:[{tfName:"dtype",name:"dtype",type:"dtype"},{tfName:"element_shape",name:"elementShape",type:"shape"},{tfName:"dynamic_size",name:"dynamicSize",type:"bool"},{tfName:"clear_after_read",name:"clearAfterRead",type:"bool"},{tfName:"identical_element_shapes",name:"identicalElementShapes",type:"bool"},{tfName:"tensor_array_name",name:"name",type:"string"}]},{tfOpName:"TensorArrayWriteV3",category:"control",inputs:[{start:0,name:"tensorArrayId",type:"number"},{start:1,name:"index",type:"number"},{start:2,name:"tensor",type:"tensor"},{start:3,name:"flowIn",type:"number"}],attrs:[{tfName:"T",name:"dtype",type:"dtype",notSupported:!0}]},{tfOpName:"TensorArrayReadV3",category:"control",inputs:[{start:0,name:"tensorArrayId",type:"number"},{start:1,name:"index",type:"number"},{start:2,name:"flowIn",type:"number"}],attrs:[{tfName:"dtype",name:"dtype",type:"dtype",notSupported:!0}]},{tfOpName:"TensorArrayGatherV3",category:"control",inputs:[{start:0,name:"tensorArrayId",type:"number"},{start:1,name:"indices",type:"number[]"},{start:2,name:"flowIn",type:"number"}],attrs:[{tfName:"dtype",name:"dtype",type:"dtype"},{tfName:"element_shape",name:"elementShape",type:"shape"}]},{tfOpName:"TensorArrayScatterV3",category:"control",inputs:[{start:0,name:"tensorArrayId",type:"number"},{start:1,name:"indices",type:"number[]"},{start:2,name:"tensor",type:"tensor"},{start:3,name:"flowIn",type:"number"}],attrs:[{tfName:"T",name:"dtype",type:"dtype"}]},{tfOpName:"TensorArrayConcatV3",category:"control",inputs:[{start:0,name:"tensorArrayId",type:"number"},{start:1,name:"flowIn",type:"number"}],attrs:[{tfName:"dtype",name:"dtype",type:"dtype"},{tfName:"element_shape_except0",name:"elementShapeExcept0",type:"shape",notSupported:!0}]},{tfOpName:"TensorArraySplitV3",category:"control",inputs:[{start:0,name:"tensorArrayId",type:"number"},{start:1,name:"tensor",type:"tensor"},{start:2,name:"lengths",type:"number[]"},{start:3,name:"flowIn",type:"number"}],attrs:[{tfName:"T",name:"dtype",type:"dtype"}]},{tfOpName:"TensorArraySizeV3",category:"control",inputs:[{start:0,name:"tensorArrayId",type:"number"},{start:1,name:"flowIn",type:"number"}]},{tfOpName:"TensorArrayCloseV3",category:"control",inputs:[{start:0,name:"tensorArrayId",type:"number"}]}]}),b=Object.freeze({json:[{tfOpName:"AvgPool",category:"convolution",inputs:[{start:0,name:"x",type:"tensor"}],attrs:[{tfName:"strides",name:"strides",type:"number[]"},{tfName:"padding",name:"pad",type:"string"},{tfName:"data_format",name:"dataFormat",type:"string",notSupported:!0},{tfName:"ksize",name:"kernelSize",type:"number[]"},{tfName:"T",name:"dtype",type:"dtype",notSupported:!0}]},{tfOpName:"MaxPool",category:"convolution",inputs:[{start:0,name:"x",type:"tensor"}],attrs:[{tfName:"strides",name:"strides",type:"number[]"},{tfName:"padding",name:"pad",type:"string"},{tfName:"data_format",name:"dataFormat",type:"string",notSupported:!0},{tfName:"ksize",name:"kernelSize",type:"number[]"},{tfName:"T",name:"dtype",type:"dtype",notSupported:!0}]},{tfOpName:"Conv1D",category:"convolution",inputs:[{start:0,name:"x",type:"tensor"},{start:1,name:"filter",type:"tensor"}],attrs:[{tfName:"stride",name:"stride",type:"number"},{tfName:"padding",name:"pad",type:"string"},{tfName:"data_format",name:"dataFormat",type:"string",defaultValue:"NWC"},{tfName:"T",name:"dtype",type:"dtype",notSupported:!0},{tfName:"dilation",name:"dilation",type:"number",defaultValue:1}]},{tfOpName:"Conv2D",category:"convolution",inputs:[{start:0,name:"x",type:"tensor"},{start:1,name:"filter",type:"tensor"}],attrs:[{tfName:"T",name:"dtype",type:"dtype",notSupported:!0},{tfName:"strides",name:"strides",type:"number[]"},{tfName:"padding",name:"pad",type:"string"},{tfName:"useCudnnOnGpu",name:"useCudnnOnGpu",type:"bool"},{tfName:"data_format",name:"dataFormat",type:"string",defaultValue:"NHWC"},{tfName:"dilations",name:"dilations",type:"number[]"}]},{tfOpName:"Conv2DBackpropInput",category:"convolution",inputs:[{start:2,name:"x",type:"tensor"},{start:1,name:"filter",type:"tensor"},{start:0,name:"outputShape",type:"number[]"}],attrs:[{tfName:"strides",name:"strides",type:"number[]"},{tfName:"padding",name:"pad",type:"string"},{tfName:"data_format",name:"dataFormat",type:"string",notSupported:!0}]},{tfOpName:"DepthwiseConv2d",category:"convolution",inputs:[{start:0,name:"input",type:"tensor"},{start:1,name:"filter",type:"tensor"}],attrs:[{tfName:"strides",name:"strides",type:"number[]"},{tfName:"padding",name:"pad",type:"string"},{tfName:"data_format",name:"dataFormat",type:"string",defaultValue:"NHWC"},{tfName:"dilations",name:"dilations",type:"number[]"}]},{tfOpName:"DepthwiseConv2dNative",category:"convolution",inputs:[{start:0,name:"input",type:"tensor"},{start:1,name:"filter",type:"tensor"}],attrs:[{tfName:"strides",name:"strides",type:"number[]"},{tfName:"padding",name:"pad",type:"string"},{tfName:"data_format",name:"dataFormat",type:"string",defaultValue:"NHWC"},{tfName:"dilations",name:"dilations",type:"number[]"}]}]}),x=Object.freeze({json:[{tfOpName:"Fill",category:"creation",inputs:[{start:0,name:"shape",type:"number[]"},{start:1,name:"value",type:"number"}],attrs:[{tfName:"T",name:"dtype",type:"dtype"}]},{tfOpName:"LinSpace",category:"creation",inputs:[{start:0,name:"start",type:"number"},{start:1,name:"stop",type:"number"},{start:2,name:"num",type:"number"}],attrs:[{tfName:"T",name:"dtype",type:"dtype",notSupported:!0}]},{tfOpName:"OneHot",category:"creation",inputs:[{start:0,name:"indices",type:"tensor"},{start:1,name:"depth",type:"number"},{start:2,name:"onValue",type:"number",defaultValue:1},{start:3,name:"offValue",type:"number",defaultValue:0}],attrs:[{tfName:"axis",name:"axis",type:"number",notSupported:!0},{tfName:"T",name:"dtype",type:"dtype",notSupported:!0}]},{tfOpName:"Ones",category:"creation",inputs:[{start:0,name:"shape",type:"number[]"}],attrs:[{tfName:"T",name:"dtype",type:"dtype"}]},{tfOpName:"OnesLike",category:"creation",inputs:[{start:0,name:"x",type:"tensor"}],attrs:[{tfName:"dtype",name:"dtype",type:"dtype"}]},{tfOpName:"RandomUniform",category:"creation",inputs:[{start:0,name:"shape",type:"number[]"}],attrs:[{tfName:"minval",name:"minval",type:"number",defaultValue:0},{tfName:"maxval",name:"maxval",type:"number",defaultValue:1},{tfName:"dtype",name:"dtype",type:"dtype"},{tfName:"seed",name:"seed",type:"number",defaultValue:0},{tfName:"seed2",name:"seed2",type:"number",defaultValue:0,notSupported:!0},{tfName:"T",name:"T",type:"number",notSupported:!0}]},{tfOpName:"Range",category:"creation",inputs:[{start:0,name:"start",type:"number"},{start:1,name:"stop",type:"number"},{start:2,name:"step",type:"number",defaultValue:0}],attrs:[{tfName:"Tidx",name:"dtype",type:"dtype"}]},{tfOpName:"TruncatedNormal",category:"creation",inputs:[{start:0,name:"shape",type:"number[]"}],attrs:[{tfName:"means",name:"mean",type:"number",defaultValue:0},{tfName:"stddev",name:"stdDev",type:"number",defaultValue:1},{tfName:"seed",name:"seed",type:"number"},{tfName:"seed2",name:"seed2",type:"number",defaultValue:0,notSupported:!0},{tfName:"dtype",name:"dtype",type:"dtype"},{tfName:"T",name:"T",type:"number",notSupported:!0}]},{tfOpName:"Zeros",category:"creation",inputs:[{start:0,name:"shape",type:"number[]"}],attrs:[{tfName:"T",name:"dtype",type:"dtype"}]},{tfOpName:"ZerosLike",category:"creation",inputs:[{start:0,name:"x",type:"tensor"}],attrs:[{tfName:"T",name:"dtype",type:"dtype"}]}]}),T=Object.freeze({json:[{tfOpName:"NonMaxSuppressionV2",category:"dynamic",inputs:[{start:0,name:"boxes",type:"tensor"},{start:1,name:"scores",type:"tensor"},{start:2,name:"maxOutputSize",type:"number"},{start:3,name:"iouThreshold",type:"number"}]},{tfOpName:"NonMaxSuppressionV3",category:"dynamic",inputs:[{start:0,name:"boxes",type:"tensor"},{start:1,name:"scores",type:"tensor"},{start:2,name:"maxOutputSize",type:"number"},{start:3,name:"iouThreshold",type:"number"},{start:4,name:"scoreThreshold",type:"number"}]},{tfOpName:"Where",category:"dynamic",inputs:[{start:0,name:"condition",type:"tensor"}],attrs:[{tfName:"T",name:"dtype",type:"dtype",notSupported:!0}]},{tfOpName:"ListDiff",category:"dynamic",inputs:[{start:0,name:"x",type:"tensor"},{start:1,name:"y",type:"tensor"}],attrs:[{tfName:"T",name:"dtype",type:"dtype",notSupported:!0}]}]}),v=Object.freeze({json:[{tfOpName:"TopKV2",category:"evaluation",inputs:[{start:0,name:"x",type:"tensor"},{start:1,name:"k",type:"number"}],attrs:[{tfName:"sorted",name:"sorted",type:"bool"}]}]}),O=Object.freeze({json:[{tfOpName:"PlaceholderWithDefault",category:"graph",inputs:[{start:0,name:"default",type:"tensor"}],attrs:[{tfName:"shape",name:"shape",type:"shape"},{tfName:"dtype",name:"dtype",type:"dtype"}]},{tfOpName:"Placeholder",category:"graph",attrs:[{tfName:"shape",name:"shape",type:"shape"},{tfName:"dtype",name:"dtype",type:"dtype"}]},{tfOpName:"Const",category:"graph"},{tfOpName:"Identity",category:"graph",inputs:[{start:0,name:"x",type:"tensor"}]},{tfOpName:"IdentityN",category:"graph",inputs:[{start:0,end:0,name:"x",type:"tensors"}]},{tfOpName:"Snapshot",category:"graph",inputs:[{start:0,name:"x",type:"tensor"}]},{tfOpName:"Rank",category:"graph",inputs:[{start:0,name:"x",type:"tensor"}]},{tfOpName:"Size",category:"graph",inputs:[{start:0,name:"x",type:"tensor"}]},{tfOpName:"Shape",category:"graph",inputs:[{start:0,name:"x",type:"tensor"}]},{tfOpName:"ShapeN",category:"graph",inputs:[{start:0,end:0,name:"x",type:"tensors"}]},{tfOpName:"Print",category:"graph",inputs:[{start:0,name:"x",type:"tensor"},{start:1,name:"data",type:"tensors"}],attrs:[{tfName:"message",name:"message",type:"string"},{tfName:"first_n",name:"firstN",type:"number",notSupported:!0},{tfName:"summarize",name:"summarize",type:"number",defaultValue:3}]},{tfOpName:"NoOp",category:"graph",inputs:[]},{tfOpName:"StopGradient",category:"graph",inputs:[{start:0,name:"x",type:"tensor"}]},{tfOpName:"FakeQuantWithMinMaxVars",category:"graph",inputs:[{start:0,name:"x",type:"tensor"}],attrs:[{tfName:"min",name:"min",type:"number"},{tfName:"max",name:"max",type:"number"}]}]}),S=Object.freeze({json:[{tfOpName:"ResizeBilinear",category:"image",inputs:[{start:0,name:"images",type:"tensor"},{start:1,name:"size",type:"number[]"}],attrs:[{tfName:"align_corners",name:"alignCorners",type:"bool"},{tfName:"T",name:"dtype",type:"dtype",notSupported:!0}]},{tfOpName:"ResizeNearestNeighbor",category:"image",inputs:[{start:0,name:"images",type:"tensor"},{start:1,name:"size",type:"number[]"}],attrs:[{tfName:"align_corners",name:"alignCorners",type:"bool"},{tfName:"T",name:"dtype",type:"dtype",notSupported:!0}]},{tfOpName:"CropAndResize",category:"image",inputs:[{start:0,name:"image",type:"tensor"},{start:1,name:"boxes",type:"tensor"},{start:2,name:"boxInd",type:"tensor"},{start:3,name:"cropSize",type:"number[]"}],attrs:[{tfName:"method",name:"method",type:"string"},{tfName:"extrapolation_value",name:"extrapolationValue",type:"number"}]}]}),w=Object.freeze({json:[{tfOpName:"Equal",category:"logical",inputs:[{start:0,name:"a",type:"tensor"},{start:1,name:"b",type:"tensor"}],attrs:[{tfName:"T",name:"dtype",type:"dtype",notSupported:!0}]},{tfOpName:"NotEqual",category:"logical",inputs:[{start:0,name:"a",type:"tensor"},{start:1,name:"b",type:"tensor"}],attrs:[{tfName:"T",name:"dtype",type:"dtype",notSupported:!0}]},{tfOpName:"Greater",category:"logical",inputs:[{start:0,name:"a",type:"tensor"},{start:1,name:"b",type:"tensor"}],attrs:[{tfName:"T",name:"dtype",type:"dtype",notSupported:!0}]},{tfOpName:"GreaterEqual",category:"logical",inputs:[{start:0,name:"a",type:"tensor"},{start:1,name:"b",type:"tensor"}],attrs:[{tfName:"T",name:"dtype",type:"dtype",notSupported:!0}]},{tfOpName:"Less",category:"logical",inputs:[{start:0,name:"a",type:"tensor"},{start:1,name:"b",type:"tensor"}],attrs:[{tfName:"T",name:"dtype",type:"dtype",notSupported:!0}]},{tfOpName:"LessEqual",category:"logical",inputs:[{start:0,name:"a",type:"tensor"},{start:1,name:"b",type:"tensor"}],attrs:[{tfName:"T",name:"dtype",type:"dtype",notSupported:!0}]},{tfOpName:"LogicalAnd",category:"logical",inputs:[{start:0,name:"a",type:"tensor"},{start:1,name:"b",type:"tensor"}],attrs:[{tfName:"T",name:"dtype",type:"dtype",notSupported:!0}]},{tfOpName:"LogicalNot",category:"logical",inputs:[{start:0,name:"a",type:"tensor"}],attrs:[{tfName:"T",name:"dtype",type:"dtype",notSupported:!0}]},{tfOpName:"LogicalOr",category:"logical",inputs:[{start:0,name:"a",type:"tensor"},{start:1,name:"b",type:"tensor"}],attrs:[{tfName:"T",name:"dtype",type:"dtype",notSupported:!0}]},{tfOpName:"Select",category:"logical",inputs:[{start:0,name:"condition",type:"tensor"},{start:1,name:"a",type:"tensor"},{start:2,name:"b",type:"tensor"}],attrs:[{tfName:"T",name:"dtype",type:"dtype",notSupported:!0}]}]}),_=Object.freeze({json:[{tfOpName:"MatMul",category:"matrices",inputs:[{start:0,name:"a",type:"tensor"},{start:1,name:"b",type:"tensor"}],attrs:[{tfName:"transpose_a",name:"transposeA",type:"bool",defaultValue:!1},{tfName:"transpose_b",name:"transposeB",type:"bool",defaultValue:!1},{tfName:"T",name:"dtype",type:"dtype",notSupported:!0}]},{tfOpName:"BatchMatMul",category:"matrices",inputs:[{start:0,name:"a",type:"tensor"},{start:1,name:"b",type:"tensor"}],attrs:[{tfName:"adj_x",name:"transposeA",type:"bool",defaultValue:!1},{tfName:"adj_y",name:"transposeB",type:"bool",defaultValue:!1},{tfName:"T",name:"dtype",type:"dtype",notSupported:!0}]},{tfOpName:"BatchMatMulV2",category:"matrices",inputs:[{start:0,name:"a",type:"tensor"},{start:1,name:"b",type:"tensor"}],attrs:[{tfName:"adj_x",name:"transposeA",type:"bool",defaultValue:!1},{tfName:"adj_y",name:"transposeB",type:"bool",defaultValue:!1},{tfName:"T",name:"dtype",type:"dtype",notSupported:!0}]},{tfOpName:"Transpose",category:"matrices",inputs:[{start:0,name:"x",type:"tensor"},{start:1,name:"perm",type:"number[]"}],attrs:[{tfName:"T",name:"dtype",type:"dtype",notSupported:!0}]}]}),A=Object.freeze({json:[{tfOpName:"FusedBatchNorm",category:"normalization",inputs:[{start:0,name:"x",type:"tensor"},{start:1,name:"scale",type:"tensor"},{start:2,name:"offset",type:"tensor"},{start:3,name:"mean",type:"tensor"},{start:4,name:"variance",type:"tensor"}],attrs:[{tfName:"epsilon",name:"epsilon",type:"number",defaultValue:.001},{tfName:"data_format",name:"dataFormat",type:"string",notSupported:!0}]},{tfOpName:"FusedBatchNormV2",category:"normalization",inputs:[{start:0,name:"x",type:"tensor"},{start:1,name:"scale",type:"tensor"},{start:2,name:"offset",type:"tensor"},{start:3,name:"mean",type:"tensor"},{start:4,name:"variance",type:"tensor"}],attrs:[{tfName:"epsilon",name:"epsilon",type:"number",defaultValue:.001},{tfName:"data_format",name:"dataFormat",type:"string",notSupported:!0}]},{tfOpName:"FusedBatchNormV3",category:"normalization",inputs:[{start:0,name:"x",type:"tensor"},{start:1,name:"scale",type:"tensor"},{start:2,name:"offset",type:"tensor"},{start:3,name:"mean",type:"tensor"},{start:4,name:"variance",type:"tensor"}],attrs:[{tfName:"epsilon",name:"epsilon",type:"number",defaultValue:.001},{tfName:"data_format",name:"dataFormat",type:"string",notSupported:!0}]},{tfOpName:"LRN",category:"normalization",inputs:[{start:0,name:"x",type:"tensor"}],attrs:[{tfName:"depth_radius",name:"radius",type:"number",defaultValue:5},{tfName:"bias",name:"bias",type:"number",defaultValue:1},{tfName:"alpha",name:"alpha",type:"number",defaultValue:1},{tfName:"beta",name:"beta",type:"number",defaultValue:.5}]},{tfOpName:"Softmax",category:"normalization",inputs:[{start:0,name:"x",type:"tensor"}]},{tfOpName:"LogSoftmax",category:"normalization",inputs:[{start:0,name:"x",type:"tensor"}]},{tfOpName:"SparseToDense",category:"normalization",inputs:[{start:0,name:"sparseIndices",type:"tensor"},{start:1,name:"outputShape",type:"number[]"},{start:2,name:"sparseValues",type:"tensor"},{start:3,name:"defaultValue",type:"tensor"}],attrs:[{tfName:"validate_indices",name:"validateIndices",type:"bool",defaultValue:!0,notSupported:!0}]}]}),E=Object.freeze({json:[{tfOpName:"Max",category:"reduction",inputs:[{start:0,name:"x",type:"tensor"},{start:1,name:"axis",type:"number[]"}],attrs:[{tfName:"keep_dims",name:"keepDims",type:"bool"}]},{tfOpName:"Mean",category:"reduction",inputs:[{start:0,name:"x",type:"tensor"},{start:1,name:"axis",type:"number[]"}],attrs:[{tfName:"keep_dims",name:"keepDims",type:"bool"}]},{tfOpName:"Min",category:"reduction",inputs:[{start:0,name:"x",type:"tensor"},{start:1,name:"axis",type:"number[]"}],attrs:[{tfName:"keep_dims",name:"keepDims",type:"bool"}]},{tfOpName:"Sum",category:"reduction",inputs:[{start:0,name:"x",type:"tensor"},{start:1,name:"axis",type:"number[]"}],attrs:[{tfName:"keep_dims",name:"keepDims",type:"bool"}]},{tfOpName:"All",category:"reduction",inputs:[{start:0,name:"x",type:"tensor"},{start:1,name:"axis",type:"number[]"}],attrs:[{tfName:"keep_dims",name:"keepDims",type:"bool"}]},{tfOpName:"Any",category:"reduction",inputs:[{start:0,name:"x",type:"tensor"},{start:1,name:"axis",type:"number[]"}],attrs:[{tfName:"keep_dims",name:"keepDims",type:"bool"}]},{tfOpName:"ArgMax",category:"reduction",inputs:[{start:0,name:"x",type:"tensor"},{start:1,name:"axis",type:"number"}]},{tfOpName:"ArgMin",category:"reduction",inputs:[{start:0,name:"x",type:"tensor"},{start:1,name:"axis",type:"number"}]},{tfOpName:"Prod",category:"reduction",inputs:[{start:0,name:"x",type:"tensor"},{start:1,name:"axis",type:"number[]"}],attrs:[{tfName:"keep_dims",name:"keepDims",type:"bool"}]}]}),I=Object.freeze({json:[{tfOpName:"ConcatV2",category:"slice_join",inputs:[{start:0,end:-1,name:"tensors",type:"tensors"},{start:-1,name:"axis",type:"number"}]},{tfOpName:"Concat",category:"slice_join",inputs:[{start:1,end:0,name:"tensors",type:"tensors"},{start:0,name:"axis",type:"number"}]},{tfOpName:"GatherV2",category:"slice_join",inputs:[{start:0,name:"x",type:"tensor"},{start:1,name:"indices",type:"tensor"},{start:2,name:"axis",type:"number",defaultValue:0}]},{tfOpName:"Gather",category:"slice_join",inputs:[{start:0,name:"x",type:"tensor"},{start:1,name:"indices",type:"tensor"}],attrs:[{tfName:"axis",name:"axis",type:"number",defaultValue:0},{tfName:"validate_indices",name:"validateIndices",type:"bool",notSupported:!0}]},{tfOpName:"Reverse",category:"slice_join",inputs:[{start:0,name:"x",type:"tensor"},{start:1,name:"dims",type:"bool",notSupported:!0}]},{tfOpName:"ReverseV2",category:"slice_join",inputs:[{start:0,name:"x",type:"tensor"},{start:1,name:"axis",type:"number[]"}]},{tfOpName:"Slice",category:"slice_join",inputs:[{start:0,name:"x",type:"tensor"},{start:1,name:"begin",type:"number[]"},{start:2,name:"size",type:"number[]"}]},{tfOpName:"StridedSlice",category:"slice_join",inputs:[{start:0,name:"x",type:"tensor"},{start:1,name:"begin",type:"number[]"},{start:2,name:"end",type:"number[]"},{start:3,name:"strides",type:"number[]"}],attrs:[{tfName:"begin_mask",name:"beginMask",type:"number",defaultValue:0},{tfName:"end_mask",name:"endMask",type:"number",defaultValue:0},{tfName:"new_axis_mask",name:"newAxisMask",type:"number",defaultValue:0},{tfName:"ellipsis_mask",name:"ellipsisMask",type:"number",defaultValue:0},{tfName:"shrink_axis_mask",name:"shrinkAxisMask",type:"number",defaultValue:0}]},{tfOpName:"Pack",category:"slice_join",inputs:[{start:0,end:0,name:"tensors",type:"tensors"}],attrs:[{tfName:"axis",name:"axis",type:"number",defaultValue:0}]},{tfOpName:"Unpack",category:"slice_join",inputs:[{start:0,name:"tensor",type:"tensor"}],attrs:[{tfName:"axis",name:"axis",type:"number",defaultValue:0},{tfName:"num",name:"num",type:"number",defaultValue:0,notSupported:!0}]},{tfOpName:"Tile",category:"slice_join",inputs:[{start:0,name:"x",type:"tensor"},{start:1,name:"reps",type:"number[]"}]},{tfOpName:"Split",category:"slice_join",inputs:[{start:0,name:"axis",type:"number",defaultValue:0},{start:1,name:"x",type:"tensor"}],attrs:[{tfName:"num_split",name:"numOrSizeSplits",type:"number",defaultValue:1}]},{tfOpName:"SplitV",category:"slice_join",inputs:[{start:0,name:"x",type:"tensor"},{start:1,name:"numOrSizeSplits",type:"number[]"},{start:2,name:"axis",type:"number",defaultValue:0}]},{tfOpName:"ScatterNd",category:"slice_join",inputs:[{start:0,name:"indices",type:"tensor"},{start:1,name:"values",type:"tensor"},{start:2,name:"shape",type:"number[]"}]},{tfOpName:"GatherNd",category:"slice_join",inputs:[{start:0,name:"x",type:"tensor"},{start:1,name:"indices",type:"tensor"}]},{tfOpName:"SparseToDense",category:"slice_join",inputs:[{start:0,name:"sparseIndices",type:"tensor"},{start:1,name:"outputShape",type:"number[]"},{start:2,name:"sparseValues",type:"tensor"},{start:3,name:"defaultValue",type:"tensor"}],attrs:[{tfName:"validate_indices",name:"validateIndices",type:"bool",defaultValue:!1,notSupported:!0}]}]}),D=Object.freeze({json:[{tfOpName:"FFT",category:"spectral",inputs:[{start:0,name:"x",type:"tensor"}]},{tfOpName:"IFFT",category:"spectral",inputs:[{start:0,name:"x",type:"tensor"}]},{tfOpName:"RFFT",category:"spectral",inputs:[{start:0,name:"x",type:"tensor"},{start:1,name:"fft_length",type:"number",notSupported:!0}]},{tfOpName:"IRFFT",category:"spectral",inputs:[{start:0,name:"x",type:"tensor"},{start:1,name:"fft_length",type:"number",notSupported:!0}]}]}),V=Object.freeze({json:[{tfOpName:"Cast",category:"transformation",inputs:[{start:0,name:"x",type:"tensor"}],attrs:[{tfName:"SrcT",name:"sdtype",type:"dtype",notSupported:!0},{tfName:"DstT",name:"dtype",type:"dtype"}]},{tfOpName:"ExpandDims",category:"transformation",inputs:[{start:0,name:"x",type:"tensor"},{start:1,name:"axis",type:"number"}]},{tfOpName:"Pad",category:"transformation",inputs:[{start:0,name:"x",type:"tensor"},{start:1,name:"padding",type:"number[]"}],attrs:[{tfName:"constant_value",name:"constantValue",type:"number",defaultValue:0}]},{tfOpName:"PadV2",category:"transformation",inputs:[{start:0,name:"x",type:"tensor"},{start:1,name:"padding",type:"number[]"},{start:2,name:"constantValue",type:"number",defaultValue:0}]},{tfOpName:"Reshape",category:"transformation",inputs:[{start:0,name:"x",type:"tensor"},{start:1,name:"shape",type:"number[]"}]},{tfOpName:"Squeeze",category:"transformation",inputs:[{start:0,name:"x",type:"tensor"}],attrs:[{tfName:"axis",tfDeprecatedName:"squeeze_dims",name:"axis",type:"number[]"}]},{tfOpName:"SpaceToBatchND",category:"transformation",inputs:[{start:0,name:"x",type:"tensor"},{start:1,name:"blockShape",type:"number[]"},{start:2,name:"paddings",type:"number[]"}]},{tfOpName:"BatchToSpaceND",category:"transformation",inputs:[{start:0,name:"x",type:"tensor"},{start:1,name:"blockShape",type:"number[]"},{start:2,name:"crops",type:"number[]"}]},{tfOpName:"DepthToSpace",category:"transformation",inputs:[{start:0,name:"x",type:"tensor"}],attrs:[{tfName:"block_size",name:"blockSize",type:"number"},{tfName:"data_format",name:"dataFormat",type:"string"}]}]}),k=function(){function e(){var e=[h,N,g,b,x,T,v,w,S,O,_,A,E,I,D,V],t=[].concat.apply([],e.map(function(e){return e.json}));this.opMappers=t.reduce(function(e,t){return e[t.tfOpName]=t,e},{})}return Object.defineProperty(e,"Instance",{get:function(){return this._instance||(this._instance=new this)},enumerable:!0,configurable:!0}),e.prototype.transformGraph=function(e){var t=this,a=[],r=[],n=e.node.reduce(function(e,n){return e[n.name]=t.mapNode(n),"Placeholder"===n.op&&a.push(e[n.name]),"Const"===n.op&&r.push(e[n.name]),e},{}),s=[],o=[],p=Object.keys(n);return p.forEach(function(e){var t=n[e];t.inputNames.forEach(function(e){var a=d(e)[0];t.inputs.push(n[a]),n[a].children.push(t)}),0===t.inputs.length&&s.push(t)}),p.forEach(function(e){var t=n[e];0===t.children.length&&o.push(t)}),{nodes:n,inputs:s,outputs:o,weights:r,placeholders:a}},e.prototype.mapNode=function(e){var t=u(e.op)||this.opMappers[e.op]||{};null==e.attr&&(e.attr={});var a={name:e.name,op:e.op,category:t.category,inputNames:(e.input||[]).map(function(e){return e.startsWith("^")?e.substr(1):e}),inputs:[],children:[],inputParams:{},attrParams:{},rawAttrs:e.attr};return null!=t.inputs&&(a.inputParams=t.inputs.reduce(function(e,t){return e[t.name]={type:t.type,inputIndexStart:t.start,inputIndexEnd:t.end},e},{})),null!=t.attrs&&(a.attrParams=t.attrs.reduce(function(t,a){var r=a.type,n=void 0;switch(a.type){case"string":void 0===(n=z(e.attr,a.tfName,a.defaultValue))&&a.tfDeprecatedName&&(n=z(e.attr,a.tfDeprecatedName,a.defaultValue));break;case"string[]":void 0===(n=U(e.attr,a.tfName,a.defaultValue))&&a.tfDeprecatedName&&(n=U(e.attr,a.tfDeprecatedName,a.defaultValue));break;case"number":void 0===(n=F(e.attr,a.tfName,a.defaultValue||0))&&a.tfDeprecatedName&&(n=F(e.attr,a.tfDeprecatedName,a.defaultValue));break;case"number[]":void 0===(n=q(e.attr,a.tfName,a.defaultValue))&&a.tfDeprecatedName&&(n=q(e.attr,a.tfDeprecatedName,a.defaultValue));break;case"bool":void 0===(n=C(e.attr,a.tfName,a.defaultValue))&&a.tfDeprecatedName&&(n=C(e.attr,a.tfDeprecatedName,a.defaultValue));break;case"bool[]":void 0===(n=W(e.attr,a.tfName,a.defaultValue))&&a.tfDeprecatedName&&(n=W(e.attr,a.tfDeprecatedName,a.defaultValue));break;case"shape":void 0===(n=B(e.attr,a.tfName,a.defaultValue))&&a.tfDeprecatedName&&(n=B(e.attr,a.tfDeprecatedName,a.defaultValue));break;case"shape[]":void 0===(n=G(e.attr,a.tfName,a.defaultValue))&&a.tfDeprecatedName&&(n=G(e.attr,a.tfDeprecatedName,a.defaultValue));break;case"dtype":void 0===(n=P(e.attr,a.tfName,a.defaultValue))&&a.tfDeprecatedName&&(n=P(e.attr,a.tfDeprecatedName,a.defaultValue));break;case"dtype[]":void 0===(n=R(e.attr,a.tfName,a.defaultValue))&&a.tfDeprecatedName&&(n=R(e.attr,a.tfDeprecatedName,a.defaultValue));break;case"tensor":case"tensors":break;default:throw new Error("Unsupported param type: "+a.type+" for op: "+e.op)}return t[a.name]={value:n,type:r},t},{})),a},e}();function M(e,a){var r=Array.isArray(e)?String.fromCharCode.apply(null,e):function(e){var a=t.ENV.global;if(void 0!==a.atob)return a.atob(e);if("undefined"!=typeof Buffer)return new Buffer(e,"base64").toString();throw new Error("Unable to decode base64 in this environment. Missing built-in atob() or Buffer()")}(e);return a?r:r.toLowerCase()}function z(e,t,a,r){void 0===r&&(r=!1);var n=e[t];return null!=n?M(n.s,r):a}function C(e,t,a){var r=e[t];return r?r.b:a}function F(e,t,a){var r=e[t]||{},n=null!=r.i?r.i:null!=r.f?r.f:a;return"number"==typeof n?n:parseInt(n,10)}function j(e){switch("string"==typeof e&&(e=s[e]),e){case s.DT_FLOAT:return"float32";case s.DT_INT32:return"int32";case s.DT_BOOL:return"bool";case s.DT_DOUBLE:return"float32";case s.DT_STRING:return"string";default:return null}}function P(e,t,a){var r=e[t];return r&&r.type?j(r.type):a}function R(e,t,a){var r=e[t];return r&&r.list&&r.list.type?r.list.type.map(function(e){return j(e)}):a}function L(e){if(!e.unknownRank)return null!=e.dim?e.dim.map(function(e){return"number"==typeof e.size?e.size:parseInt(e.size,10)}):[]}function B(e,t,a){var r=e[t];return r&&r.shape?L(r.shape):a}function q(e,t,a){var r=e[t];return r?(r.list.f&&r.list.f.length?r.list.f:r.list.i).map(function(e){return"number"==typeof e?e:parseInt(e,10)}):a}function U(e,t,a,r){void 0===r&&(r=!1);var n=e[t];return n&&n.list&&n.list.s?n.list.s.map(function(e){return M(e,r)}):a}function G(e,t,a){var r=e[t];return r&&r.list&&r.list.shape?r.list.shape.map(function(e){return L(e)}):a}function W(e,t,a){var r=e[t];return r&&r.list&&r.list.b?r.list.b:a}var H=function(){function e(e,t,a){var r=this;this.node=e,this.tensorMap=t,this.context=a,this.inputs=[],this.attrs={},this.inputs=e.inputNames.map(function(e){return r.getInput(e)}),null!=e.rawAttrs&&(this.attrs=Object.keys(e.rawAttrs).reduce(function(e,t){return e[t]=r.getAttr(t),e},{}))}return e.prototype.getInput=function(e){return c(e,this.tensorMap,this.context)},e.prototype.getAttr=function(e,t){var a=this.node.rawAttrs[e];if(null!=a.tensor)return c(e,this.tensorMap,this.context);if(null!=a.i||null!=a.f)return F(this.node.rawAttrs,e,t);if(null!=a.s)return z(this.node.rawAttrs,e,t);if(null!=a.b)return C(this.node.rawAttrs,e,t);if(null!=a.shape)return B(this.node.rawAttrs,e,t);if(null!=a.type)return P(this.node.rawAttrs,e,t);if(null!=a.list){if(null!=a.list.i||null!=a.list.f)return q(this.node.rawAttrs,e,t);if(null!=a.list.s)return U(this.node.rawAttrs,e,t);if(null!=a.list.shape)return G(this.node.rawAttrs,e,t);if(null!=a.list.b)return W(this.node.rawAttrs,e,t);if(null!=a.list.type)return R(this.node.rawAttrs,e,t)}return t},e}(),Q=function(e,a,r){switch(e.op){case"BiasAdd":case"AddV2":case"Add":return[t.add(m("a",e,a,r),m("b",e,a,r))];case"AddN":return[t.addN(m("tensors",e,a,r))];case"FloorMod":case"Mod":return[t.mod(m("a",e,a,r),m("b",e,a,r))];case"Mul":return[t.mul(m("a",e,a,r),m("b",e,a,r))];case"RealDiv":case"Div":return[t.div(m("a",e,a,r),m("b",e,a,r))];case"FloorDiv":return[t.floorDiv(m("a",e,a,r),m("b",e,a,r))];case"Sub":return[t.sub(m("a",e,a,r),m("b",e,a,r))];case"Minimum":return[t.minimum(m("a",e,a,r),m("b",e,a,r))];case"Maximum":return[t.maximum(m("a",e,a,r),m("b",e,a,r))];case"Pow":return[t.pow(m("a",e,a,r),m("b",e,a,r))];case"SquaredDifference":return[t.squaredDifference(m("a",e,a,r),m("b",e,a,r))];default:throw TypeError("Node type "+e.op+" is not implemented")}},K=function(e,a,r){switch(e.op){case"Abs":case"ComplexAbs":return[t.abs(m("x",e,a,r))];case"Acos":return[t.acos(m("x",e,a,r))];case"Acosh":return[t.acosh(m("x",e,a,r))];case"Asin":return[t.asin(m("x",e,a,r))];case"Asinh":return[t.asinh(m("x",e,a,r))];case"Atan":return[t.atan(m("x",e,a,r))];case"Atan2":return[t.atan2(m("x",e,a,r),m("y",e,a,r))];case"Atanh":return[t.atanh(m("x",e,a,r))];case"Ceil":return[t.ceil(m("x",e,a,r))];case"Complex":return[t.complex(m("real",e,a,r),m("imag",e,a,r))];case"Cos":return[t.cos(m("x",e,a,r))];case"Cosh":return[t.cosh(m("x",e,a,r))];case"Elu":return[t.elu(m("x",e,a,r))];case"Erf":return[t.erf(m("x",e,a,r))];case"Exp":return[t.exp(m("x",e,a,r))];case"Expm1":return[t.expm1(m("x",e,a,r))];case"Floor":return[t.floor(m("x",e,a,r))];case"Log":return[t.log(m("x",e,a,r))];case"Log1p":return[t.log1p(m("x",e,a,r))];case"Neg":return[t.neg(m("x",e,a,r))];case"Reciprocal":return[t.reciprocal(m("x",e,a,r))];case"Relu":return[t.relu(m("x",e,a,r))];case"Round":return[t.round(m("x",e,a,r))];case"Selu":return[t.selu(m("x",e,a,r))];case"Sigmoid":return[t.sigmoid(m("x",e,a,r))];case"Sin":return[t.sin(m("x",e,a,r))];case"Sign":return[t.sign(m("x",e,a,r))];case"Sinh":return[t.sinh(m("x",e,a,r))];case"Softplus":return[t.softplus(m("x",e,a,r))];case"Sqrt":return[t.sqrt(m("x",e,a,r))];case"Square":return[t.square(m("x",e,a,r))];case"Tanh":return[t.tanh(m("x",e,a,r))];case"Tan":return[t.tan(m("x",e,a,r))];case"Relu6":case"ClipByValue":return[t.clipByValue(m("x",e,a,r),m("clipValueMin",e,a,r),m("clipValueMax",e,a,r))];case"Rsqrt":return[t.rsqrt(c(e.inputNames[0],a,r))];case"Prod":return[t.prod(m("x",e,a,r),m("axes",e,a,r))];case"LeakyRelu":return[t.leakyRelu(m("x",e,a,r),m("alpha",e,a,r))];default:throw TypeError("Node type "+e.op+" is not implemented")}},X=function(){function e(t,a,r,n,s,o,p){this.name=t,this.dtype=a,this.maxSize=r,this.elementShape=n,this.identicalElementShapes=s,this.dynamicSize=o,this.clearAfterRead=p,this.tensors=[],this.closed_=!1,this.id=e.nextId++}return Object.defineProperty(e.prototype,"closed",{get:function(){return this.closed_},enumerable:!0,configurable:!0}),e.prototype.clearAndClose=function(){this.tensors.forEach(function(e){return e.tensor.dispose()}),this.tensors=[],this.closed_=!0},e.prototype.size=function(){return this.tensors.length},e.prototype.read=function(e){if(this.closed_)throw new Error("TensorArray "+this.name+" has already been closed.");if(e<0||e>=this.tensors.length)throw new Error("Tried to read from index "+e+", but array size is: "+this.tensors.length);var t=this.tensors[e];if(t.cleared)throw new Error("TensorArray "+this.name+": Could not read index "+e+" twice because it was cleared after a previous read (perhaps try setting clear_after_read = false?).");return this.clearAfterRead&&(t.cleared=!0),t.read=!0,t.tensor},e.prototype.readMany=function(e){var t=this;return e.map(function(e){return t.read(e)})},e.prototype.write=function(e,t){if(this.closed_)throw new Error("TensorArray "+this.name+" has already been closed.");if(e<0||!this.dynamicSize&&e>=this.maxSize)throw new Error("Tried to write to index "+e+", but array is not resizeable and size is: "+this.maxSize);var a=this.tensors[e]||{};if(t.dtype!==this.dtype)throw new Error("TensorArray "+this.name+": Could not write to TensorArray index "+e+",\n          because the value dtype is "+t.dtype+", but TensorArray dtype is "+this.dtype+".");if(0!==this.size()||null!=this.elementShape&&0!==this.elementShape.length||(this.elementShape=t.shape),this.assertShapesMatchAllowUndefinedSize(this.elementShape,t.shape,"TensorArray "+this.name+": Could not write to TensorArray index "+e+"."),a&&a.read)throw new Error("TensorArray "+this.name+": Could not write to TensorArray index "+e+", because it has already been read.");if(a&&a.written)throw new Error("TensorArray "+this.name+": Could not write to TensorArray index "+e+", because it has already been written.");a.tensor=t,a.written=!0,this.tensors[e]=a},e.prototype.writeMany=function(e,t){var a=this;if(e.length!==t.length)throw new Error("TensorArray "+this.name+": could not write multiple tensors,because the index size: "+e.length+" is not the same as tensors size: "+t.length+".");e.forEach(function(e,r){return a.write(e,t[r])})},e.prototype.gather=function(e,a){if(a&&a!==this.dtype)throw new Error("TensorArray dtype is "+this.dtype+" but gather requested dtype "+a);if(!e){e=[];for(var r=0;r<this.size();r++)e.push(r)}if(0===e.length)return t.tensor([],[0].concat(this.elementShape));var n=this.readMany(e);return this.assertShapesMatchAllowUndefinedSize(this.elementShape,n[0].shape,"TensorArray shape mismatch: "),t.stack(n,0)},e.prototype.concat=function(e){if(e&&e!==this.dtype)throw new Error("TensorArray dtype is "+this.dtype+" but concat requested dtype "+e);if(0===this.size())return t.tensor([],[0].concat(this.elementShape));for(var a=[],r=0;r<this.size();r++)a.push(r);var n=this.readMany(a);return this.assertShapesMatchAllowUndefinedSize(this.elementShape,n[0].shape,"TensorArray shape mismatch: tensor array shape ("+this.elementShape+") vs first tensor shape ("+n[0].shape+")"),t.concat(n,0)},e.prototype.scatter=function(e,a){if(a.dtype!==this.dtype)throw new Error("TensorArray dtype is "+this.dtype+" but tensor has dtype "+a.dtype);if(e.length!==a.shape[0])throw new Error("Expected len(indices) == tensor.shape[0], but saw: "+e.length+" vs. "+a.shape[0]);var r=Math.max.apply(Math,e);if(!this.dynamicSize&&r>=this.maxSize)throw new Error("Max index must be < array size ("+r+"  vs. "+this.maxSize+")");this.writeMany(e,t.unstack(a,0))},e.prototype.split=function(e,a){var r=this;if(a.dtype!==this.dtype)throw new Error("TensorArray dtype is "+this.dtype+" but tensor has dtype "+a.dtype);var n=0,s=e.map(function(e){return n+=e});if(n!==a.shape[0])throw new Error("Expected sum of lengths to be equal to\n          tensor.shape[0], but sum of lengths is\n        "+n+", and tensor's shape is: "+a.shape);if(!this.dynamicSize&&e.length!==this.maxSize)throw new Error("TensorArray's size is not equal to the size of lengths ("+this.maxSize+" vs. "+e.length+"), and the TensorArray is not marked as dynamically resizeable");var o=0===n?0:a.size/n,p=[];t.tidy(function(){a=a.reshape([1,n,o]);for(var i=0;i<e.length;++i){var u=[0,0===i?0:s[i-1],0],m=[1,e[i],o];p[i]=t.slice(a,u,m).reshape(r.elementShape)}return p});for(var i=[],u=0;u<e.length;u++)i[u]=u;this.writeMany(i,p)},e.prototype.assertShapesMatchAllowUndefinedSize=function(e,a,r){void 0===r&&(r=""),t.util.assert(this.shapesEqualAllowUndefinedSize(e,a),function(){return r+" Shapes "+e+" and "+a+" must match"})},e.prototype.shapesEqualAllowUndefinedSize=function(e,t){if(e.length!==t.length)return!1;for(var a=0;a<e.length;a++)if(-1!==e[a]&&-1!==t[a]&&e[a]!==t[a])return!1;return!0},e.nextId=0,e}();var Z=function(e,a,r){switch(e.op){case"Conv1D":var n=m("stride",e,a,r),s=m("pad",e,a,r),o=m("dataFormat",e,a,r).toUpperCase(),p=m("dilation",e,a,r);return[t.conv1d(m("x",e,a,r),m("filter",e,a,r),n,s,o,p)];case"Conv2D":n=m("strides",e,a,r),s=m("pad",e,a,r),o=m("dataFormat",e,a,r).toUpperCase();var i=m("dilations",e,a,r);return[t.conv2d(m("x",e,a,r),m("filter",e,a,r),[n[1],n[2]],s,o,[i[1],i[2]])];case"Conv2DBackpropInput":case"Conv2dTranspose":var u=m("outputShape",e,a,r);n=m("strides",e,a,r),s=m("pad",e,a,r);return[t.conv2dTranspose(m("x",e,a,r),m("filter",e,a,r),u,[n[1],n[2]],s)];case"DepthwiseConv2dNative":case"DepthwiseConv2d":n=m("strides",e,a,r),s=m("pad",e,a,r),i=m("dilations",e,a,r),o=m("dataFormat",e,a,r).toUpperCase();return[t.depthwiseConv2d(m("input",e,a,r),m("filter",e,a,r),[n[1],n[2]],s,o,[i[1],i[2]])];case"AvgPool":n=m("strides",e,a,r),s=m("pad",e,a,r);var c=m("kernelSize",e,a,r);return[t.avgPool(m("x",e,a,r),[c[1],c[2]],[n[1],n[2]],s)];case"MaxPool":n=m("strides",e,a,r),s=m("pad",e,a,r),c=m("kernelSize",e,a,r);return[t.maxPool(m("x",e,a,r),[c[1],c[2]],[n[1],n[2]],s)];default:throw TypeError("Node type "+e.op+" is not implemented")}},Y=function(e,a,r){switch(e.op){case"Fill":var n=m("shape",e,a,r),s=m("dtype",e,a,r),o=m("value",e,a,r);return[t.fill(n,o,s)];case"LinSpace":var p=m("start",e,a,r),i=m("stop",e,a,r),u=m("num",e,a,r);return[t.linspace(p,i,u)];case"OneHot":var c=m("indices",e,a,r),d=m("depth",e,a,r),y=m("onValue",e,a,r),l=m("offValue",e,a,r);return[t.oneHot(c,d,y,l)];case"Ones":return[t.ones(m("shape",e,a,r),m("dtype",e,a,r))];case"OnesLike":return[t.onesLike(m("x",e,a,r))];case"RandomUniform":return[t.randomUniform(m("shape",e,a,r),m("minval",e,a,r),m("maxval",e,a,r),m("dtype",e,a,r))];case"Range":p=m("start",e,a,r);var f=m("stop",e,a,r),h=m("step",e,a,r);return[t.range(p,f,h,m("dtype",e,a,r))];case"TruncatedNormal":n=m("shape",e,a,r);var N=m("mean",e,a,r),g=m("stdDev",e,a,r),b=m("seed",e,a,r);return[t.truncatedNormal(n,N,g,m("dtype",e,a,r),b)];case"Zeros":return[t.zeros(m("shape",e,a,r),m("dtype",e,a,r))];case"ZerosLike":return[t.zerosLike(m("x",e,a,r))];default:throw TypeError("Node type "+e.op+" is not implemented")}};var J=function(e,a,r){switch(e.op){case"TopKV2":var n=m("x",e,a,r),s=m("k",e,a,r),o=m("sorted",e,a,r),p=t.topk(n,s,o);return[p.values,p.indices];default:throw TypeError("Node type "+e.op+" is not implemented")}},$=function(e,a,r){switch(e.op){case"Const":return a[e.name];case"PlaceholderWithDefault":var n=m("default",e,a,r);return[c(e.name,a,r)||n];case"Placeholder":return[c(e.name,a,r)];case"Identity":case"StopGradient":case"FakeQuantWithMinMaxVars":return[m("x",e,a,r).clone()];case"IdentityN":return m("x",e,a,r).map(function(e){return e.clone()});case"Snapshot":return[m("x",e,a,r).clone()];case"Shape":return[t.tensor1d(m("x",e,a,r).shape,"int32")];case"ShapeN":return m("x",e,a,r).map(function(e){return t.tensor1d(e.shape)});case"Size":return[t.scalar(m("x",e,a,r).size,"int32")];case"Rank":return[t.scalar(m("x",e,a,r).rank,"int32")];case"NoOp":return[];case"Print":var s=m("x",e,a,r),o=m("data",e,a,r),p=m("message",e,a,r),i=m("summarize",e,a,r);console.warn("The graph has a tf.print() operation,usually used for debugging, which slows down performance."),console.log(p);for(var u=0;u<o.length;u++)console.log(Array.prototype.slice.call(o[u].dataSync()).slice(0,i));return[s];default:throw TypeError("Node type "+e.op+" is not implemented")}},ee=function(e,a,r){switch(e.op){case"ResizeBilinear":var n=m("images",e,a,r),s=m("size",e,a,r),o=m("alignCorners",e,a,r);return[t.image.resizeBilinear(n,[s[0],s[1]],o)];case"ResizeNearestNeighbor":n=m("images",e,a,r),s=m("size",e,a,r),o=m("alignCorners",e,a,r);return[t.image.resizeNearestNeighbor(n,[s[0],s[1]],o)];case"CropAndResize":var p=m("image",e,a,r),i=m("boxes",e,a,r),u=m("boxInd",e,a,r),c=m("cropSize",e,a,r),d=m("method",e,a,r),y=m("extrapolationValue",e,a,r);return[t.image.cropAndResize(p,i,u,c,d,y)];default:throw TypeError("Node type "+e.op+" is not implemented")}},te=function(e,a,r){switch(e.op){case"Equal":return[t.equal(m("a",e,a,r),m("b",e,a,r))];case"NotEqual":return[t.notEqual(m("a",e,a,r),m("b",e,a,r))];case"Greater":return[t.greater(m("a",e,a,r),m("b",e,a,r))];case"GreaterEqual":return[t.greaterEqual(m("a",e,a,r),m("b",e,a,r))];case"Less":return[t.less(m("a",e,a,r),m("b",e,a,r))];case"LessEqual":return[t.lessEqual(m("a",e,a,r),m("b",e,a,r))];case"LogicalAnd":return[t.logicalAnd(m("a",e,a,r),m("b",e,a,r))];case"LogicalNot":return[t.logicalNot(m("a",e,a,r))];case"LogicalOr":return[t.logicalOr(m("a",e,a,r),m("b",e,a,r))];case"Select":return[t.where(m("condition",e,a,r),m("a",e,a,r),m("b",e,a,r))];default:throw TypeError("Node type "+e.op+" is not implemented")}},ae=function(e,a,r){switch(e.op){case"BatchMatMul":case"BatchMatMulV2":case"MatMul":return[t.matMul(m("a",e,a,r),m("b",e,a,r),m("transposeA",e,a,r),m("transposeB",e,a,r))];case"Transpose":return[t.transpose(m("x",e,a,r),m("perm",e,a,r))];default:throw TypeError("Node type "+e.op+" is not implemented")}},re=function(e,a,r){switch(e.op){case"FusedBatchNorm":case"FusedBatchNormV2":case"FusedBatchNormV3":return[t.batchNorm(m("x",e,a,r),m("mean",e,a,r),m("variance",e,a,r),m("offset",e,a,r),m("scale",e,a,r),m("epsilon",e,a,r))];case"LRN":return[t.localResponseNormalization(m("x",e,a,r),m("radius",e,a,r),m("bias",e,a,r),m("alpha",e,a,r),m("beta",e,a,r))];case"Softmax":return[t.softmax(m("x",e,a,r))];case"LogSoftmax":return[t.logSoftmax(m("x",e,a,r))];case"SparseToDense":return[t.sparseToDense(m("sparseIndices",e,a,r),m("outputShape",e,a,r),m("sparseValues",e,a,r),m("defaultValue",e,a,r))];default:throw TypeError("Node type "+e.op+" is not implemented")}},ne=function(e,a,r){switch(e.op){case"Max":var n=m("axis",e,a,r),s=m("keepDims",e,a,r);return[t.max(m("x",e,a,r),n,s)];case"Mean":n=m("axis",e,a,r),s=m("keepDims",e,a,r);return[t.mean(m("x",e,a,r),n,s)];case"Min":n=m("axis",e,a,r),s=m("keepDims",e,a,r);return[t.min(m("x",e,a,r),n,s)];case"Sum":n=m("axis",e,a,r),s=m("keepDims",e,a,r);return[t.sum(m("x",e,a,r),n,s)];case"All":n=m("axis",e,a,r),s=m("keepDims",e,a,r);return[t.all(m("x",e,a,r),n,s)];case"Any":n=m("axis",e,a,r),s=m("keepDims",e,a,r);return[t.any(m("x",e,a,r),n,s)];case"ArgMax":n=m("axis",e,a,r);return[t.argMax(m("x",e,a,r),n)];case"ArgMin":n=m("axis",e,a,r);return[t.argMin(m("x",e,a,r),n)];case"Prod":n=m("axis",e,a,r),s=m("keepDims",e,a,r);return[t.prod(m("x",e,a,r),n,s)];default:throw TypeError("Node type "+e.op+" is not implemented")}},se=function(e,a,r){switch(e.op){case"ConcatV2":case"Concat":var n=m("axis",e,a,r),s=m("tensors",e,a,r);return[t.concat(s,n)];case"GatherV2":case"Gather":n=m("axis",e,a,r);var o=m("x",e,a,r),p=m("indices",e,a,r);return[t.gather(o,p.asType("int32"),n)];case"ReverseV2":case"Reverse":n=m("axis",e,a,r),o=m("x",e,a,r);return[t.reverse(o,n)];case"Slice":var i=m("begin",e,a,r),u=m("size",e,a,r);return[t.slice(m("x",e,a,r),i,u)];case"StridedSlice":i=m("begin",e,a,r);var c=m("end",e,a,r),d=m("strides",e,a,r),y=m("beginMask",e,a,r),l=m("endMask",e,a,r),f=m("ellipsisMask",e,a,r),h=m("newAxisMask",e,a,r),N=m("shrinkAxisMask",e,a,r),g=m("x",e,a,r);if(1===i.length&&g.shape.length>1)for(var b=1;b<g.shape.length;b++)i.push(0),c.push(g.shape[b]),d.push(d[0]);return[t.stridedSlice(g,i,c,d,y,l,f,h,N)];case"Pack":return t.tidy(function(){var n=m("axis",e,a,r),s=m("tensors",e,a,r),o=s[0].shape,p=s[0].squeeze().shape,i=s.map(function(e){var a=t.util.arraysEqual(e.shape,o);if(!a&&!t.util.arraysEqual(e.squeeze().shape,p))throw new Error("the input tensors shape does not match");return a?e:e.reshape(o)});return[t.stack(i,n)]});case"Unpack":return t.tidy(function(){var n=m("axis",e,a,r),s=m("tensor",e,a,r);return t.unstack(s,n)});case"Tile":var x=m("reps",e,a,r);return[t.tile(m("x",e,a,r),x)];case"Split":case"SplitV":n=m("axis",e,a,r);var T=m("numOrSizeSplits",e,a,r);return t.split(m("x",e,a,r),T,n);case"ScatterNd":p=m("indices",e,a,r);var v=m("values",e,a,r),O=m("shape",e,a,r);return[t.scatterND(p,v,O)];case"GatherNd":var S=m("x",e,a,r);p=m("indices",e,a,r);return[t.gatherND(S,p)];case"SparseToDense":p=m("sparseIndices",e,a,r),O=m("outputShape",e,a,r);var w=m("sparseValues",e,a,r),_=m("defaultValue",e,a,r);return[t.sparseToDense(p,w,O,w.dtype===_.dtype?_:_.asType(w.dtype))];default:throw TypeError("Node type "+e.op+" is not implemented")}},oe=function(e,a,r){switch(e.op){case"FFT":return[t.fft(m("x",e,a,r))];case"IFFT":return[t.ifft(m("x",e,a,r))];case"RFFT":return[t.rfft(m("x",e,a,r))];case"IRFFT":return[t.irfft(m("x",e,a,r))];default:throw TypeError("Node type "+e.op+" is not implemented")}},pe=function(e,a,r){switch(e.op){case"Cast":return[t.cast(m("x",e,a,r),m("dtype",e,a,r))];case"ExpandDims":var n=m("axis",e,a,r);return[t.expandDims(m("x",e,a,r),n)];case"Squeeze":n=m("axis",e,a,r);return[t.squeeze(m("x",e,a,r),n)];case"Reshape":return[t.reshape(m("x",e,a,r),m("shape",e,a,r))];case"PadV2":case"Pad":return[t.pad(m("x",e,a,r),f(m("padding",e,a,r),2),m("constantValue",e,a,r))];case"SpaceToBatchND":var s=m("blockShape",e,a,r),o=f(m("paddings",e,a,r),2);return[t.spaceToBatchND(m("x",e,a,r),s,o)];case"BatchToSpaceND":s=m("blockShape",e,a,r);var p=f(m("crops",e,a,r),2);return[t.batchToSpaceND(m("x",e,a,r),s,p)];case"DepthToSpace":var i=m("blockSize",e,a,r),u=m("dataFormat",e,a,r).toUpperCase();return[t.depthToSpace(m("x",e,a,r),i,u)];default:throw TypeError("Node type "+e.op+" is not implemented")}};function ie(e,a,s){var o=function(e,a,s){switch(e.category){case"arithmetic":return Q(e,a,s);case"basic_math":return K(e,a,s);case"control":return function(e,a,s){return r(this,void 0,void 0,function(){var r,o,p,i,u,d,y,l,f,h,N,g,b,x,T,v,O,S,w,_,A,E,I,D,V,k,M,z,C,F,j,P,R,L,B;return n(this,function(n){switch(n.label){case 0:switch(e.op){case"LoopCond":return[3,1];case"Switch":return[3,2];case"Merge":return[3,4];case"Enter":return[3,5];case"Exit":return[3,6];case"NextIteration":return[3,7];case"TensorArrayV3":return[3,8];case"TensorArrayWriteV3":return[3,9];case"TensorArrayReadV3":return[3,10];case"TensorArrayGatherV3":return[3,11];case"TensorArrayScatterV3":return[3,12];case"TensorArrayConcatV3":return[3,13];case"TensorArraySplitV3":return[3,14];case"TensorArraySizeV3":return[3,15];case"TensorArrayCloseV3":return[3,16]}return[3,17];case 1:return[2,[m("pred",e,a,s).clone()]];case 2:return r=m("pred",e,a,s),o=m("data",e,a,s),[4,r.data()];case 3:return[2,n.sent()[0]?[void 0,o.clone()]:[o.clone(),void 0]];case 4:return[2,(p=e.inputNames.find(function(e){return void 0!==c(e,a,s)}))?[c(p,a,s).clone()]:void 0];case 5:return i=m("frameName",e,a,s),u=m("tensor",e,a,s),s.enterFrame(i),[2,[u.clone()]];case 6:return d=m("tensor",e,a,s),s.exitFrame(),[2,[d.clone()]];case 7:return y=m("tensor",e,a,s),s.nextIteration(),[2,[y.clone()]];case 8:return l=m("size",e,a,s),f=m("dtype",e,a,s),h=m("elementShape",e,a,s),N=m("dynamicSize",e,a,s),g=m("clearAfterRead",e,a,s),b=m("identicalElementShapes",e,a,s),x=m("name",e,a,s),T=new X(x,f,l,h,b,N,g),s.addTensorArray(T),[2,[t.scalar(T.id),t.scalar(1)]];case 9:return v=m("tensorArrayId",e,a,s),O=m("index",e,a,s),S=m("tensor",e,a,s),s.getTensorArray(v).write(O,S),[2,[t.scalar(1)]];case 10:return w=m("tensorArrayId",e,a,s),_=m("index",e,a,s),[2,[s.getTensorArray(w).read(_)]];case 11:return A=m("tensorArrayId",e,a,s),E=m("indices",e,a,s),I=m("dtype",e,a,s),[2,[s.getTensorArray(A).gather(E,I)]];case 12:return D=m("tensorArrayId",e,a,s),V=m("indices",e,a,s),k=m("tensor",e,a,s),s.getTensorArray(D).scatter(V,k),[2,[t.scalar(1)]];case 13:return M=m("tensorArrayId",e,a,s),z=s.getTensorArray(M),C=m("dtype",e,a,s),[2,[z.concat(C)]];case 14:return F=m("tensorArrayId",e,a,s),j=m("tensor",e,a,s),P=m("lengths",e,a,s),s.getTensorArray(F).split(P,j),[2,[t.scalar(1)]];case 15:return R=m("tensorArrayId",e,a,s),L=s.getTensorArray(R),[2,[t.scalar(L.size(),"int32")]];case 16:return B=m("tensorArrayId",e,a,s),s.getTensorArray(B).clearAndClose(),[2,[]];case 17:throw TypeError("Node type "+e.op+" is not implemented")}})})}(e,a,s);case"convolution":return Z(e,a,s);case"creation":return Y(e,a,s);case"dynamic":return function(e,a,s){return r(this,void 0,void 0,function(){var r,o,p,i,u;return n(this,function(n){switch(n.label){case 0:switch(e.op){case"NonMaxSuppressionV3":case"NonMaxSuppressionV2":return[3,1];case"Where":return[3,3];case"ListDiff":return[3,5]}return[3,7];case 1:return r=m("boxes",e,a,s),o=m("scores",e,a,s),p=m("maxOutputSize",e,a,s),i=m("iouThreshold",e,a,s),u=m("scoreThreshold",e,a,s),[4,t.image.nonMaxSuppressionAsync(r,o,p,i,u)];case 2:return[2,[n.sent()]];case 3:return[4,t.whereAsync(m("condition",e,a,s))];case 4:return[2,[n.sent()]];case 5:return[4,t.setdiff1dAsync(m("x",e,a,s),m("y",e,a,s))];case 6:return[2,n.sent()];case 7:throw TypeError("Node type "+e.op+" is not implemented")}})})}(e,a,s);case"evaluation":return J(e,a,s);case"image":return ee(e,a,s);case"graph":return $(e,a,s);case"logical":return te(e,a,s);case"matrices":return ae(e,a,s);case"normalization":return re(e,a,s);case"reduction":return ne(e,a,s);case"slice_join":return se(e,a,s);case"spectral":return oe(e,a,s);case"transformation":return pe(e,a,s);case"custom":var o=u(e.op);if(o&&o.customExecutor)return o.customExecutor(new H(e,a,s));throw TypeError("Custom op "+e.op+" is not registered.");default:throw TypeError("Unknown op '"+e.op+"'. File an issue at https://github.com/tensorflow/tfjs/issues so we can add it, or register a custom execution with tf.registerOp()")}}(e,a,s);return o instanceof Promise?o.then(function(e){return[].concat(e)}):[].concat(o)}var ue=function(){function e(e,t){this.weightMap=e,this.tensorArrayMap=t,this.rootContext={id:0,frameName:"",iterationId:0},this.contexts=[this.rootContext],this.lastId=0,this.generateCurrentContextIds()}return e.prototype.newFrame=function(e,t){return{id:e,frameName:t,iterationId:0}},Object.defineProperty(e.prototype,"currentContext",{get:function(){return this.contexts},set:function(e){this.contexts!==e&&(this.contexts=e,this.generateCurrentContextIds())},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"currentContextId",{get:function(){return this._currentContextIds[0]},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"currentContextIds",{get:function(){return this._currentContextIds},enumerable:!0,configurable:!0}),e.prototype.generateCurrentContextIds=function(){for(var e=[],t=0;t<this.contexts.length-1;t++){var a=this.contexts.slice(0,this.contexts.length-t);e.push(this.contextIdforContexts(a))}e.push(""),this._currentContextIds=e},e.prototype.contextIdforContexts=function(e){return e?e.map(function(e){return 0===e.id&&0===e.iterationId?"":e.frameName+"-"+e.iterationId}).join("/"):""},e.prototype.enterFrame=function(e){this.contexts&&(this.lastId++,this.contexts=this.contexts.slice(),this.contexts.push(this.newFrame(this.lastId,e)),this._currentContextIds.unshift(this.contextIdforContexts(this.contexts)))},e.prototype.exitFrame=function(){if(!(this.contexts&&this.contexts.length>1))throw new Error("Cannot exit frame, the context is empty");this.contexts=this.contexts.slice(),this.contexts.splice(-1),this.currentContextIds.shift()},e.prototype.nextIteration=function(){if(!(this.contexts&&this.contexts.length>0))throw new Error("Cannot increase frame iteration, the context is empty");this.contexts=this.contexts.slice(),this.lastId++;var e=Object.assign({},this.contexts[this.contexts.length-1]);e.iterationId+=1,e.id=this.lastId,this.contexts.splice(-1,1,e),this._currentContextIds.splice(0,1,this.contextIdforContexts(this.contexts))},e.prototype.getWeight=function(e){return this.weightMap[e]},e.prototype.addTensorArray=function(e){this.tensorArrayMap[e.id]=e},e.prototype.getTensorArray=function(e){return this.tensorArrayMap[e]},e}();function me(e,t,a){for(var r=new Set,n=[],s=null,o=null,p=new Set,i=t.slice();i.length>0;){var u=i.pop();(ye(u)||le(u))&&null==s&&(o=(s=u).children.map(function(e){return e.name}).filter(function(e){return r.has(e)})),r.add(u.name),null==a[u.name]&&(null==e[u.name]&&(0!==u.inputs.length?u.inputs.forEach(function(e){p.has(e.name)||(p.add(e.name),i.push(e))}):n.push(u.name)))}return{inputs:e,outputs:t,usedNodes:r,missingInputs:n,dynamicNode:s,syncInputs:o}}var ce=["Switch","Merge","Enter","Exit","NextIteration"],de=["NonMaxSuppressionV2","NonMaxSuppressionV3","Where"];function ye(e){return ce.indexOf(e.op)>=0}function le(e){return de.indexOf(e.op)>=0}var fe=function(){function e(e){this.graph=e,this.compiledMap=new Map,this._weightMap={},this.SEPERATOR=",",this.placeholders=e.placeholders,this._outputs=e.outputs}return Object.defineProperty(e.prototype,"weightMap",{get:function(){return this._weightMap},set:function(e){var t=Object.keys(e).map(function(t){return e[t].map(function(e){return e.id})});this.weightIds=[].concat.apply([],t),this._weightMap=e},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"inputs",{get:function(){return this.placeholders.map(function(e){return{name:e.name,shape:e.attrParams.shape?e.attrParams.shape.value:void 0,dtype:e.attrParams.dtype?e.attrParams.dtype.value:void 0}})},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"outputs",{get:function(){return this._outputs.map(function(e){return{name:e.name,shape:e.attrParams.shape?e.attrParams.shape.value:void 0,dtype:e.attrParams.dtype?e.attrParams.dtype.value:void 0}})},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"inputNodes",{get:function(){return this.placeholders.map(function(e){return e.name})},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"outputNodes",{get:function(){return this.outputs.map(function(e){return e.name})},enumerable:!0,configurable:!0}),e.prototype.getCompilationKey=function(e,t){var a=e.map(function(e){return e.name}).sort(),r=t.map(function(e){return e.name}).sort();return a.join(this.SEPERATOR)+"--"+r.join(this.SEPERATOR)},e.prototype.compile=function(e,t){var a=me(e,t,this.weightMap),r=a.missingInputs,n=a.dynamicNode,s=a.syncInputs;if(null!=n)throw new Error("This execution contains the node '"+n.name+"', which has the dynamic op '"+n.op+"'. Please use model.executeAsync() instead. Alternatively, to avoid the dynamic ops, specify the inputs ["+s+"]");if(r.length>0){var o=t.map(function(e){return e.name}),p=Object.keys(e);throw new Error("Cannot compute the outputs ["+o+"] from the provided inputs ["+p+"]. Missing the following inputs: ["+r+"]")}return function(e,t,a){var r=a.usedNodes,n=a.inputs,s=[];Object.keys(n).map(function(t){return e.nodes[t]}).forEach(function(e){r.has(e.name)&&s.push(e)}),e.weights.forEach(function(e){r.has(e.name)&&s.push(e)});for(var o=new Set,p=[];s.length>0;){var i=s.pop();o.add(i.name),t[i.name]||p.push(i),i.children.forEach(function(e){!o.has(e.name)&&r.has(e.name)&&e.inputs.every(function(e){return o.has(e.name)})&&s.push(e)})}return p}(this.graph,this.weightMap,a)},e.prototype.fusePrelu=function(){!function(e,a){var r=function(r){var n=e.nodes[r];if(null==n||"Add"!==n.op&&"AddV2"!==n.op||2!==n.inputNames.length)return"continue";var s=n.inputs.find(function(e){return"Relu"===e.op});if(null==s||1!==s.inputNames.length)return"continue";var o=n.inputs.find(function(e){return"Mul"===e.op});if(null==o||2!==o.inputNames.length)return"continue";var p=o.inputs.find(function(e){return"Const"===e.op}),i=o.inputs.find(function(e){return"Relu"===e.op});if(null==p||null==i||1!==i.inputNames.length)return"continue";var u=i.inputs[0];if(null==u||"Neg"!==u.op||1!==u.inputNames.length)return"continue";if(s.inputNames[0]!==u.inputNames[0])return"continue";var m=s.inputs[0],c=n.children,d=p.name+"_neg",y={name:d,inputNames:[],inputs:[],attrParams:{},category:"graph",children:[],op:"Const",inputParams:{},rawAttrs:{}};a[d]=[t.neg(a[p.name][0])],e.weights.push(y);var l={name:n.name+"_Prelu",inputNames:[m.name,y.name],inputs:[m,y],attrParams:{},category:"custom",children:c,op:"Prelu",inputParams:{x:{inputIndexStart:0,type:"tensor"},alpha:{inputIndexStart:1,type:"tensor"}}};y.children.push(l);var f=p.children.indexOf(o);f>-1&&p.children.splice(f,1);var h=m.children.indexOf(s);h>-1&&m.children.splice(h,1);var N=m.children.indexOf(u);if(N>-1&&m.children.splice(N,1),m.children.push(l),c.forEach(function(e){var t=e.inputNames.indexOf(n.name);t>-1&&(e.inputNames[t]=l.name,e.inputs[t]=l)}),0===c.length){var g=e.outputs.indexOf(n);g>-1&&e.outputs.splice(g,1),e.outputs.push(l)}delete e.nodes[n.name],delete e.nodes[o.name],delete e.nodes[s.name],delete e.nodes[i.name],delete e.nodes[u.name],e.nodes[l.name]=l,e.nodes[y.name]=y};for(var n in e.nodes)r(n)}(this.graph,this.weightMap)},e.prototype.execute=function(e,r){var n=this,s=Object.keys(e).sort();this.checkInputs(e),this.checkInputShapeAndType(e),this.checkOutputs(r);var o=s.map(function(e){return n.graph.nodes[e]}),p=r.map(function(e){return n.graph.nodes[l(e)[0]]}),i=this.getCompilationKey(o,p),u=this.compiledMap.get(i);null==u&&(u=this.compile(e,p),this.compiledMap.set(i,u));var m={};return t.tidy(function(){var t=new ue(n._weightMap,m),s=a({},n.weightMap);Object.keys(e).forEach(function(t){s[t]=[e[t]]});for(var o=n.getFrozenTensorIds(s),p={},i=0;i<u.length;i++){var d=u[i];if(!s[d.name]){var y=ie(d,s,t);if(y instanceof Promise)throw new Error("The execution of the op '"+d.op+"' returned a promise. Please use model.executeAsync() instead.");s[d.name]=y,n.checkTensorForDisposal(d.name,d,s,t,o,r,p)}}return r.map(function(e){return c(e,s,t)})})},e.prototype.getFrozenTensorIds=function(e){var t=[].concat.apply([],Object.keys(e).map(function(t){return e[t]}).map(function(e){return e.map(function(e){return e.id})}));return new Set(t)},e.prototype.checkTensorForDisposal=function(e,t,a,r,n,s,o){"control"!==t.category&&-1===s.indexOf(e)&&(a[e].forEach(function(e){null!=e&&(o[e.id]=(o[e.id]||0)+t.children.length)}),t.inputs.forEach(function(e){if("control"!==e.category){var t=function(e,t,a){return t[y(e,a.currentContextId)]}(e.name,a,r);null!=t&&t.forEach(function(e){if(e&&!n.has(e.id)){var t=o[e.id];1===t?(e.dispose(),delete o[e.id]):null!=t&&o[e.id]--}})}}))},e.prototype.executeAsync=function(e,t){return r(this,void 0,void 0,function(){var a,r,s,o,p,i,u=this;return n(this,function(n){switch(n.label){case 0:return this.checkInputs(e),this.checkInputShapeAndType(e),this.checkOutputs(t),a={},r=new ue(this._weightMap,a),[4,this.executeWithControlFlow(e,r,t)];case 1:return s=n.sent(),o=t.map(function(e){return c(e,s,r)}),p=new Set(o.map(function(e){return e.id})),i=new Set(Object.keys(e).map(function(t){return e[t].id})),Object.keys(s).forEach(function(e){s[e].forEach(function(e){!e||e.isDisposed||p.has(e.id)||i.has(e.id)||-1!==u.weightIds.indexOf(e.id)||e.dispose()})}),[2,o]}})})},e.prototype.executeWithControlFlow=function(e,t,s){return r(this,void 0,void 0,function(){var r,o,p,i,u,m,d,y,f,h,N,g,b,x,T,v,O=this;return n(this,function(n){switch(n.label){case 0:r=Object.keys(e),o=r.map(function(e){return O.graph.nodes[e]}),p=s.map(function(e){return O.graph.nodes[l(e)[0]]}),i=me(e,p,this.weightMap),u=i.usedNodes,m=i.missingInputs,d=i.dynamicNode,y=i.syncInputs,f=o.concat(this.graph.weights).map(function(e){return{node:e,contexts:t.currentContext}}),h=a({},this.weightMap),Object.keys(e).forEach(function(t){h[t]=[e[t]]}),N={},g=this.getFrozenTensorIds(h),b={},n.label=1;case 1:return f.length>0?(x=this.processStack(o,f,t,h,b,g,s,N,u),[4,Promise.all(x)]):[3,3];case 2:return n.sent(),[3,1];case 3:if(null==d&&console.warn("This model execution did not contain any nodes with control flow or dynamic output shapes. You can use model.execute() instead."),(T=p.filter(function(e){return!ye(e)&&!c(e.name,h,t)}).map(function(e){return e.name})).length>0)throw v="",null!=d&&(v="Alternatively, to avoid the dynamic ops, use model.execute() and specify the inputs ["+y+"]"),new Error("Cannot compute the outputs ["+T+"] from the provided inputs ["+r+"]. Consider providing the following inputs: ["+m+"]. "+v);return[2,h]}})})},e.prototype.processStack=function(e,t,a,r,n,s,o,p,i){for(var u=this,c=[],y=function(){var y=t.pop();a.currentContext=y.contexts;var f="";if("Enter"===y.node.op&&m("isConstant",y.node,r,a)&&(f=d(y.node.name,a)[0]),-1===e.indexOf(y.node)){var h=ie(y.node,r,a);f||(f=d(y.node.name,a)[0]);var N=a.currentContext;h instanceof Promise?c.push(h.then(function(e){return r[f]=e,a.currentContext=N,u.checkTensorForDisposal(f,y.node,r,a,s,o,p),u.processChildNodes(y.node,t,a,r,n,i),e})):(r[f]=h,l.checkTensorForDisposal(f,y.node,r,a,s,o,p),l.processChildNodes(y.node,t,a,r,n,i))}else l.processChildNodes(y.node,t,a,r,n,i)},l=this;t.length>0;)y();return c},e.prototype.processChildNodes=function(e,t,a,r,n,s){e.children.forEach(function(e){var o=d(e.name,a)[0];!n[o]&&s.has(e.name)&&("Merge"===e.op?e.inputNames.some(function(e){return!!c(e,r,a)})&&(n[o]=!0,t.push({contexts:a.currentContext,node:e})):e.inputNames.every(function(e){return!!c(e,r,a)})&&(n[o]=!0,t.push({contexts:a.currentContext,node:e})))})},e.prototype.dispose=function(){var e=this;Object.keys(this.weightMap).forEach(function(t){return e.weightMap[t].forEach(function(e){return e.dispose()})})},e.prototype.checkInputShapeAndType=function(e){var a=this;Object.keys(e).forEach(function(r){var n=e[r],s=a.graph.nodes[r];if(s.attrParams.shape&&s.attrParams.shape.value){var o=s.attrParams.shape.value,p=o.length===n.shape.length&&n.shape.every(function(e,t){return-1===o[t]||o[t]===e});t.util.assert(p,function(){return"The shape of dict['"+s.name+"'] provided in model.execute(dict) must be ["+o+"], but was ["+n.shape+"]"})}s.attrParams.dtype&&s.attrParams.dtype.value&&t.util.assert(n.dtype===s.attrParams.dtype.value,function(){return"The dtype of dict['"+s.name+"'] provided in model.execute(dict) must be "+s.attrParams.dtype.value+", but was "+n.dtype})})},e.prototype.checkInputs=function(e){var t=this,a=Object.keys(e).filter(function(e){return!t.graph.nodes[e]});if(a.length>0)throw new Error("The dict provided in model.execute(dict) has keys: ["+a+"] that are not part of graph")},e.prototype.checkOutputs=function(e){var t=this;e.forEach(function(e){var a=l(e)[0];if(!t.graph.nodes[a])throw new Error("The output '"+e+"' is not found in the graph")})},e}(),he="?tfjs-format=file",Ne="model.json",ge=function(){function e(e,t){void 0===t&&(t={}),this.modelUrl=e,this.loadOptions=t,this.version="n/a",null==t&&(this.loadOptions={})}return Object.defineProperty(e.prototype,"modelVersion",{get:function(){return this.version},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"inputNodes",{get:function(){return this.executor.inputNodes},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"outputNodes",{get:function(){return this.executor.outputNodes},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"inputs",{get:function(){return this.executor.inputs},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"outputs",{get:function(){return this.executor.outputs},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"weights",{get:function(){return this.executor.weightMap},enumerable:!0,configurable:!0}),e.prototype.fusePrelu=function(){this.executor.fusePrelu(),null==u("Prelu")&&i("Prelu",function(e){var a=e.inputs[0],r=e.inputs[1];return t.prelu(a,r)})},e.prototype.findIOHandler=function(){var e=this.modelUrl;if(null!=e.load)this.handler=e;else if(null!=this.loadOptions.requestInit)this.handler=t.io.browserHTTPRequest(e,this.loadOptions);else{var a=t.io.getLoadHandlers(e,this.loadOptions.onProgress);if(0===a.length)a.push(t.io.browserHTTPRequest(e,this.loadOptions));else if(a.length>1)throw new Error("Found more than one ("+a.length+") load handlers for URL '"+[e]+"'");this.handler=a[0]}},e.prototype.load=function(){return r(this,void 0,void 0,function(){var e,a,r;return n(this,function(n){switch(n.label){case 0:if(this.findIOHandler(),null==this.handler.load)throw new Error("Cannot proceed with model loading because the IOHandler provided does not have the `load` method implemented.");return[4,this.handler.load()];case 1:return e=n.sent(),a=e.modelTopology,this.version=a.versions.producer+"."+a.versions.minConsumer,r=t.io.decodeWeights(e.weightData,e.weightSpecs),this.executor=new fe(k.Instance.transformGraph(a)),this.executor.weightMap=this.convertTensorMapToTensorsMap(r),[2,!0]}})})},e.prototype.predict=function(e,t){return this.execute(e,this.outputNodes)},e.prototype.normalizeInputs=function(e){if(!(e instanceof t.Tensor||Array.isArray(e)))return e;if((e=Array.isArray(e)?e:[e]).length!==this.inputNodes.length)throw new Error("Input tensor count mismatch,the graph model has "+this.inputNodes.length+" placeholders, while there are "+e.length+" input tensors.");return this.inputNodes.reduce(function(t,a,r){return t[a]=e[r],t},{})},e.prototype.normalizeOutputs=function(e){return e=e||this.outputNodes,Array.isArray(e)?e:[e]},e.prototype.execute=function(e,t){e=this.normalizeInputs(e),t=this.normalizeOutputs(t);var a=this.executor.execute(e,t);return a.length>1?a:a[0]},e.prototype.executeAsync=function(e,t){return r(this,void 0,void 0,function(){var a;return n(this,function(r){switch(r.label){case 0:return e=this.normalizeInputs(e),t=this.normalizeOutputs(t),[4,this.executor.executeAsync(e,t)];case 1:return[2,(a=r.sent()).length>1?a:a[0]]}})})},e.prototype.convertTensorMapToTensorsMap=function(e){return Object.keys(e).reduce(function(t,a){return t[a]=[e[a]],t},{})},e.prototype.dispose=function(){this.executor.dispose()},e}();e.GraphModel=ge,e.loadGraphModel=function(e,t){return void 0===t&&(t={}),r(this,void 0,void 0,function(){var a;return n(this,function(r){switch(r.label){case 0:if(null==e)throw new Error("modelUrl in loadGraphModel() cannot be null. Please provide a url or an IOHandler that loads the model");return null==t&&(t={}),t.fromTFHub&&null==e.load&&(e.endsWith("/")||(e+="/"),e=""+e+Ne+he),[4,(a=new ge(e,t)).load()];case 1:return r.sent(),[2,a]}})})},e.deregisterOp=function(e){delete p[e]},e.registerOp=i,e.version_converter="1.2.7",Object.defineProperty(e,"__esModule",{value:!0})});
  //# sourceMappingURL=tf-converter.min.js.map
  