text: /**
   * @license
   * Copyright 2020 Google LLC. All Rights Reserved.
   * Licensed under the Apache License, Version 2.0 (the "License");
   * you may not use this file except in compliance with the License.
   * You may obtain a copy of the License at
   *
   * http://www.apache.org/licenses/LICENSE-2.0
   *
   * Unless required by applicable law or agreed to in writing, software
   * distributed under the License is distributed on an "AS IS" BASIS,
   * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
   * See the License for the specific language governing permissions and
   * limitations under the License.
   * =============================================================================
   */
  !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=e||self).tf=e.tf||{},e.tf)}(this,(function(e,t){"use strict";var a,n,r=Object.assign||function(e){for(var t,a=1,n=arguments.length;a<n;a++)for(var r in t=arguments[a])Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r]);return e};function s(e,t,a,n){return new(a||(a=Promise))((function(r,s){function o(e){try{i(n.next(e))}catch(e){s(e)}}function p(e){try{i(n.throw(e))}catch(e){s(e)}}function i(e){e.done?r(e.value):new a((function(t){t(e.value)})).then(o,p)}i((n=n.apply(e,t||[])).next())}))}function o(e,t){var a,n,r,s,o={label:0,sent:function(){if(1&r[0])throw r[1];return r[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,n&&(r=n[2&s[0]?"return":s[0]?"throw":"next"])&&!(r=r.call(n,s[1])).done)return r;switch(n=0,r&&(s=[0,r.value]),s[0]){case 0:case 1:r=s;break;case 4:return o.label++,{value:s[1],done:!1};case 5:o.label++,n=s[1],s=[0];continue;case 7:s=o.ops.pop(),o.trys.pop();continue;default:if(!(r=o.trys,(r=r.length>0&&r[r.length-1])||6!==s[0]&&2!==s[0])){o=0;continue}if(3===s[0]&&(!r||s[1]>r[0]&&s[1]<r[3])){o.label=s[1];break}if(6===s[0]&&o.label<r[1]){o.label=r[1],r=s;break}if(r&&o.label<r[2]){o.label=r[2],o.ops.push(s);break}r[2]&&o.ops.pop(),o.trys.pop();continue}s=t.call(e,o)}catch(e){s=[6,e],n=0}finally{a=r=0}if(5&s[0])throw s[1];return{value:s[0]?s[1]:void 0,done:!0}}([s,p])}}}function p(e,t){var a="function"==typeof Symbol&&e[Symbol.iterator];if(!a)return e;var n,r,s=a.call(e),o=[];try{for(;(void 0===t||t-- >0)&&!(n=s.next()).done;)o.push(n.value)}catch(e){r={error:e}}finally{try{n&&!n.done&&(a=s.return)&&a.call(s)}finally{if(r)throw r.error}}return o}function i(){for(var e=[],t=0;t<arguments.length;t++)e=e.concat(p(arguments[t]));return e}!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"}(a||(a={})),function(e){!function(e){e[e.LEGACY=0]="LEGACY",e[e.V1=1]="V1",e[e.V2=2]="V2"}(e.CheckpointFormatVersion||(e.CheckpointFormatVersion={}))}(n||(n={}));var u={};function m(e){return u[e]}function c(e,a,n,r,s){var o=a.inputParams[e];if(o&&void 0!==o.inputIndexStart){var p=o.inputIndexStart,i=0===o.inputIndexEnd?void 0:void 0===o.inputIndexEnd?p+1:o.inputIndexEnd;if("tensor"===o.type)return d(a.inputNames[o.inputIndexStart],n,r,s);if("tensors"===o.type)return a.inputNames.slice(p,i).map((function(e){return d(e,n,r,s)}));var u=d(a.inputNames.slice(p)[0],n,r,s),m=u.dataSync();return"number"===o.type?m[0]:t.util.toNestedArray(u.shape,m)}var c=a.attrParams[e];return c&&c.value}function d(e,t,a,n){var r=p(f(e),2),s=r[0],o=r[1];if(null!=n){var i=n.getHashTableHandleByName(s);if(null!=i)return i}var u=a.currentContextIds.find((function(e){return!!t[l(s,e)]}));return void 0!==u?t[l(s,u)][o]:void 0}function y(e,t){var a=p(f(e),2),n=a[0],r=a[1];return[l(n,t&&t.currentContextId),r]}function l(e,t){return t?e+"-"+t:e}function f(e){var t=e.split(":");return 1===t.length?[e,0]:[t[0],Number(t[t.length-1])]}function h(e,t,a){var n=c("pad",e,t,a);if("explicit"===n){n=c("explicitPaddings",e,t,a);for(var r=[[0,0],[0,0],[0,0],[0,0]],s=0;s<4;s++)r[s][0]=n[2*s],r[s][1]=n[2*s+1];return r}return n}function N(e){return e.kept?e:t.clone(e)}var g={__proto__:null,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:"DivNoNan",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}]}]},b={__proto__:null,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:"Imag",category:"basic_math",inputs:[{start:0,name:"x",type:"tensor"}],attrs:[{tfName:"T",name:"dtype",type:"dtype",notSupported:!0},{tfName:"Tout",name:"outputType",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:"Real",category:"basic_math",inputs:[{start:0,name:"x",type:"tensor"}],attrs:[{tfName:"T",name:"dtype",type:"dtype",notSupported:!0},{tfName:"Tout",name:"outputType",type:"dtype",notSupported:!0}]},{tfOpName:"Prelu",category:"basic_math",inputs:[{start:0,name:"x",type:"tensor"},{start:1,name:"alpha",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}]}]},x={__proto__:null,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:"tensor"},{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:"tensor"},{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:"tensor"},{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:"tensor"},{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:"tensor"},{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:"tensor"},{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:"tensor"},{start:1,name:"flowIn",type:"number"}]},{tfOpName:"TensorArrayCloseV3",category:"control",inputs:[{start:0,name:"tensorArrayId",type:"tensor"}]},{tfOpName:"StatelessIf",category:"control",inputs:[{start:0,name:"cond",type:"tensor"},{start:1,end:0,name:"args",type:"tensors"}],attrs:[{tfName:"then_branch",name:"thenBranch",type:"func"},{tfName:"else_branch",name:"elseBranch",type:"func"}]},{tfOpName:"If",category:"control",inputs:[{start:0,name:"cond",type:"tensor"},{start:1,end:0,name:"args",type:"tensors"}],attrs:[{tfName:"then_branch",name:"thenBranch",type:"func"},{tfName:"else_branch",name:"elseBranch",type:"func"}]},{tfOpName:"StatelessWhile",category:"control",inputs:[{start:0,end:0,name:"args",type:"tensors"}],attrs:[{tfName:"cond",name:"cond",type:"func"},{tfName:"body",name:"body",type:"func"}]},{tfOpName:"While",category:"control",inputs:[{start:0,end:0,name:"args",type:"tensors"}],attrs:[{tfName:"cond",name:"cond",type:"func"},{tfName:"body",name:"body",type:"func"}]},{tfOpName:"TensorListScatter",category:"control",inputs:[{start:0,name:"tensor",type:"tensor"},{start:1,name:"indices",type:"number[]"},{start:2,name:"elementShape",type:"shape"}],attrs:[{tfName:"element_dtype",name:"elementDType",type:"dtype"}]},{tfOpName:"TensorListScatterV2",category:"control",inputs:[{start:0,name:"tensor",type:"tensor"},{start:1,name:"indices",type:"number[]"},{start:2,name:"elementShape",type:"shape"},{start:3,name:"numElements",type:"number"}],attrs:[{tfName:"element_dtype",name:"elementDType",type:"dtype"}]},{tfOpName:"TensorListGather",category:"control",inputs:[{start:0,name:"tensorListId",type:"tensor"},{start:1,name:"indices",type:"number[]"},{start:2,name:"elementShape",type:"shape"}],attrs:[{tfName:"element_dtype",name:"elementDType",type:"dtype"}]},{tfOpName:"TensorListGetItem",category:"control",inputs:[{start:0,name:"tensorListId",type:"tensor"},{start:1,name:"index",type:"number"},{start:2,name:"elementShape",type:"shape"}],attrs:[{tfName:"element_dtype",name:"elementDType",type:"dtype"}]},{tfOpName:"TensorListSetItem",category:"control",inputs:[{start:0,name:"tensorListId",type:"tensor"},{start:1,name:"index",type:"number"},{start:2,name:"tensor",type:"tensor"}],attrs:[{tfName:"element_dtype",name:"elementDType",type:"dtype"}]},{tfOpName:"TensorListReserve",category:"control",inputs:[{start:0,name:"elementShape",type:"shape"},{start:1,name:"numElements",type:"number"}],attrs:[{tfName:"element_dtype",name:"elementDType",type:"dtype"}]},{tfOpName:"TensorListFromTensor",category:"control",inputs:[{start:0,name:"tensor",type:"tensor"},{start:1,name:"elementShape",type:"shape"}],attrs:[{tfName:"element_dtype",name:"elementDType",type:"dtype"}]},{tfOpName:"TensorListStack",category:"control",inputs:[{start:0,name:"tensorListId",type:"tensor"},{start:1,name:"elementShape",type:"shape"}],attrs:[{tfName:"element_dtype",name:"elementDType",type:"dtype"},{tfName:"num_elements",name:"numElements",type:"dtype"}]},{tfOpName:"TensorListSplit",category:"control",inputs:[{start:0,name:"tensor",type:"tensor"},{start:1,name:"elementShape",type:"shape"},{start:2,name:"lengths",type:"number[]"}],attrs:[{tfName:"element_dtype",name:"elementDType",type:"dtype"}]},{tfOpName:"TensorListConcat",category:"control",inputs:[{start:0,name:"tensorListId",type:"tensor"}],attrs:[{tfName:"element_shape",name:"elementShape",type:"shape"},{tfName:"element_dtype",name:"elementDType",type:"dtype"}]},{tfOpName:"TensorListPopBack",category:"control",inputs:[{start:0,name:"tensorListId",type:"tensor"},{start:1,name:"elementShape",type:"shape"}],attrs:[{tfName:"element_dtype",name:"elementDType",type:"dtype"}]},{tfOpName:"TensorListPushBack",category:"control",inputs:[{start:0,name:"tensorListId",type:"tensor"},{start:1,name:"tensor",type:"tensor"}],attrs:[{tfName:"element_dtype",name:"elementDType",type:"dtype"}]}]},T={__proto__:null,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:"MaxPoolWithArgmax",category:"convolution",inputs:[{start:0,name:"x",type:"tensor"}],attrs:[{tfName:"strides",name:"strides",type:"number[]"},{tfName:"padding",name:"pad",type:"string"},{tfName:"ksize",name:"kernelSize",type:"number[]"},{tfName:"include_batch_in_index",name:"includeBatchInIndex",type:"bool"},{tfName:"T",name:"dtype",type:"dtype",notSupported:!0}]},{tfOpName:"AvgPool3D",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:"MaxPool3D",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:"explicit_paddings",name:"explicitPaddings",type:"number[]",defaultValue:[]},{tfName:"dilations",name:"dilations",type:"number[]"}]},{tfOpName:"_FusedConv2D",category:"convolution",inputs:[{start:0,name:"x",type:"tensor"},{start:1,name:"filter",type:"tensor"},{start:2,end:0,name:"args",type:"tensors"}],attrs:[{tfName:"num_args",name:"numArgs",type:"number"},{tfName:"T",name:"dtype",type:"dtype",notSupported:!0},{tfName:"strides",name:"strides",type:"number[]"},{tfName:"padding",name:"pad",type:"string"},{tfName:"explicit_paddings",name:"explicitPaddings",type:"number[]",defaultValue:[]},{tfName:"use_cudnn_on_gpu",name:"useCudnnOnGpu",type:"bool",defaultValue:!0},{tfName:"data_format",name:"dataFormat",type:"string",defaultValue:"NHWC"},{tfName:"dilations",name:"dilations",type:"number[]",defaultValue:[1,1,1,1]},{tfName:"fused_ops",name:"fusedOps",type:"string[]",defaultValue:[]},{tfName:"epsilon",name:"epsilon",type:"number",defaultValue:1e-4}]},{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},{tfName:"explicit_paddings",name:"explicitPaddings",type:"number[]",defaultValue:[]}]},{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:"explicit_paddings",name:"explicitPaddings",type:"number[]",defaultValue:[]},{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:"explicit_paddings",name:"explicitPaddings",type:"number[]",defaultValue:[]},{tfName:"dilations",name:"dilations",type:"number[]"}]},{tfOpName:"FusedDepthwiseConv2dNative",category:"convolution",inputs:[{start:0,name:"x",type:"tensor"},{start:1,name:"filter",type:"tensor"},{start:2,end:0,name:"args",type:"tensors"}],attrs:[{tfName:"num_args",name:"numArgs",type:"number"},{tfName:"T",name:"dtype",type:"dtype",notSupported:!0},{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[]",defaultValue:[1,1,1,1]},{tfName:"fused_ops",name:"fusedOps",type:"string[]",defaultValue:[]}]},{tfOpName:"Conv3D",category:"convolution",inputs:[{start:0,name:"x",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:"Dilation2D",category:"convolution",inputs:[{start:0,name:"x",type:"tensor"},{start:1,name:"filter",type:"tensor"}],attrs:[{tfName:"strides",name:"strides",type:"number[]"},{tfName:"rates",name:"dilations",type:"number[]"},{tfName:"padding",name:"pad",type:"string"}]}]},v={__proto__:null,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"}]},{tfOpName:"Multinomial",category:"creation",inputs:[{start:0,name:"logits",type:"tensor"},{start:1,name:"numSamples",type:"number"}],attrs:[{tfName:"seed",name:"seed",type:"number"},{tfName:"seed2",name:"seed2",type:"number"},{tfName:"T",name:"dtype",type:"dtype"},{tfName:"output_dtype",name:"output_dtype",type:"dtype"}]}]},_={__proto__:null,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:"NonMaxSuppressionV4",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"}],attrs:[{tfName:"T",name:"dtype",type:"dtype",notSupported:!0},{tfName:"T_threshold",name:"threshold",type:"dtype",notSupported:!0},{tfName:"pad_to_max_output_size",name:"padToMaxOutputSize",type:"bool"}]},{tfOpName:"NonMaxSuppressionV5",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"},{start:5,name:"softNmsSigma",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}]}]},S={__proto__:null,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"}]},{tfOpName:"Unique",category:"evaluation",inputs:[{start:0,name:"x",type:"tensor"}]},{tfOpName:"UniqueV2",category:"evaluation",inputs:[{start:0,name:"x",type:"tensor"},{start:1,name:"axis",type:"number"}]}]},O={__proto__:null,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"}]}]},w={__proto__:null,json:[{tfOpName:"HashTable",category:"hash_table",inputs:[],attrs:[{tfName:"shared_name",name:"sharedName",type:"string"},{tfName:"use_node_name_sharing",name:"useNodeNameSharing",type:"bool"},{tfName:"key_dtype",name:"keyDType",type:"dtype"},{tfName:"value_dtype",name:"valueDType",type:"dtype"}]},{tfOpName:"HashTableV2",category:"hash_table",inputs:[],attrs:[{tfName:"shared_name",name:"sharedName",type:"string"},{tfName:"use_node_name_sharing",name:"useNodeNameSharing",type:"bool"},{tfName:"key_dtype",name:"keyDType",type:"dtype"},{tfName:"value_dtype",name:"valueDType",type:"dtype"}]},{tfOpName:"LookupTableImport",category:"hash_table",inputs:[{start:0,name:"tableHandle",type:"tensor"},{start:1,name:"keys",type:"tensor"},{start:2,name:"values",type:"tensor"}],attrs:[{tfName:"Tin",name:"tIn",type:"dtype",notSupported:!0},{tfName:"Tout",name:"tOut",type:"dtype",notSupported:!0}]},{tfOpName:"LookupTableImportV2",category:"hash_table",inputs:[{start:0,name:"tableHandle",type:"tensor"},{start:1,name:"keys",type:"tensor"},{start:2,name:"values",type:"tensor"}],attrs:[{tfName:"Tin",name:"tIn",type:"dtype",notSupported:!0},{tfName:"Tout",name:"tOut",type:"dtype",notSupported:!0}]},{tfOpName:"LookupTableFind",category:"hash_table",inputs:[{start:0,name:"tableHandle",type:"tensor"},{start:1,name:"keys",type:"tensor"},{start:2,name:"defaultValue",type:"tensor"}],attrs:[{tfName:"Tin",name:"tIn",type:"dtype",notSupported:!0},{tfName:"Tout",name:"tOut",type:"dtype",notSupported:!0}]},{tfOpName:"LookupTableFindV2",category:"hash_table",inputs:[{start:0,name:"tableHandle",type:"tensor"},{start:1,name:"keys",type:"tensor"},{start:2,name:"defaultValue",type:"tensor"}],attrs:[{tfName:"Tin",name:"tIn",type:"dtype",notSupported:!0},{tfName:"Tout",name:"tOut",type:"dtype",notSupported:!0}]}]},A={__proto__:null,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"}]}]},E={__proto__:null,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}]},{tfOpName:"SelectV2",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}]}]},D={__proto__:null,json:[{tfOpName:"_FusedMatMul",category:"matrices",inputs:[{start:0,name:"a",type:"tensor"},{start:1,name:"b",type:"tensor"},{start:2,end:0,name:"args",type:"tensors"}],attrs:[{tfName:"num_args",name:"numArgs",type:"number"},{tfName:"fused_ops",name:"fusedOps",type:"string[]",defaultValue:[]},{tfName:"epsilon",name:"epsilon",type:"number",defaultValue:1e-4},{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:"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}]}]},I={__proto__:null,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}]}]},k={__proto__:null,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"}]},{tfOpName:"Cumsum",category:"reduction",inputs:[{start:0,name:"x",type:"tensor"},{start:1,name:"axis",type:"number"}],attrs:[{tfName:"exclusive",name:"exclusive",type:"bool"},{tfName:"reverse",name:"reverse",type:"bool"}]}]},M={__proto__:null,json:[{tfOpName:"ConcatV2",category:"slice_join",inputs:[{start:0,end:-1,name:"tensors",type:"tensors"},{start:-1,name:"axis",type:"number"}],attrs:[{tfName:"N",name:"n",type:"number",defaultValue:2}]},{tfOpName:"Concat",category:"slice_join",inputs:[{start:1,end:0,name:"tensors",type:"tensors"},{start:0,name:"axis",type:"number"}],attrs:[{tfName:"N",name:"n",type:"number",defaultValue:2}]},{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}]}]},V={__proto__:null,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}]}]},C={__proto__:null,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:"MirrorPad",category:"transformation",inputs:[{start:0,name:"x",type:"tensor"},{start:1,name:"padding",type:"number[]"}],attrs:[{tfName:"mode",name:"mode",type:"string"}]},{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"}]},{tfOpName:"BroadcastTo",category:"transformation",inputs:[{start:0,name:"x",type:"tensor"},{start:1,name:"shape",type:"number[]"}],attrs:[]}]},L=function(){function e(){var e=[g,b,x,T,v,_,S,E,A,O,D,I,k,M,V,C,w],t=[].concat.apply([],i(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,t){var a=this;void 0===t&&(t={});var n=e.node,r=[],s=[],o=[],i=n.reduce((function(e,t){return e[t.name]=a.mapNode(t),t.op.startsWith("Placeholder")?r.push(e[t.name]):"Const"===t.op?s.push(e[t.name]):null!=t.input&&0!==t.input.length||o.push(e[t.name]),e}),{}),u=[],m=[],c={},d={};null!=t&&(c=this.mapSignatureEntries(t.inputs),d=this.mapSignatureEntries(t.outputs));var l=Object.keys(i);l.forEach((function(e){var t=i[e];t.inputNames.forEach((function(e){var a=p(y(e),1)[0];t.inputs.push(i[a]),i[a].children.push(t)}))})),0===Object.keys(d).length?l.forEach((function(e){var t=i[e];0===t.children.length&&m.push(t)})):Object.keys(d).forEach((function(e){var t=p(y(e),1)[0],a=i[t];null!=a&&(a.signatureKey=d[e],m.push(a))})),Object.keys(c).length>0?Object.keys(c).forEach((function(e){var t=p(y(e),1)[0],a=i[t];a&&(a.signatureKey=c[e],u.push(a))})):u=r;var f={};null!=e.library&&null!=e.library.function&&(f=e.library.function.reduce((function(e,t){return e[t.signature.name]=a.mapFunction(t),e}),{}));var h={nodes:i,inputs:u,outputs:m,weights:s,placeholders:r,signature:t,functions:f};return o.length>0&&(h.initNodes=o),h},e.prototype.mapSignatureEntries=function(e){return Object.keys(e||{}).reduce((function(t,a){return t[e[a].name]=a,t}),{})},e.prototype.mapNode=function(e){var t=m(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 n=a.type,r=void 0;switch(a.type){case"string":void 0===(r=z(e.attr,a.tfName,a.defaultValue))&&a.tfDeprecatedName&&(r=z(e.attr,a.tfDeprecatedName,a.defaultValue));break;case"string[]":void 0===(r=Q(e.attr,a.tfName,a.defaultValue))&&a.tfDeprecatedName&&(r=Q(e.attr,a.tfDeprecatedName,a.defaultValue));break;case"number":void 0===(r=j(e.attr,a.tfName,a.defaultValue||0))&&a.tfDeprecatedName&&(r=j(e.attr,a.tfDeprecatedName,a.defaultValue));break;case"number[]":void 0===(r=G(e.attr,a.tfName,a.defaultValue))&&a.tfDeprecatedName&&(r=G(e.attr,a.tfDeprecatedName,a.defaultValue));break;case"bool":void 0===(r=P(e.attr,a.tfName,a.defaultValue))&&a.tfDeprecatedName&&(r=P(e.attr,a.tfDeprecatedName,a.defaultValue));break;case"bool[]":void 0===(r=X(e.attr,a.tfName,a.defaultValue))&&a.tfDeprecatedName&&(r=X(e.attr,a.tfDeprecatedName,a.defaultValue));break;case"shape":void 0===(r=U(e.attr,a.tfName,a.defaultValue))&&a.tfDeprecatedName&&(r=U(e.attr,a.tfDeprecatedName,a.defaultValue));break;case"shape[]":void 0===(r=K(e.attr,a.tfName,a.defaultValue))&&a.tfDeprecatedName&&(r=K(e.attr,a.tfDeprecatedName,a.defaultValue));break;case"dtype":void 0===(r=q(e.attr,a.tfName,a.defaultValue))&&a.tfDeprecatedName&&(r=q(e.attr,a.tfDeprecatedName,a.defaultValue));break;case"dtype[]":void 0===(r=H(e.attr,a.tfName,a.defaultValue))&&a.tfDeprecatedName&&(r=H(e.attr,a.tfDeprecatedName,a.defaultValue));break;case"func":void 0===(r=B(e.attr,a.tfName,a.defaultValue))&&a.tfDeprecatedName&&(r=B(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:r,type:n},t}),{})),a},e.prototype.mapFunction=function(e){var t=this,a=e.nodeDef,n=[],r={};null!=a&&(r=a.reduce((function(e,a){return e[a.name]=t.mapNode(a),"Const"===a.op&&n.push(e[a.name]),e}),{}));var s=[],o=[];e.signature.inputArg.forEach((function(e){var t=p(y(e.name),1)[0],a={name:t,op:"Placeholder",inputs:[],inputNames:[],category:"graph",inputParams:{},attrParams:{dtype:{value:R(e.type),type:"dtype"}},children:[]};a.signatureKey=e.name,s.push(a),r[t]=a})),Object.keys(r).forEach((function(e){var t=r[e];t.inputNames.forEach((function(e){var a=p(y(e),1)[0];t.inputs.push(r[a]),r[a].children.push(t)}))}));var i=e.ret;e.signature.outputArg.forEach((function(e){var t=p(y(i[e.name]),2),a=t[0],n=t[1],s=r[a];null!=s&&(s.defaultOutput=n,o.push(s))}));var u=this.mapArgsToSignature(e);return{nodes:r,inputs:s,outputs:o,weights:n,placeholders:[],signature:u}},e.prototype.mapArgsToSignature=function(e){var t=this;return{methodName:e.signature.name,inputs:e.signature.inputArg.reduce((function(e,a){return e[a.name]=t.mapArgToTensorInfo(a),e}),{}),outputs:e.signature.outputArg.reduce((function(a,n){return a[n.name]=t.mapArgToTensorInfo(n,e.ret),a}),{})}},e.prototype.mapArgToTensorInfo=function(e,t){var a=e.name;return null!=t&&(a=t[a]),{name:a,dtype:e.type}},e}();function F(e,a){var n=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?n:n.toLowerCase()}function z(e,t,a,n){void 0===n&&(n=!1);var r=e[t];return null!=r?F(r.s,n):a}function P(e,t,a){var n=e[t];return n?n.b:a}function j(e,t,a){var n=e[t]||{},r=null!=n.i?n.i:null!=n.f?n.f:a;return"number"==typeof r?r:parseInt(r,10)}function R(e){switch("string"==typeof e&&(e=a[e]),e){case a.DT_FLOAT:return"float32";case a.DT_INT32:case a.DT_INT64:case a.DT_INT8:case a.DT_UINT8:return"int32";case a.DT_BOOL:return"bool";case a.DT_DOUBLE:return"float32";case a.DT_STRING:return"string";default:return null}}function B(e,t,a){var n=e[t];return n&&n.func?n.func.name:a}function q(e,t,a){var n=e[t];return n&&n.type?R(n.type):a}function H(e,t,a){var n=e[t];return n&&n.list&&n.list.type?n.list.type.map((function(e){return R(e)})):a}function W(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 U(e,t,a){var n=e[t];return n&&n.shape?W(n.shape):a}function G(e,t,a){var n=e[t];return n?((n.list.f&&n.list.f.length?n.list.f:n.list.i)||[]).map((function(e){return"number"==typeof e?e:parseInt(e,10)})):a}function Q(e,t,a,n){void 0===n&&(n=!1);var r=e[t];return r&&r.list&&r.list.s?r.list.s.map((function(e){return F(e,n)})):a}function K(e,t,a){var n=e[t];return n&&n.list&&n.list.shape?n.list.shape.map((function(e){return W(e)})):a}function X(e,t,a){var n=e[t];return n&&n.list&&n.list.b?n.list.b:a}var Z=function(){function e(e,t,a){var n=this;this.node=e,this.tensorMap=t,this.context=a,this.inputs=[],this.attrs={},this.inputs=e.inputNames.map((function(e){return n.getInput(e)})),null!=e.rawAttrs&&(this.attrs=Object.keys(e.rawAttrs).reduce((function(e,t){return e[t]=n.getAttr(t),e}),{}))}return e.prototype.getInput=function(e){return d(e,this.tensorMap,this.context)},e.prototype.getAttr=function(e,t){var a=this.node.rawAttrs[e];if(null!=a.tensor)return d(e,this.tensorMap,this.context);if(null!=a.i||null!=a.f)return j(this.node.rawAttrs,e,t);if(null!=a.s)return z(this.node.rawAttrs,e,t);if(null!=a.b)return P(this.node.rawAttrs,e,t);if(null!=a.shape)return U(this.node.rawAttrs,e,t);if(null!=a.type)return q(this.node.rawAttrs,e,t);if(null!=a.list){if(null!=a.list.i||null!=a.list.f)return G(this.node.rawAttrs,e,t);if(null!=a.list.s)return Q(this.node.rawAttrs,e,t);if(null!=a.list.shape)return K(this.node.rawAttrs,e,t);if(null!=a.list.b)return X(this.node.rawAttrs,e,t);if(null!=a.list.type)return H(this.node.rawAttrs,e,t)}return t},e}();function Y(e,a,n){void 0===n&&(n=""),t.util.assert(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,a),(function(){return n+" Shapes "+e+" and "+a+" must match"}))}var J=function(){function e(e,a,n,r,s,o,p){this.name=e,this.dtype=a,this.maxSize=n,this.elementShape=r,this.identicalElementShapes=s,this.dynamicSize=o,this.clearAfterRead=p,this.tensors=[],this.closed_=!1,this.idTensor=t.scalar(0),t.keep(this.idTensor)}return Object.defineProperty(e.prototype,"id",{get:function(){return this.idTensor.id},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"closed",{get:function(){return this.closed_},enumerable:!0,configurable:!0}),e.prototype.clearAndClose=function(e){this.tensors.forEach((function(t){null!=e&&e.has(t.tensor.id)||t.tensor.dispose()})),this.tensors=[],this.closed_=!0,this.idTensor.dispose()},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.size())throw new Error("Tried to read from index "+e+", but array size is: "+this.size());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,a){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 n=this.tensors[e]||{};if(a.dtype!==this.dtype)throw new Error("TensorArray "+this.name+": Could not write to TensorArray index "+e+",\n          because the value dtype is "+a.dtype+", but TensorArray dtype is "+this.dtype+".");if(0!==this.size()||null!=this.elementShape&&0!==this.elementShape.length||(this.elementShape=a.shape),Y(this.elementShape,a.shape,"TensorArray "+this.name+": Could not write to TensorArray index "+e+"."),n.read)throw new Error("TensorArray "+this.name+": Could not write to TensorArray index "+e+", because it has already been read.");if(n.written)throw new Error("TensorArray "+this.name+": Could not write to TensorArray index "+e+", because it has already been written.");n.tensor=a,t.keep(a),n.written=!0,this.tensors[e]=n},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,n){return a.write(e,t[n])}))},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=e.slice(0,this.size());else{e=[];for(var n=0;n<this.size();n++)e.push(n)}if(0===e.length)return t.tensor([],[0].concat(this.elementShape));var r=this.readMany(e);return Y(this.elementShape,r[0].shape,"TensorArray shape mismatch: "),t.stack(r,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=[],n=0;n<this.size();n++)a.push(n);var r=this.readMany(a);return Y(this.elementShape,r[0].shape,"TensorArray shape mismatch: tensor array shape ("+this.elementShape+") vs first tensor shape ("+r[0].shape+")"),t.concat(r,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 n=Math.max.apply(Math,i(e));if(!this.dynamicSize&&n>=this.maxSize)throw new Error("Max index must be < array size ("+n+"  vs. "+this.maxSize+")");this.writeMany(e,t.unstack(a,0))},e.prototype.split=function(e,a){var n=this;if(a.dtype!==this.dtype)throw new Error("TensorArray dtype is "+this.dtype+" but tensor has dtype "+a.dtype);var r=0,s=e.map((function(e){return r+=e}));if(r!==a.shape[0])throw new Error("Expected sum of lengths to be equal to\n          tensor.shape[0], but sum of lengths is\n        "+r+", and tensor's shape is: "+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===r?0:a.size/r,p=[];t.tidy((function(){a=t.reshape(a,[1,r,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.reshape(t.slice(a,u,m),n.elementShape)}return p}));for(var i=[],u=0;u<e.length;u++)i[u]=u;this.writeMany(i,p)},e}(),$=function(){function e(e,a,n,r){void 0===r&&(r=-1),this.tensors=e,this.elementShape=a,this.elementDtype=n,null!=e&&e.forEach((function(e){if(n!==e.dtype)throw new Error("Invalid data types; op elements "+n+", but list elements "+e.dtype);Y(a,e.shape,"TensorList shape mismatch: "),t.keep(e)})),this.idTensor=t.scalar(0),this.maxNumElements=r,t.keep(this.idTensor)}return Object.defineProperty(e.prototype,"id",{get:function(){return this.idTensor.id},enumerable:!0,configurable:!0}),e.prototype.copy=function(){return new e(i(this.tensors),this.elementShape,this.elementDtype)},e.prototype.clearAndClose=function(e){this.tensors.forEach((function(t){null!=e&&e.has(t.id)||t.dispose()})),this.tensors.length=0,this.idTensor.dispose()},e.prototype.size=function(){return this.tensors.length},e.prototype.stack=function(e,a,n){var r=this;if(void 0===n&&(n=-1),a!==this.elementDtype)throw new Error("Invalid data types; op elements "+a+", but list elements "+this.elementDtype);if(-1!==n&&this.tensors.length!==n)throw new Error("Operation expected a list with "+n+" elements but got a list with "+this.tensors.length+" elements.");return Y(e,this.elementShape,"TensorList shape mismatch: "),t.tidy((function(){var a=r.tensors.map((function(a){return t.reshape(a,e)}));return t.stack(a,0)}))},e.prototype.popBack=function(e,a){if(a!==this.elementDtype)throw new Error("Invalid data types; op elements "+a+", but list elements "+this.elementDtype);if(0===this.size())throw new Error("Trying to pop from an empty list.");var n=this.tensors.pop();return Y(n.shape,e,"TensorList shape mismatch: "),t.reshape(n,e)},e.prototype.pushBack=function(e){if(e.dtype!==this.elementDtype)throw new Error("Invalid data types; op elements "+e.dtype+", but list elements "+this.elementDtype);if(Y(e.shape,this.elementShape,"TensorList shape mismatch: "),this.maxNumElements===this.size())throw new Error("Trying to push element into a full list.");t.keep(e),this.tensors.push(e)},e.prototype.resize=function(e){if(e<0)throw new Error("TensorListResize expects size to be non-negative. Got: "+e);if(-1!==this.maxNumElements&&e>this.maxNumElements)throw new Error("TensorListResize input size "+e+" is greater maxNumElement "+this.maxNumElements+".");this.tensors.length=e},e.prototype.getItem=function(e,t,a){if(a!==this.elementDtype)throw new Error("Invalid data types; op elements "+a+", but list elements "+this.elementDtype);if(e<0||e>this.tensors.length)throw new Error("Trying to access element "+e+" in a list with "+this.tensors.length+" elements.");if(null==this.tensors[e])throw new Error("element at index "+e+" is null.");return Y(this.tensors[e].shape,t,"TensorList shape mismatch: "),this.tensors[e]},e.prototype.setItem=function(e,a){if(a.dtype!==this.elementDtype)throw new Error("Invalid data types; op elements "+a.dtype+", but list elements "+this.elementDtype);if(e<0||-1!==this.maxNumElements&&e>=this.maxNumElements)throw new Error("Trying to set element "+e+" in a list with max "+this.maxNumElements+" elements.");Y(this.elementShape,a.shape,"TensorList shape mismatch: "),t.keep(a),this.tensors[e]=a},e.prototype.gather=function(e,a,n){var r=this;if(a!==this.elementDtype)throw new Error("Invalid data types; op elements "+a+", but list elements "+this.elementDtype);return Y(this.elementShape,n,"TensorList shape mismatch: "),0===(e=e.slice(0,this.size())).length?t.tensor([],[0].concat(this.elementShape)):t.tidy((function(){var a=e.map((function(e){return t.reshape(r.tensors[e],n)}));return t.stack(a,0)}))},e.prototype.concat=function(e,a){var n=this;if(e&&e!==this.elementDtype)throw new Error("TensorList dtype is "+this.elementDtype+" but concat requested dtype "+e);return Y(this.elementShape,a,"TensorList shape mismatch: "),0===this.size()?t.tensor([],[0].concat(this.elementShape)):t.tidy((function(){var e=n.tensors.map((function(e){return t.reshape(e,a)}));return t.concat(e,0)}))},e}();var ee=function(e,a,n){return s(void 0,void 0,void 0,(function(){var r,s,p,u,m,y,l,f,h,g,b,x,T,v,_,S,O,w,A,E,D,I,k,M,V,C,L,F,z,P,j,R,B,q,H,W,U,G,Q,K,X,Z,ee,te,ae,ne,re,se,oe,pe,ie,ue,me;return o(this,(function(ce){switch(ce.label){case 0:switch(e.op){case"If":case"StatelessIf":return[3,1];case"While":case"StatelessWhile":return[3,3];case"LoopCond":return[3,9];case"Switch":return[3,10];case"Merge":return[3,12];case"Enter":return[3,13];case"Exit":return[3,14];case"NextIteration":return[3,15];case"TensorArrayV3":return[3,16];case"TensorArrayWriteV3":return[3,17];case"TensorArrayReadV3":return[3,18];case"TensorArrayGatherV3":return[3,19];case"TensorArrayScatterV3":return[3,20];case"TensorArrayConcatV3":return[3,21];case"TensorArraySplitV3":return[3,22];case"TensorArraySizeV3":return[3,23];case"TensorArrayCloseV3":return[3,24];case"TensorListSetItem":return[3,25];case"TensorListGetItem":return[3,26];case"TensorListScatterV2":case"TensorListScatter":return[3,27];case"TensorListReserve":return[3,28];case"TensorListGather":return[3,29];case"TensorListStack":return[3,30];case"TensorListFromTensor":return[3,31];case"TensorListConcat":return[3,32];case"TensorListPushBack":return[3,33];case"TensorListPopBack":return[3,34];case"TensorListSplit":return[3,35]}return[3,36];case 1:return r=c("thenBranch",e,a,n),s=c("elseBranch",e,a,n),p=c("cond",e,a,n),y=c("args",e,a,n),[4,p.data()];case 2:return(h=ce.sent())[0]?[2,n.functionMap[r].executeFunctionAsync(y,n.tensorArrayMap,n.tensorListMap)]:[2,n.functionMap[s].executeFunctionAsync(y,n.tensorArrayMap,n.tensorListMap)];case 3:return u=c("body",e,a,n),m=c("cond",e,a,n),y=c("args",e,a,n),[4,n.functionMap[m].executeFunctionAsync(y,n.tensorArrayMap,n.tensorListMap)];case 4:return l=ce.sent(),f=y.map((function(e){return e.id})),[4,l[0].data()];case 5:h=ce.sent(),l.forEach((function(e){e.kept||-1!==f.indexOf(e.id)||e.dispose()})),g=y,b=function(){var e,t,a;return o(this,(function(r){switch(r.label){case 0:return e=g,[4,n.functionMap[u].executeFunctionAsync(g,n.tensorArrayMap,n.tensorListMap)];case 1:return g=r.sent(),t=g.map((function(e){return e.id})),e.forEach((function(e){e.kept||-1!==f.indexOf(e.id)||-1!==t.indexOf(e.id)||e.dispose()})),[4,n.functionMap[m].executeFunctionAsync(g,n.tensorArrayMap,n.tensorListMap)];case 2:return[4,(a=r.sent())[0].data()];case 3:return h=r.sent(),a.forEach((function(e){e.kept||-1!==f.indexOf(e.id)||-1!==t.indexOf(e.id)||e.dispose()})),[2]}}))},ce.label=6;case 6:return h[0]?[5,b()]:[3,8];case 7:return ce.sent(),[3,6];case 8:return[2,g];case 9:return[2,[N(x=c("pred",e,a,n))]];case 10:return x=c("pred",e,a,n),(_=c("data",e,a,n)).kept||(_=N(_)),[4,x.data()];case 11:return[2,ce.sent()[0]?[void 0,_]:[_,void 0]];case 12:return(T=e.inputNames.find((function(e){return void 0!==d(e,a,n)})))?[2,[N(_=d(T,a,n))]]:[2,void 0];case 13:return v=c("frameName",e,a,n),_=c("tensor",e,a,n),n.enterFrame(v),[2,[N(_)]];case 14:return _=c("tensor",e,a,n),n.exitFrame(),[2,[N(_)]];case 15:return _=c("tensor",e,a,n),n.nextIteration(),[2,[N(_)]];case 16:return S=c("size",e,a,n),O=c("dtype",e,a,n),ie=c("elementShape",e,a,n),w=c("dynamicSize",e,a,n),A=c("clearAfterRead",e,a,n),E=c("identicalElementShapes",e,a,n),D=c("name",e,a,n),I=new J(D,O,S,ie,E,w,A),n.addTensorArray(I),[2,[I.idTensor,t.scalar(1)]];case 17:return k=c("tensorArrayId",e,a,n),W=c("index",e,a,n),re=c("tensor",e,a,n),(M=n.getTensorArray(k.id)).write(W,re),[2,[M.idTensor]];case 18:return V=c("tensorArrayId",e,a,n),U=c("index",e,a,n),[2,[n.getTensorArray(V.id).read(U)]];case 19:return K=c("tensorArrayId",e,a,n),X=c("indices",e,a,n),C=c("dtype",e,a,n),[2,[n.getTensorArray(K.id).gather(X,C)]];case 20:return L=c("tensorArrayId",e,a,n),G=c("indices",e,a,n),Q=c("tensor",e,a,n),(F=n.getTensorArray(L.id)).scatter(G,Q),[2,[F.idTensor]];case 21:return ae=c("tensorArrayId",e,a,n),z=n.getTensorArray(ae.id),ne=c("dtype",e,a,n),[2,[z.concat(ne)]];case 22:return P=c("tensorArrayId",e,a,n),pe=c("tensor",e,a,n),ue=c("lengths",e,a,n),(j=n.getTensorArray(P.id)).split(ue,pe),[2,[j.idTensor]];case 23:return R=c("tensorArrayId",e,a,n),B=n.getTensorArray(R.id),[2,[t.scalar(B.size(),"int32")]];case 24:return q=c("tensorArrayId",e,a,n),(H=n.getTensorArray(q.id)).clearAndClose(),[2,[H.idTensor]];case 25:return se=c("tensorListId",e,a,n),W=c("index",e,a,n),re=c("tensor",e,a,n),(me=n.getTensorList(se.id)).setItem(W,re),[2,[me.idTensor]];case 26:return se=c("tensorListId",e,a,n),U=c("index",e,a,n),ie=c("elementShape",e,a,n),oe=c("elementDType",e,a,n),[2,[(me=n.getTensorList(se.id)).getItem(U,ie,oe)]];case 27:return G=c("indices",e,a,n),Q=c("tensor",e,a,n),ie=c("elementShape",e,a,n),Z=c("numElements",e,a,n),me=function(e,a,n,r){if(a.length!==e.shape[0])throw new Error("Expected len(indices) == tensor.shape[0], but saw: "+a.length+" vs. "+e.shape[0]);var s=Math.max.apply(Math,i(a));if(null!=r&&-1!==r&&s>=r)throw new Error("Max index must be < array size ("+s+"  vs. "+r+")");var o=new $([],n,e.dtype,r),p=t.unstack(e,0);return a.forEach((function(e,t){o.setItem(e,p[t])})),o}(Q,G,ie,Z),n.addTensorList(me),[2,[me.idTensor]];case 28:return ie=c("elementShape",e,a,n),te=c("elementDType",e,a,n),Z=c("numElements",e,a,n),me=function(e,t,a){return new $([],e,t,a)}(ie,te,Z),n.addTensorList(me),[2,[me.idTensor]];case 29:return K=c("tensorListId",e,a,n),X=c("indices",e,a,n),ie=c("elementShape",e,a,n),te=c("elementDType",e,a,n),[2,[(me=n.getTensorList(K.id)).gather(X,te,ie)]];case 30:return se=c("tensorListId",e,a,n),ie=c("elementShape",e,a,n),te=c("elementDType",e,a,n),Z=c("numElements",e,a,n),[2,[(me=n.getTensorList(se.id)).stack(ie,te,Z)]];case 31:return ee=c("tensor",e,a,n),ie=c("elementShape",e,a,n),te=c("elementDType",e,a,n),me=function(e,a,n){var r=e.dtype;if(e.shape.length<1)throw new Error("Tensor must be at least a vector, but saw shape: "+e.shape);if(e.dtype!==n)throw new Error("Invalid data types; op elements "+e.dtype+", but list elements "+n);Y(e.shape.slice(1),a,"TensorList shape mismatch: ");var s=t.unstack(e);return new $(s,a,r)}(ee,ie,te),n.addTensorList(me),[2,[me.idTensor]];case 32:return ae=c("tensorListId",e,a,n),me=n.getTensorList(ae.id),ne=c("dtype",e,a,n),ie=c("elementShape",e,a,n),[2,[me.concat(ne,ie)]];case 33:return se=c("tensorListId",e,a,n),re=c("tensor",e,a,n),(me=n.getTensorList(se.id)).pushBack(re),[2,[me.idTensor]];case 34:return se=c("tensorListId",e,a,n),ie=c("elementShape",e,a,n),oe=c("elementDType",e,a,n),[2,[(me=n.getTensorList(se.id)).popBack(ie,oe)]];case 35:return pe=c("tensor",e,a,n),ie=c("elementShape",e,a,n),ue=c("lengths",e,a,n),me=function(e,a,n){var r=0,s=a.map((function(e){return r+=e}));if(r!==e.shape[0])throw new Error("Expected sum of lengths to be equal to\n          tensor.shape[0], but sum of lengths is\n        "+r+", and tensor's shape is: "+e.shape);for(var o=0===r?0:e.size/r,p=t.tidy((function(){var p=[];e=t.reshape(e,[1,r,o]);for(var i=0;i<a.length;++i){var u=[0,0===i?0:s[i-1],0],m=[1,a[i],o];p[i]=t.reshape(t.slice(e,u,m),n)}return e.dispose(),p})),i=new $([],n,e.dtype,a.length),u=0;u<p.length;u++)i.setItem(u,p[u]);return i}(pe,ue,ie),n.addTensorList(me),[2,[me.idTensor]];case 36:throw TypeError("Node type "+e.op+" is not implemented")}}))}))};function te(e,t,a){var n=p(c("fusedOps",e,t,a),2),r=n[0],s=n[1],o="biasadd"===r,i="prelu"===s,u="fusedbatchnorm"===r,m=c("numArgs",e,t,a);if(o){if(i&&2!==m)throw new Error("FusedConv2d and DepthwiseConv2d with BiasAdd and Prelu must have two extra arguments: bias and alpha.");if(!i&&1!==m)throw new Error("FusedConv2d and DepthwiseConv2d with BiasAdd must have one extra argument: bias.")}if(u)throw new Error("FusedConv2d and DepthwiseConv2d with FusedBatchNorm is not supported.");var d=c("strides",e,t,a),y=h(e,t,a),l=c("dataFormat",e,t,a).toUpperCase(),f=c("dilations",e,t,a),N=p(c("args",e,t,a),2);return{stride:d,pad:y,dataFormat:l,dilations:f,biasArg:N[0],preluArg:N[1],activationFunc:s}}function ae(e,t,a){return{boxes:c("boxes",e,t,a),scores:c("scores",e,t,a),maxOutputSize:c("maxOutputSize",e,t,a),iouThreshold:c("iouThreshold",e,t,a),scoreThreshold:c("scoreThreshold",e,t,a),softNmsSigma:c("softNmsSigma",e,t,a)}}var ne=function(){function e(e,a){this.keyDType=e,this.valueDType=a,this.handle=t.scalar(0),this.tensorMap=new Map,t.keep(this.handle)}return Object.defineProperty(e.prototype,"id",{get:function(){return this.handle.id},enumerable:!0,configurable:!0}),e.prototype.clearAndClose=function(){this.tensorMap.forEach((function(e){return e.dispose()})),this.tensorMap.clear(),this.handle.dispose()},e.prototype.size=function(){return this.tensorMap.size},e.prototype.import=function(e,a){return s(this,void 0,void 0,(function(){var n,r=this;return o(this,(function(s){switch(s.label){case 0:return this.checkKeyAndValueTensor(e,a),[4,e.data()];case 1:return n=s.sent(),this.tensorMap.forEach((function(e){return e.dispose()})),this.tensorMap.clear(),[2,t.tidy((function(){var e=t.unstack(a),s=n.length,o=e.length;t.util.assert(s===o,(function(){return"The number of elements doesn't match, keys has "+s+" elements, the values has "+o+" elements."}));for(var p=0;p<s;p++){var i=n[p],u=e[p];t.keep(u),r.tensorMap.set(i,u)}return r.handle}))]}}))}))},e.prototype.find=function(e,a){return s(this,void 0,void 0,(function(){var n,r=this;return o(this,(function(s){switch(s.label){case 0:return this.checkKeyAndValueTensor(e,a),[4,e.data()];case 1:return n=s.sent(),[2,t.tidy((function(){for(var e=[],s=0;s<n.length;s++){var o=n[s],p=r.findWithDefault(o,a);e.push(p)}return t.stack(e)}))]}}))}))},e.prototype.findWithDefault=function(e,t){var a=this.tensorMap.get(e);return null!=a?a:t},e.prototype.checkKeyAndValueTensor=function(e,t){if(e.dtype!==this.keyDType)throw new Error("Expect key dtype "+this.keyDType+", but got "+e.dtype);if(t.dtype!==this.valueDType)throw new Error("Expect value dtype "+this.valueDType+", but got "+t.dtype)},e}();function re(e,a,n,r){var i=function(e,a,n){switch(e.category){case"arithmetic":return t.tidy((function(){return function(e,a,n){switch(e.op){case"BiasAdd":case"AddV2":case"Add":return[t.add(c("a",e,a,n),c("b",e,a,n))];case"AddN":return[t.addN(c("tensors",e,a,n))];case"FloorMod":case"Mod":return[t.mod(c("a",e,a,n),c("b",e,a,n))];case"Mul":return[t.mul(c("a",e,a,n),c("b",e,a,n))];case"RealDiv":case"Div":return[t.div(c("a",e,a,n),c("b",e,a,n))];case"DivNoNan":return[t.divNoNan(c("a",e,a,n),c("b",e,a,n))];case"FloorDiv":return[t.floorDiv(c("a",e,a,n),c("b",e,a,n))];case"Sub":return[t.sub(c("a",e,a,n),c("b",e,a,n))];case"Minimum":return[t.minimum(c("a",e,a,n),c("b",e,a,n))];case"Maximum":return[t.maximum(c("a",e,a,n),c("b",e,a,n))];case"Pow":return[t.pow(c("a",e,a,n),c("b",e,a,n))];case"SquaredDifference":return[t.squaredDifference(c("a",e,a,n),c("b",e,a,n))];default:throw TypeError("Node type "+e.op+" is not implemented")}}(e,a,n)}));case"basic_math":return t.tidy((function(){return function(e,a,n){switch(e.op){case"Abs":case"ComplexAbs":return[t.abs(c("x",e,a,n))];case"Acos":return[t.acos(c("x",e,a,n))];case"Acosh":return[t.acosh(c("x",e,a,n))];case"Asin":return[t.asin(c("x",e,a,n))];case"Asinh":return[t.asinh(c("x",e,a,n))];case"Atan":return[t.atan(c("x",e,a,n))];case"Atan2":return[t.atan2(c("x",e,a,n),c("y",e,a,n))];case"Atanh":return[t.atanh(c("x",e,a,n))];case"Ceil":return[t.ceil(c("x",e,a,n))];case"Complex":return[t.complex(c("real",e,a,n),c("imag",e,a,n))];case"Cos":return[t.cos(c("x",e,a,n))];case"Cosh":return[t.cosh(c("x",e,a,n))];case"Elu":return[t.elu(c("x",e,a,n))];case"Erf":return[t.erf(c("x",e,a,n))];case"Exp":return[t.exp(c("x",e,a,n))];case"Expm1":return[t.expm1(c("x",e,a,n))];case"Floor":return[t.floor(c("x",e,a,n))];case"Log":return[t.log(c("x",e,a,n))];case"Log1p":return[t.log1p(c("x",e,a,n))];case"Imag":return[t.imag(c("x",e,a,n))];case"Neg":return[t.neg(c("x",e,a,n))];case"Reciprocal":return[t.reciprocal(c("x",e,a,n))];case"Real":return[t.real(c("x",e,a,n))];case"Relu":return[t.relu(c("x",e,a,n))];case"Round":return[t.round(c("x",e,a,n))];case"Selu":return[t.selu(c("x",e,a,n))];case"Sigmoid":return[t.sigmoid(c("x",e,a,n))];case"Sin":return[t.sin(c("x",e,a,n))];case"Sign":return[t.sign(c("x",e,a,n))];case"Sinh":return[t.sinh(c("x",e,a,n))];case"Softplus":return[t.softplus(c("x",e,a,n))];case"Sqrt":return[t.sqrt(c("x",e,a,n))];case"Square":return[t.square(c("x",e,a,n))];case"Tanh":return[t.tanh(c("x",e,a,n))];case"Tan":return[t.tan(c("x",e,a,n))];case"Relu6":case"ClipByValue":return[t.clipByValue(c("x",e,a,n),c("clipValueMin",e,a,n),c("clipValueMax",e,a,n))];case"Rsqrt":return[t.rsqrt(d(e.inputNames[0],a,n))];case"Prod":return[t.prod(c("x",e,a,n),c("axes",e,a,n))];case"LeakyRelu":return[t.leakyRelu(c("x",e,a,n),c("alpha",e,a,n))];case"Prelu":return[t.prelu(c("x",e,a,n),c("alpha",e,a,n))];default:throw TypeError("Node type "+e.op+" is not implemented")}}(e,a,n)}));case"control":return ee(e,a,n);case"convolution":return t.tidy((function(){return function(e,a,n){switch(e.op){case"Conv1D":var r=c("stride",e,a,n),s=c("pad",e,a,n),o=c("dataFormat",e,a,n).toUpperCase(),p=c("dilation",e,a,n);return[t.conv1d(c("x",e,a,n),c("filter",e,a,n),r,s,o,p)];case"Conv2D":r=c("strides",e,a,n),s=h(e,a,n),o=c("dataFormat",e,a,n).toUpperCase();var i=c("dilations",e,a,n);return[t.conv2d(c("x",e,a,n),c("filter",e,a,n),[r[1],r[2]],s,o,[i[1],i[2]])];case"_FusedConv2D":var u=te(e,a,n),m=(r=u.stride,s=u.pad,o=u.dataFormat,i=u.dilations,u.biasArg),d=u.preluArg,y=u.activationFunc;return[t.fused.conv2d({x:c("x",e,a,n),filter:c("filter",e,a,n),strides:[r[1],r[2]],pad:s,dataFormat:o,dilations:[i[1],i[2]],bias:m,activation:y,preluActivationWeights:d})];case"FusedDepthwiseConv2dNative":var l=te(e,a,n);r=l.stride,s=l.pad,o=l.dataFormat,i=l.dilations,m=l.biasArg,d=l.preluArg,y=l.activationFunc;return[t.fused.depthwiseConv2d({x:c("x",e,a,n),filter:c("filter",e,a,n),strides:[r[1],r[2]],pad:s,dataFormat:o,dilations:[i[1],i[2]],bias:m,activation:y,preluActivationWeights:d})];case"Conv2DBackpropInput":case"Conv2dTranspose":var f=c("outputShape",e,a,n);r=c("strides",e,a,n),s=h(e,a,n);return[t.conv2dTranspose(c("x",e,a,n),c("filter",e,a,n),f,[r[1],r[2]],s)];case"DepthwiseConv2dNative":case"DepthwiseConv2d":r=c("strides",e,a,n),s=h(e,a,n),i=c("dilations",e,a,n),o=c("dataFormat",e,a,n).toUpperCase();return[t.depthwiseConv2d(c("input",e,a,n),c("filter",e,a,n),[r[1],r[2]],s,o,[i[1],i[2]])];case"Conv3D":r=c("strides",e,a,n),s=c("pad",e,a,n),o=c("dataFormat",e,a,n).toUpperCase(),i=c("dilations",e,a,n);return[t.conv3d(c("x",e,a,n),c("filter",e,a,n),[r[1],r[2],r[3]],s,o,[i[1],i[2],i[3]])];case"AvgPool":r=c("strides",e,a,n),s=c("pad",e,a,n);var N=c("kernelSize",e,a,n);return[t.avgPool(c("x",e,a,n),[N[1],N[2]],[r[1],r[2]],s)];case"MaxPool":r=c("strides",e,a,n),s=c("pad",e,a,n),N=c("kernelSize",e,a,n);return[t.maxPool(c("x",e,a,n),[N[1],N[2]],[r[1],r[2]],s)];case"MaxPoolWithArgmax":r=c("strides",e,a,n),s=c("pad",e,a,n),N=c("kernelSize",e,a,n);var g=c("includeBatchInIndex",e,a,n),b=t.maxPoolWithArgmax(c("x",e,a,n),[N[1],N[2]],[r[1],r[2]],s,g);return[b.result,b.indexes];case"AvgPool3D":r=c("strides",e,a,n),s=c("pad",e,a,n),N=c("kernelSize",e,a,n);return[t.avgPool3d(c("x",e,a,n),[N[1],N[2],N[3]],[r[1],r[2],r[3]],s)];case"MaxPool3D":r=c("strides",e,a,n),s=c("pad",e,a,n),N=c("kernelSize",e,a,n);return[t.maxPool3d(c("x",e,a,n),[N[1],N[2],N[3]],[r[1],r[2],r[3]],s)];case"Dilation2D":var x=c("strides",e,a,n),T=(s=c("pad",e,a,n),i=c("dilations",e,a,n),x[1]),v=x[2],_=i[1],S=i[2];return[t.dilation2d(c("x",e,a,n),c("filter",e,a,n),[T,v],s,[_,S],"NHWC")];default:throw TypeError("Node type "+e.op+" is not implemented")}}(e,a,n)}));case"creation":return t.tidy((function(){return function(e,a,n){switch(e.op){case"Fill":var r=c("shape",e,a,n),s=c("dtype",e,a,n),o=c("value",e,a,n);return[t.fill(r,o,s)];case"LinSpace":var p=c("start",e,a,n),i=c("stop",e,a,n),u=c("num",e,a,n);return[t.linspace(p,i,u)];case"Multinomial":var m=c("logits",e,a,n),d=c("numSamples",e,a,n),y=c("seed",e,a,n);return[t.multinomial(m,d,y)];case"OneHot":var l=c("indices",e,a,n),f=c("depth",e,a,n),h=c("onValue",e,a,n),N=c("offValue",e,a,n);return[t.oneHot(l,f,h,N)];case"Ones":return[t.ones(c("shape",e,a,n),c("dtype",e,a,n))];case"OnesLike":return[t.onesLike(c("x",e,a,n))];case"RandomUniform":return[t.randomUniform(c("shape",e,a,n),c("minval",e,a,n),c("maxval",e,a,n),c("dtype",e,a,n))];case"Range":p=c("start",e,a,n);var g=c("stop",e,a,n),b=c("step",e,a,n);return[t.range(p,g,b,c("dtype",e,a,n))];case"TruncatedNormal":r=c("shape",e,a,n);var x=c("mean",e,a,n),T=c("stdDev",e,a,n);y=c("seed",e,a,n);return[t.truncatedNormal(r,x,T,c("dtype",e,a,n),y)];case"Zeros":return[t.zeros(c("shape",e,a,n),c("dtype",e,a,n))];case"ZerosLike":return[t.zerosLike(c("x",e,a,n))];default:throw TypeError("Node type "+e.op+" is not implemented")}}(e,a,n)}));case"dynamic":return function(e,a,n){return s(void 0,void 0,void 0,(function(){var r,s,p,i,u,m,d,y,l,f,h,N;return o(this,(function(o){switch(o.label){case 0:switch(e.op){case"NonMaxSuppressionV5":return[3,1];case"NonMaxSuppressionV4":return[3,3];case"NonMaxSuppressionV3":case"NonMaxSuppressionV2":return[3,5];case"Where":return[3,7];case"ListDiff":return[3,9]}return[3,10];case 1:return r=ae(e,a,n),m=r.boxes,d=r.scores,y=r.maxOutputSize,l=r.iouThreshold,f=r.scoreThreshold,s=r.softNmsSigma,[4,t.image.nonMaxSuppressionWithScoreAsync(m,d,y,l,f,s)];case 2:return[2,[(N=o.sent()).selectedIndices,N.selectedScores]];case 3:return p=ae(e,a,n),m=p.boxes,d=p.scores,y=p.maxOutputSize,l=p.iouThreshold,f=p.scoreThreshold,i=c("padToMaxOutputSize",e,a,n),[4,t.image.nonMaxSuppressionPaddedAsync(m,d,y,l,f,i)];case 4:return[2,[(N=o.sent()).selectedIndices,N.validOutputs]];case 5:return u=ae(e,a,n),m=u.boxes,d=u.scores,y=u.maxOutputSize,l=u.iouThreshold,f=u.scoreThreshold,[4,t.image.nonMaxSuppressionAsync(m,d,y,l,f)];case 6:return[2,[o.sent()]];case 7:return h=t.cast(c("condition",e,a,n),"bool"),[4,t.whereAsync(h)];case 8:return N=[o.sent()],h.dispose(),[2,N];case 9:return[2,t.setdiff1dAsync(c("x",e,a,n),c("y",e,a,n))];case 10:throw TypeError("Node type "+e.op+" is not implemented")}}))}))}(e,a,n);case"evaluation":return t.tidy((function(){return function(e,a,n){switch(e.op){case"TopKV2":var r=c("x",e,a,n),s=c("k",e,a,n),o=c("sorted",e,a,n);return[(p=t.topk(r,s,o)).values,p.indices];case"Unique":r=c("x",e,a,n);return[(p=t.unique(r)).values,p.indices];case"UniqueV2":r=c("x",e,a,n);var p,i=c("axis",e,a,n);return[(p=t.unique(r,i)).values,p.indices];default:throw TypeError("Node type "+e.op+" is not implemented")}}(e,a,n)}));case"image":return t.tidy((function(){return function(e,a,n){switch(e.op){case"ResizeBilinear":var r=c("images",e,a,n),s=c("size",e,a,n),o=c("alignCorners",e,a,n);return[t.image.resizeBilinear(r,[s[0],s[1]],o)];case"ResizeNearestNeighbor":r=c("images",e,a,n),s=c("size",e,a,n),o=c("alignCorners",e,a,n);return[t.image.resizeNearestNeighbor(r,[s[0],s[1]],o)];case"CropAndResize":var p=c("image",e,a,n),i=c("boxes",e,a,n),u=c("boxInd",e,a,n),m=c("cropSize",e,a,n),d=c("method",e,a,n),y=c("extrapolationValue",e,a,n);return[t.image.cropAndResize(p,i,u,m,d,y)];default:throw TypeError("Node type "+e.op+" is not implemented")}}(e,a,n)}));case"graph":return t.tidy((function(){return function(e,a,n){switch(e.op){case"Const":return a[e.name];case"PlaceholderWithDefault":var r=c("default",e,a,n);return[d(e.name,a,n)||r];case"Placeholder":return[d(e.name,a,n)];case"Identity":case"StopGradient":case"FakeQuantWithMinMaxVars":return[N(c("x",e,a,n))];case"IdentityN":return c("x",e,a,n).map((function(e){return N(e)}));case"Snapshot":return[N(c("x",e,a,n))];case"Shape":return[t.tensor1d(c("x",e,a,n).shape,"int32")];case"ShapeN":return c("x",e,a,n).map((function(e){return t.tensor1d(e.shape)}));case"Size":return[t.scalar(c("x",e,a,n).size,"int32")];case"Rank":return[t.scalar(c("x",e,a,n).rank,"int32")];case"NoOp":return[t.scalar(1)];case"Print":var s=c("x",e,a,n),o=c("data",e,a,n),p=c("message",e,a,n),i=c("summarize",e,a,n);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")}}(e,a,n)}));case"logical":return t.tidy((function(){return function(e,a,n){switch(e.op){case"Equal":return[t.equal(c("a",e,a,n),c("b",e,a,n))];case"NotEqual":return[t.notEqual(c("a",e,a,n),c("b",e,a,n))];case"Greater":return[t.greater(c("a",e,a,n),c("b",e,a,n))];case"GreaterEqual":return[t.greaterEqual(c("a",e,a,n),c("b",e,a,n))];case"Less":return[t.less(c("a",e,a,n),c("b",e,a,n))];case"LessEqual":return[t.lessEqual(c("a",e,a,n),c("b",e,a,n))];case"LogicalAnd":return[t.logicalAnd(c("a",e,a,n),c("b",e,a,n))];case"LogicalNot":return[t.logicalNot(c("a",e,a,n))];case"LogicalOr":return[t.logicalOr(c("a",e,a,n),c("b",e,a,n))];case"Select":case"SelectV2":return[t.where(c("condition",e,a,n),c("a",e,a,n),c("b",e,a,n))];default:throw TypeError("Node type "+e.op+" is not implemented")}}(e,a,n)}));case"matrices":return t.tidy((function(){return function(e,a,n){switch(e.op){case"BatchMatMul":case"BatchMatMulV2":case"MatMul":return[t.matMul(c("a",e,a,n),c("b",e,a,n),c("transposeA",e,a,n),c("transposeB",e,a,n))];case"Transpose":return[t.transpose(c("x",e,a,n),c("perm",e,a,n))];case"_FusedMatMul":var r=p(c("fusedOps",e,a,n),2),s=r[0],o=r[1],i="biasadd"===s,u="prelu"===o,m=c("numArgs",e,a,n);if(i){if(u&&2!==m)throw new Error("Fused MatMul with BiasAdd and Prelu must have two extra arguments: bias and alpha.");if(!u&&1!==m)throw new Error("Fused MatMul with BiasAdd must have one extra argument: bias.")}var d=p(c("args",e,a,n),2),y=d[0],l=d[1];return[t.fused.matMul({a:c("a",e,a,n),b:c("b",e,a,n),transposeA:c("transposeA",e,a,n),transposeB:c("transposeB",e,a,n),bias:y,activation:o,preluActivationWeights:l})];default:throw TypeError("Node type "+e.op+" is not implemented")}}(e,a,n)}));case"normalization":return t.tidy((function(){return function(e,a,n){switch(e.op){case"FusedBatchNorm":case"FusedBatchNormV2":case"FusedBatchNormV3":return[t.batchNorm(c("x",e,a,n),c("mean",e,a,n),c("variance",e,a,n),c("offset",e,a,n),c("scale",e,a,n),c("epsilon",e,a,n))];case"LRN":return[t.localResponseNormalization(c("x",e,a,n),c("radius",e,a,n),c("bias",e,a,n),c("alpha",e,a,n),c("beta",e,a,n))];case"Softmax":return[t.softmax(c("x",e,a,n))];case"LogSoftmax":return[t.logSoftmax(c("x",e,a,n))];case"SparseToDense":return[t.sparseToDense(c("sparseIndices",e,a,n),c("outputShape",e,a,n),c("sparseValues",e,a,n),c("defaultValue",e,a,n))];default:throw TypeError("Node type "+e.op+" is not implemented")}}(e,a,n)}));case"reduction":return t.tidy((function(){return function(e,a,n){switch(e.op){case"Max":var r=c("axis",e,a,n),s=c("keepDims",e,a,n);return[t.max(c("x",e,a,n),r,s)];case"Mean":r=c("axis",e,a,n),s=c("keepDims",e,a,n);return[t.mean(c("x",e,a,n),r,s)];case"Min":r=c("axis",e,a,n),s=c("keepDims",e,a,n);return[t.min(c("x",e,a,n),r,s)];case"Sum":r=c("axis",e,a,n),s=c("keepDims",e,a,n);return[t.sum(c("x",e,a,n),r,s)];case"All":r=c("axis",e,a,n),s=c("keepDims",e,a,n);return[t.all(c("x",e,a,n),r,s)];case"Any":r=c("axis",e,a,n),s=c("keepDims",e,a,n);return[t.any(c("x",e,a,n),r,s)];case"ArgMax":r=c("axis",e,a,n);return[t.argMax(c("x",e,a,n),r)];case"ArgMin":r=c("axis",e,a,n);return[t.argMin(c("x",e,a,n),r)];case"Prod":r=c("axis",e,a,n),s=c("keepDims",e,a,n);return[t.prod(c("x",e,a,n),r,s)];case"Cumsum":r=c("axis",e,a,n);var o=c("exclusive",e,a,n),p=c("reverse",e,a,n);return[t.cumsum(c("x",e,a,n),r,o,p)];default:throw TypeError("Node type "+e.op+" is not implemented")}}(e,a,n)}));case"slice_join":return t.tidy((function(){return function(e,a,n){switch(e.op){case"ConcatV2":case"Concat":var r=c("n",e,a,n),s=c("axis",e,a,n),o=c("tensors",e,a,n);return o=o.slice(0,r),[t.concat(o,s)];case"GatherV2":case"Gather":s=c("axis",e,a,n);var p=c("x",e,a,n),i=c("indices",e,a,n);return[t.gather(p,t.cast(i,"int32"),s)];case"ReverseV2":case"Reverse":s=c("axis",e,a,n),p=c("x",e,a,n);return[t.reverse(p,s)];case"Slice":var u=c("begin",e,a,n),m=c("size",e,a,n);return[t.slice(c("x",e,a,n),u,m)];case"StridedSlice":u=c("begin",e,a,n);var d=c("end",e,a,n),y=c("strides",e,a,n),l=c("beginMask",e,a,n),f=c("endMask",e,a,n),h=c("ellipsisMask",e,a,n),N=c("newAxisMask",e,a,n),g=c("shrinkAxisMask",e,a,n),b=c("x",e,a,n);return[t.stridedSlice(b,u,d,y,l,f,h,N,g)];case"Pack":return t.tidy((function(){var r=c("axis",e,a,n),s=c("tensors",e,a,n),o=s[0].shape,p=t.squeeze(s[0]).shape,i=s.map((function(e){var a=t.util.arraysEqual(e.shape,o);if(!a&&!t.util.arraysEqual(t.squeeze(e).shape,p))throw new Error("the input tensors shape does not match");return a?e:t.reshape(e,o)}));return[t.stack(i,r)]}));case"Unpack":s=c("axis",e,a,n),b=c("tensor",e,a,n);return t.unstack(b,s);case"Tile":var x=c("reps",e,a,n);return[t.tile(c("x",e,a,n),x)];case"Split":case"SplitV":s=c("axis",e,a,n);var T=c("numOrSizeSplits",e,a,n);b=c("x",e,a,n);return t.split(b,T,s);case"ScatterNd":i=c("indices",e,a,n);var v=c("values",e,a,n),_=c("shape",e,a,n);return[t.scatterND(i,v,_)];case"GatherNd":var S=c("x",e,a,n);i=c("indices",e,a,n);return[t.gatherND(S,i)];case"SparseToDense":i=c("sparseIndices",e,a,n),_=c("outputShape",e,a,n);var O=c("sparseValues",e,a,n),w=c("defaultValue",e,a,n);return[t.sparseToDense(i,O,_,O.dtype===w.dtype?w:t.cast(w,O.dtype))];default:throw TypeError("Node type "+e.op+" is not implemented")}}(e,a,n)}));case"spectral":return t.tidy((function(){return function(e,a,n){switch(e.op){case"FFT":return[t.fft(c("x",e,a,n))];case"IFFT":return[t.ifft(c("x",e,a,n))];case"RFFT":return[t.rfft(c("x",e,a,n))];case"IRFFT":return[t.irfft(c("x",e,a,n))];default:throw TypeError("Node type "+e.op+" is not implemented")}}(e,a,n)}));case"transformation":return t.tidy((function(){return function(e,a,n){switch(e.op){case"Cast":return[t.cast(c("x",e,a,n),c("dtype",e,a,n))];case"ExpandDims":var r=c("axis",e,a,n);return[t.expandDims(c("x",e,a,n),r)];case"Squeeze":r=c("axis",e,a,n);return[t.squeeze(c("x",e,a,n),r)];case"Reshape":return[t.reshape(c("x",e,a,n),c("shape",e,a,n))];case"MirrorPad":return[t.mirrorPad(c("x",e,a,n),c("padding",e,a,n),c("mode",e,a,n))];case"PadV2":case"Pad":return[t.pad(c("x",e,a,n),c("padding",e,a,n),c("constantValue",e,a,n))];case"SpaceToBatchND":var s=c("blockShape",e,a,n),o=c("paddings",e,a,n);return[t.spaceToBatchND(c("x",e,a,n),s,o)];case"BatchToSpaceND":s=c("blockShape",e,a,n);var p=c("crops",e,a,n);return[t.batchToSpaceND(c("x",e,a,n),s,p)];case"DepthToSpace":var i=c("blockSize",e,a,n),u=c("dataFormat",e,a,n).toUpperCase();return[t.depthToSpace(c("x",e,a,n),i,u)];case"BroadcastTo":return[t.broadcastTo(c("x",e,a,n),c("shape",e,a,n))];default:throw TypeError("Node type "+e.op+" is not implemented")}}(e,a,n)}));case"hash_table":return function(e,t,a,n){return s(void 0,void 0,void 0,(function(){var r,s,p,i,u,m,d;return o(this,(function(o){switch(o.label){case 0:switch(e.op){case"HashTable":case"HashTableV2":return[3,1];case"LookupTableImport":case"LookupTableImportV2":return[3,2];case"LookupTableFind":case"LookupTableFindV2":return[3,4]}return[3,6];case 1:return r=c("keyDType",e,t,a),s=c("valueDType",e,t,a),d=new ne(r,s),n.addHashTable(e.name,d),[2,[d.handle]];case 2:return i=c("tableHandle",e,t,a,n),u=c("keys",e,t,a),p=c("values",e,t,a),[4,(d=n.getHashTableById(i.id)).import(u,p)];case 3:return[2,[o.sent()]];case 4:return i=c("tableHandle",e,t,a,n),u=c("keys",e,t,a),m=c("defaultValue",e,t,a),[4,(d=n.getHashTableById(i.id)).find(u,m)];case 5:return[2,[o.sent()]];case 6:throw TypeError("Node type "+e.op+" is not implemented")}}))}))}(e,a,n,r);case"custom":var i=m(e.op);if(i&&i.customExecutor)return i.customExecutor(new Z(e,a,n));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,n);return t.util.isPromise(i)?i.then((function(e){return[].concat(e)})):[].concat(i)}var se=function(){function e(e,t,a,n){void 0===e&&(e={}),void 0===t&&(t={}),void 0===a&&(a={}),void 0===n&&(n={}),this.weightMap=e,this.tensorArrayMap=t,this.tensorListMap=a,this.functionMap=n,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.prototype.addTensorList=function(e){this.tensorListMap[e.id]=e},e.prototype.getTensorList=function(e){return this.tensorListMap[e]},e.prototype.dispose=function(e){for(var t in this.tensorArrayMap)this.tensorArrayMap[t].clearAndClose(e);for(var t in this.tensorListMap)this.tensorListMap[t].clearAndClose(e)},e}();function oe(e,t,a,n){var r=new Set,s=[],o=null,p=null,u=new Set,m=Object.keys(e).map((function(e){return f(e)[0]})),c=[];null!=n&&(c=n.map((function(e){return f(e.name)[0]})));for(var d=i(t);d.length>0;){var y=d.pop();(me(y)||ce(y)||de(y))&&null==o&&(p=(o=y).children.map((function(e){return e.name})).filter((function(e){return r.has(e)}))),r.add(y.name),null==a[y.name]&&(-1===m.indexOf(y.name)&&-1===c.indexOf(y.name)&&(0!==y.inputs.length?y.inputs.forEach((function(e){u.has(e.name)||(u.add(e.name),d.push(e))})):s.push(y.name)))}return{inputs:e,outputs:t,usedNodes:r,missingInputs:s,dynamicNode:o,syncInputs:p}}var pe=["Switch","Merge","Enter","Exit","NextIteration","StatelessIf","StatelessWhile","if","While"],ie=["NonMaxSuppressionV2","NonMaxSuppressionV3","NonMaxSuppressionV5","Where"],ue=["HashTable","HashTableV2","LookupTableImport","LookupTableImportV2","LookupTableFind","LookupTableFindV2"];function me(e){return pe.indexOf(e.op)>=0}function ce(e){return ie.indexOf(e.op)>=0}function de(e){return ue.indexOf(e.op)>=0}var ye=function(){function e(t,a){var n=this;this.graph=t,this.parent=a,this.compiledMap=new Map,this._weightMap={},this.SEPERATOR=",",this._functions={},this._functionExecutorMap={},this._outputs=t.outputs,this._inputs=t.inputs,this._initNodes=t.initNodes,this._signature=t.signature,this._functions=t.functions,null!=t.functions&&Object.keys(t.functions).forEach((function(a){n._functionExecutorMap[a]=new e(t.functions[a],n)}))}return Object.defineProperty(e.prototype,"weightIds",{get:function(){return this.parent?this.parent.weightIds:this._weightIds},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"functionExecutorMap",{get:function(){return this.parent?this.parent.functionExecutorMap:this._functionExecutorMap},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"weightMap",{get:function(){return this.parent?this.parent.weightMap: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([],i(t)),this._weightMap=e},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"resourceManager",{set:function(e){this._resourceManager=e},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"inputs",{get:function(){return this._inputs.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._inputs.map((function(e){return e.signatureKey||e.name}))},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"outputNodes",{get:function(){return this._outputs.map((function(e){var t=e.signatureKey||e.name;return e.defaultOutput?t+":"+e.defaultOutput:t}))},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"functions",{get:function(){var e=this;return Object.keys(this._functions).reduce((function(t,a){return t[a]=e._functions[a].signature,t}),{})},enumerable:!0,configurable:!0}),e.prototype.getCompilationKey=function(e,t){var a=e.map((function(e){return e.name})).sort(),n=t.map((function(e){return e.name})).sort();return a.join(this.SEPERATOR)+"--"+n.join(this.SEPERATOR)},e.prototype.compile=function(e,t){var a=oe(e,t,this.weightMap,this._initNodes),n=a.missingInputs,r=a.dynamicNode,s=a.syncInputs;if(null!=r)throw new Error("This execution contains the node '"+r.name+"', which has the dynamic op '"+r.op+"'. Please use model.executeAsync() instead. Alternatively, to avoid the dynamic ops, specify the inputs ["+s+"]");if(n.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: ["+n+"]")}return function(e,t,a){var n=a.usedNodes,r=a.inputs,s=[],o=Object.keys(r).map((function(e){return f(e)[0]})).map((function(t){return e.nodes[t]})),p=e.initNodes;o.forEach((function(e){n.has(e.name)&&s.push(e)})),e.weights.forEach((function(e){n.has(e.name)&&s.push(e)})),null!=p&&p.forEach((function(e){n.has(e.name)&&s.push(e)}));for(var i=new Set,u=[];s.length>0;){var m=s.pop();i.add(m.name),t[m.name]||u.push(m),m.children.forEach((function(e){!i.has(e.name)&&n.has(e.name)&&e.inputs.every((function(e){return i.has(e.name)}))&&s.push(e)}))}return u}(this.graph,this.weightMap,a)},e.prototype.execute=function(e,a){var n=this;e=this.mapInputs(e);var s=Object.keys(e).sort();this.checkInputs(e),this.checkInputShapeAndType(e),a=this.mapOutputs(a),this.checkOutputs(a);var o=s.map((function(e){return n.graph.nodes[f(e)[0]]})),i=a.map((function(e){return f(e)[0]})),u=i.map((function(e){return n.graph.nodes[e]}));0===u.length&&(u=this._outputs);var m=this.getCompilationKey(o,u),c=this.compiledMap.get(m);null==c&&(c=this.compile(e,u),this.compiledMap.set(m,c));var y={},l={};return t.tidy((function(){var s=new se(n.weightMap,y,l,n.functionExecutorMap),o=r({},n.weightMap);Object.keys(e).forEach((function(t){var a=p(f(t),2),n=a[0],r=[];r[a[1]]=e[t],o[n]=r}));for(var u=n.getFrozenTensorIds(o),m={},h=0;h<c.length;h++){var N=c[h];if(!o[N.name]){var g=re(N,o,s,n._resourceManager);if(t.util.isPromise(g))throw new Error("The execution of the op '"+N.op+"' returned a promise. Please use model.executeAsync() instead.");o[N.name]=g,n.checkTensorForDisposal(N.name,N,o,s,u,i,m)}}return null==n.parent&&s.dispose(u),a.map((function(e){return d(e,o,s)}))}))},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,n,r,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[l(e,a.currentContextId)]}(e.name,a,n);null!=t&&t.forEach((function(e){if(e&&!r.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 s(this,void 0,void 0,(function(){return o(this,(function(a){return[2,this._executeAsync(e,t)]}))}))},e.prototype._executeAsync=function(e,t,a,n,r){return void 0===a&&(a=!1),void 0===n&&(n={}),void 0===r&&(r={}),s(this,void 0,void 0,(function(){var s,p,u,m,c,y;return o(this,(function(o){switch(o.label){case 0:return a||(e=this.mapInputs(e),this.checkInputs(e),this.checkInputShapeAndType(e),t=this.mapOutputs(t),this.checkOutputs(t)),s=new se(this.weightMap,n,r,this.functionExecutorMap),[4,this.executeWithControlFlow(e,s,t,a)];case 1:return p=o.sent(),u=t.map((function(e){return d(e,p,s)})),m=u.map((function(e){return e.id})),c=Object.keys(e).map((function(t){return e[t].id})),y=new Set(i(m,c,this.weightIds)),Object.keys(p).forEach((function(e){p[e].forEach((function(e){!e||e.isDisposed||y.has(e.id)||e.dispose()}))})),null==this.parent&&s.dispose(y),[2,u]}}))}))},e.prototype.executeFunctionAsync=function(e,t,a){return s(this,void 0,void 0,(function(){var n,r=this;return o(this,(function(s){return n=e.reduce((function(e,t,a){return e[r.inputs[a].name]=t,e}),{}),[2,this._executeAsync(n,this.outputNodes,!0,t,a)]}))}))},e.prototype.executeWithControlFlow=function(e,t,a,n){return s(this,void 0,void 0,(function(){var s,u,m,c,y,l,h,N,g,b,x,T,v,_,S,O,w,A=this;return o(this,(function(o){switch(o.label){case 0:s=Object.keys(e),u=s.map((function(e){return A.graph.nodes[f(e)[0]]})),m=a.map((function(e){return f(e)[0]})),0===(c=m.map((function(e){return A.graph.nodes[e]}))).length&&(c=this._outputs),y=oe(e,c,this.weightMap,this._initNodes),l=y.usedNodes,h=y.missingInputs,N=y.dynamicNode,g=y.syncInputs,b=i(u,this.graph.weights,this._initNodes||[]).map((function(e){return{node:e,contexts:t.currentContext}})),x=r({},this.weightMap),Object.keys(e).forEach((function(t){var a=p(f(t),2),n=a[0],r=[];r[a[1]]=e[t],x[n]=r})),T={},v=this.getFrozenTensorIds(x),_={},o.label=1;case 1:return b.length>0?(S=this.processStack(u,b,t,x,_,v,m,T,l),[4,Promise.all(S)]):[3,3];case 2:return o.sent(),[3,1];case 3:if(null!=N||n||console.warn("This model execution did not contain any nodes with control flow or dynamic output shapes. You can use model.execute() instead."),(O=c.filter((function(e){return!me(e)&&!d(e.name,x,t)})).map((function(e){return e.name}))).length>0)throw w="",null!=N&&(w="Alternatively, to avoid the dynamic ops, use model.execute() and specify the inputs ["+g+"]"),new Error("Cannot compute the outputs ["+O+"] from the provided inputs ["+s+"]. Consider providing the following inputs: ["+h+"]. "+w);return[2,x]}}))}))},e.prototype.processStack=function(e,a,n,r,s,o,i,u,m){for(var d=this,l=[],f=function(){var e,f,N=a.pop();n.currentContext=N.contexts;var g="";if("Enter"===N.node.op&&c("isConstant",N.node,r,n)&&(e=p(y(N.node.name,n),1),g=e[0]),null==r[N.node.name]){var b=re(N.node,r,n,h._resourceManager);g||(f=p(y(N.node.name,n),1),g=f[0]);var x=n.currentContext;t.util.isPromise(b)?l.push(b.then((function(e){return r[g]=e,n.currentContext=x,d.checkTensorForDisposal(g,N.node,r,n,o,i,u),d.processChildNodes(N.node,a,n,r,s,m),e}))):(r[g]=b,h.checkTensorForDisposal(g,N.node,r,n,o,i,u),h.processChildNodes(N.node,a,n,r,s,m))}else h.processChildNodes(N.node,a,n,r,s,m)},h=this;a.length>0;)f();return l},e.prototype.processChildNodes=function(e,t,a,n,r,s){e.children.forEach((function(e){var o=p(y(e.name,a),1)[0];!r[o]&&s.has(e.name)&&("Merge"===e.op?e.inputNames.some((function(e){return!!d(e,n,a)}))&&(r[o]=!0,t.push({contexts:a.currentContext,node:e})):e.inputNames.every((function(e){return!!d(e,n,a)}))&&(r[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(n){var r=e[n],s=p(f(n),1)[0],o=a.graph.nodes[s];if(o.attrParams.shape&&o.attrParams.shape.value){var i=o.attrParams.shape.value,u=i.length===r.shape.length&&r.shape.every((function(e,t){return-1===i[t]||i[t]===e}));t.util.assert(u,(function(){return"The shape of dict['"+o.name+"'] provided in model.execute(dict) must be ["+i+"], but was ["+r.shape+"]"}))}o.attrParams.dtype&&o.attrParams.dtype.value&&t.util.assert(r.dtype===o.attrParams.dtype.value,(function(){return"The dtype of dict['"+o.name+"'] provided in model.execute(dict) must be "+o.attrParams.dtype.value+", but was "+r.dtype}))}))},e.prototype.mapInputs=function(e){var t={};for(var a in e){if(null!=this._signature&&null!=this._signature.inputs&&null!=this._signature.inputs[a])t[this._signature.inputs[a].name]=e[a];else t[a]=e[a]}return t},e.prototype.checkInputs=function(e){var t=this,a=Object.keys(e).filter((function(e){var a=p(f(e),1)[0];return null==t.graph.nodes[a]}));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.mapOutputs=function(e){var t=this;return e.map((function(e){return null!=t._signature&&null!=t._signature.outputs&&null!=t._signature.outputs[e]?t._signature.outputs[e].name:e}),{})},e.prototype.checkOutputs=function(e){var t=this;e.forEach((function(e){var a=p(f(e),1)[0];if(!t.graph.nodes[a])throw new Error("The output '"+e+"' is not found in the graph")}))},e}(),le=function(){function e(e,t){void 0===e&&(e={}),void 0===t&&(t={}),this.hashTableNameToHandle=e,this.hashTableMap=t}return e.prototype.addHashTable=function(e,t){this.hashTableNameToHandle[e]=t.handle,this.hashTableMap[t.id]=t},e.prototype.getHashTableHandleByName=function(e){return this.hashTableNameToHandle[e]},e.prototype.getHashTableById=function(e){return this.hashTableMap[e]},e.prototype.dispose=function(){for(var e in this.hashTableMap)this.hashTableMap[e].clearAndClose(),delete this.hashTableMap[e];for(var t in this.hashTableNameToHandle)this.hashTableNameToHandle[t].dispose(),delete this.hashTableNameToHandle[t]},e}(),fe=function(){function e(e,t){void 0===t&&(t={}),this.modelUrl=e,this.loadOptions=t,this.version="n/a",null==t&&(this.loadOptions={}),this.resourceManager=new le}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.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);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 s(this,void 0,void 0,(function(){var e;return o(this,(function(t){switch(t.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=t.sent(),[2,this.loadSync(e)]}}))}))},e.prototype.loadSync=function(e){this.artifacts=e;var a=this.artifacts.modelTopology,n={};null!=this.artifacts.userDefinedMetadata&&(n=this.artifacts.userDefinedMetadata.signature),this.version=a.versions.producer+"."+a.versions.minConsumer;var r=t.io.decodeWeights(this.artifacts.weightData,this.artifacts.weightSpecs);if(this.executor=new ye(L.Instance.transformGraph(a,n)),this.executor.weightMap=this.convertTensorMapToTensorsMap(r),this.executor.resourceManager=this.resourceManager,null!=e.modelInitializer){var s=L.Instance.transformGraph(e.modelInitializer);this.initializer=new ye(s),this.initializer.weightMap=this.executor.weightMap,this.initializer.resourceManager=this.resourceManager,this.initializer.executeAsync({},[])}return!0},e.prototype.save=function(e,a){return s(this,void 0,void 0,(function(){var a;return o(this,(function(n){if("string"==typeof e){if(0===(a=t.io.getSaveHandlers(e)).length)throw new Error("Cannot find any save handlers for URL '"+e+"'");if(a.length>1)throw new Error("Found more than one ("+a.length+") save handlers for URL '"+e+"'");e=a[0]}if(null==e.save)throw new Error("GraphModel.save() cannot proceed because the IOHandler provided does not have the `save` attribute defined.");return[2,e.save(this.artifacts)]}))}))},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,n){return t[a]=e[n],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 s(this,void 0,void 0,(function(){var a;return o(this,(function(n){switch(n.label){case 0:return e=this.normalizeInputs(e),t=this.normalizeOutputs(t),[4,this.executor.executeAsync(e,t)];case 1:return[2,(a=n.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(),this.initializer&&this.initializer.dispose(),this.resourceManager.dispose()},e}();e.GraphModel=fe,e.deregisterOp=function(e){delete u[e]},e.loadGraphModel=function(e,t){return void 0===t&&(t={}),s(this,void 0,void 0,(function(){var a;return o(this,(function(n){switch(n.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+="model.json?tfjs-format=file"),[4,(a=new fe(e,t)).load()];case 1:return n.sent(),[2,a]}}))}))},e.registerOp=function(e,t){var a={tfOpName:e,category:"custom",inputs:[],attrs:[],customExecutor:t};u[e]=a},e.version_converter="2.7.0",Object.defineProperty(e,"__esModule",{value:!0})}));
  //# sourceMappingURL=index.js.map
  