diff --git a/package.json b/package.json index d2370f34531..9763aa727a3 100755 --- a/package.json +++ b/package.json @@ -6,8 +6,8 @@ "email": "lutzroeder@users.noreply.github.com", "url": "https://www.lutzroeder.com" }, - "version": "7.1.4", - "date": "2023-08-17 21:47:36", + "version": "7.1.6", + "date": "2023-09-02 16:04:30", "description": "Visualizer for neural network, deep learning, and machine learning models", "license": "MIT", "repository": "lutzroeder/netron", @@ -31,10 +31,10 @@ "electron-updater": "6.1.1" }, "devDependencies": { - "electron": "26.0.0", + "electron": "26.1.0", "electron-builder": "24.6.3", "@electron/notarize": "2.1.0", - "eslint": "8.47.0" + "eslint": "8.48.0" }, "eslintConfig": { "env": { diff --git a/source/bigdl.js b/source/bigdl.js index 762692b2f45..8fa3ed3aa77 100644 --- a/source/bigdl.js +++ b/source/bigdl.js @@ -327,11 +327,11 @@ bigdl.Tensor = class { case 'float32': if (storage.bytes_data && storage.bytes_data.length > 0) { this._values = storage.bytes_data[0]; - this._layout = '<'; + this._encoding = '<'; } else if (storage.float_data && storage.float_data.length > 0) { this._values = storage.float_data; - this._layout = '|'; + this._encoding = '|'; } break; default: @@ -349,8 +349,8 @@ bigdl.Tensor = class { return this._type; } - get layout() { - return this._layout; + get encoding() { + return this._encoding; } get values() { diff --git a/source/caffe.js b/source/caffe.js index 0f93b6a1a82..3698c3ccf7b 100644 --- a/source/caffe.js +++ b/source/caffe.js @@ -627,7 +627,7 @@ caffe.Tensor = class { return this._type; } - get layout() { + get encoding() { return '|'; } diff --git a/source/caffe2.js b/source/caffe2.js index cd19db81d84..d560dd7255b 100644 --- a/source/caffe2.js +++ b/source/caffe2.js @@ -561,7 +561,7 @@ caffe2.Tensor = class { return null; } - get layout() { + get encoding() { return '|'; } diff --git a/source/circle-metadata.json b/source/circle-metadata.json index d4e0efb4092..cfcf0ad24e6 100644 --- a/source/circle-metadata.json +++ b/source/circle-metadata.json @@ -394,7 +394,8 @@ "attributes": [ { "name": "padding", "type": "Padding", "default": "SAME" }, { "name": "stride_w", "type": "int32", "default": 0 }, - { "name": "stride_h", "type": "int32", "default": 0 } + { "name": "stride_h", "type": "int32", "default": 0 }, + { "name": "fused_activation_function", "type": "ActivationFunctionType", "default": "NONE" } ] }, { @@ -404,7 +405,8 @@ { "name": "cell_clip", "type": "float32", "default": 0 }, { "name": "proj_clip", "type": "float32", "default": 0 }, { "name": "time_major", "type": "boolean", "default": false }, - { "name": "asymmetric_quantize_inputs", "type": "boolean", "default": false } + { "name": "asymmetric_quantize_inputs", "type": "boolean", "default": false }, + { "name": "diagonal_recurrent_tensors", "type": "boolean", "default": false } ] }, { diff --git a/source/circle-schema.js b/source/circle-schema.js index 3b4f767c3ea..aff88ffed8d 100644 --- a/source/circle-schema.js +++ b/source/circle-schema.js @@ -19,7 +19,8 @@ $root.circle.TensorType = { RESOURCE: 13, VARIANT: 14, UINT32: 15, - UINT16: 16 + UINT16: 16, + INT4: 17 }; $root.circle.CustomQuantization = class CustomQuantization { @@ -190,6 +191,25 @@ $root.circle.SparsityParameters = class SparsityParameters { } }; +$root.circle.VariantSubType = class VariantSubType { + + static decode(reader, position) { + const $ = new $root.circle.VariantSubType(); + $.shape = reader.typedArray(position, 4, Int32Array); + $.type = reader.int8_(position, 6, 0); + $.has_rank = reader.bool_(position, 8, false); + return $; + } + + static decodeText(reader, json) { + const $ = new $root.circle.VariantSubType(); + $.shape = reader.typedArray(json.shape, Int32Array); + $.type = $root.circle.TensorType[json.type]; + $.has_rank = reader.value(json.has_rank, false); + return $; + } +}; + $root.circle.Tensor = class Tensor { static decode(reader, position) { @@ -203,6 +223,7 @@ $root.circle.Tensor = class Tensor { $.sparsity = reader.table(position, 16, $root.circle.SparsityParameters.decode); $.shape_signature = reader.typedArray(position, 18, Int32Array); $.has_rank = reader.bool_(position, 20, false); + $.variant_tensors = reader.tableArray(position, 22, $root.circle.VariantSubType.decode); return $; } @@ -217,6 +238,7 @@ $root.circle.Tensor = class Tensor { $.sparsity = reader.object(json.sparsity, $root.circle.SparsityParameters.decodeText); $.shape_signature = reader.typedArray(json.shape_signature, Int32Array); $.has_rank = reader.value(json.has_rank, false); + $.variant_tensors = reader.objectArray(json.variant_tensors, $root.circle.VariantSubType.decodeText); return $; } }; @@ -381,7 +403,12 @@ $root.circle.BuiltinOperator = { UNSORTED_SEGMENT_PROD: 153, UNSORTED_SEGMENT_MAX: 154, UNSORTED_SEGMENT_SUM: 155, - ATAN2: 156 + ATAN2: 156, + UNSORTED_SEGMENT_MIN: 157, + SIGN: 158, + BITCAST: 159, + BITWISE_XOR: 160, + RIGHT_SHIFT: 161 }; $root.circle.BuiltinOptions = class { @@ -507,8 +534,13 @@ $root.circle.BuiltinOptions = class { case 117: return $root.circle.DynamicUpdateSliceOptions.decode(reader, position); case 118: return $root.circle.UnsortedSegmentProdOptions.decode(reader, position); case 119: return $root.circle.UnsortedSegmentMaxOptions.decode(reader, position); - case 120: return $root.circle.UnsortedSegmentSumOptions.decode(reader, position); - case 121: return $root.circle.ATan2Options.decode(reader, position); + case 120: return $root.circle.UnsortedSegmentMinOptions.decode(reader, position); + case 121: return $root.circle.UnsortedSegmentSumOptions.decode(reader, position); + case 122: return $root.circle.ATan2Options.decode(reader, position); + case 123: return $root.circle.SignOptions.decode(reader, position); + case 124: return $root.circle.BitcastOptions.decode(reader, position); + case 125: return $root.circle.BitwiseXorOptions.decode(reader, position); + case 126: return $root.circle.RightShiftOptions.decode(reader, position); case 252: return $root.circle.BCQGatherOptions.decode(reader, position); case 253: return $root.circle.BCQFullyConnectedOptions.decode(reader, position); case 254: return $root.circle.InstanceNormOptions.decode(reader, position); @@ -637,8 +669,13 @@ $root.circle.BuiltinOptions = class { case 'DynamicUpdateSliceOptions': return $root.circle.DynamicUpdateSliceOptions.decodeText(reader, json); case 'UnsortedSegmentProdOptions': return $root.circle.UnsortedSegmentProdOptions.decodeText(reader, json); case 'UnsortedSegmentMaxOptions': return $root.circle.UnsortedSegmentMaxOptions.decodeText(reader, json); + case 'UnsortedSegmentMinOptions': return $root.circle.UnsortedSegmentMinOptions.decodeText(reader, json); case 'UnsortedSegmentSumOptions': return $root.circle.UnsortedSegmentSumOptions.decodeText(reader, json); case 'ATan2Options': return $root.circle.ATan2Options.decodeText(reader, json); + case 'SignOptions': return $root.circle.SignOptions.decodeText(reader, json); + case 'BitcastOptions': return $root.circle.BitcastOptions.decodeText(reader, json); + case 'BitwiseXorOptions': return $root.circle.BitwiseXorOptions.decodeText(reader, json); + case 'RightShiftOptions': return $root.circle.RightShiftOptions.decodeText(reader, json); case 'BCQGatherOptions': return $root.circle.BCQGatherOptions.decodeText(reader, json); case 'BCQFullyConnectedOptions': return $root.circle.BCQFullyConnectedOptions.decodeText(reader, json); case 'InstanceNormOptions': return $root.circle.InstanceNormOptions.decodeText(reader, json); @@ -1047,6 +1084,7 @@ $root.circle.UnidirectionalSequenceLSTMOptions = class UnidirectionalSequenceLST $.proj_clip = reader.float32_(position, 8, 0); $.time_major = reader.bool_(position, 10, false); $.asymmetric_quantize_inputs = reader.bool_(position, 12, false); + $.diagonal_recurrent_tensors = reader.bool_(position, 14, false); return $; } @@ -1057,6 +1095,7 @@ $root.circle.UnidirectionalSequenceLSTMOptions = class UnidirectionalSequenceLST $.proj_clip = reader.value(json.proj_clip, 0); $.time_major = reader.value(json.time_major, false); $.asymmetric_quantize_inputs = reader.value(json.asymmetric_quantize_inputs, false); + $.diagonal_recurrent_tensors = reader.value(json.diagonal_recurrent_tensors, false); return $; } }; @@ -1657,6 +1696,7 @@ $root.circle.TransposeConvOptions = class TransposeConvOptions { $.padding = reader.int8_(position, 4, 0); $.stride_w = reader.int32_(position, 6, 0); $.stride_h = reader.int32_(position, 8, 0); + $.fused_activation_function = reader.int8_(position, 10, 0); return $; } @@ -1665,6 +1705,7 @@ $root.circle.TransposeConvOptions = class TransposeConvOptions { $.padding = $root.circle.Padding[json.padding]; $.stride_w = reader.value(json.stride_w, 0); $.stride_h = reader.value(json.stride_h, 0); + $.fused_activation_function = $root.circle.ActivationFunctionType[json.fused_activation_function]; return $; } }; @@ -2550,6 +2591,71 @@ $root.circle.ATan2Options = class ATan2Options { } }; +$root.circle.UnsortedSegmentMinOptions = class UnsortedSegmentMinOptions { + + static decode(/* reader, position */) { + const $ = new $root.circle.UnsortedSegmentMinOptions(); + return $; + } + + static decodeText(/* reader, json */) { + const $ = new $root.circle.UnsortedSegmentMinOptions(); + return $; + } +}; + +$root.circle.SignOptions = class SignOptions { + + static decode(/* reader, position */) { + const $ = new $root.circle.SignOptions(); + return $; + } + + static decodeText(/* reader, json */) { + const $ = new $root.circle.SignOptions(); + return $; + } +}; + +$root.circle.BitcastOptions = class BitcastOptions { + + static decode(/* reader, position */) { + const $ = new $root.circle.BitcastOptions(); + return $; + } + + static decodeText(/* reader, json */) { + const $ = new $root.circle.BitcastOptions(); + return $; + } +}; + +$root.circle.BitwiseXorOptions = class BitwiseXorOptions { + + static decode(/* reader, position */) { + const $ = new $root.circle.BitwiseXorOptions(); + return $; + } + + static decodeText(/* reader, json */) { + const $ = new $root.circle.BitwiseXorOptions(); + return $; + } +}; + +$root.circle.RightShiftOptions = class RightShiftOptions { + + static decode(/* reader, position */) { + const $ = new $root.circle.RightShiftOptions(); + return $; + } + + static decodeText(/* reader, json */) { + const $ = new $root.circle.RightShiftOptions(); + return $; + } +}; + $root.circle.BCQGatherOptions = class BCQGatherOptions { static decode(reader, position) { diff --git a/source/circle.js b/source/circle.js index 4b25b67c050..65e9fe086a8 100644 --- a/source/circle.js +++ b/source/circle.js @@ -555,7 +555,7 @@ circle.Tensor = class { return this._type; } - get layout() { + get encoding() { switch (this._type.dataType) { case 'string': return '|'; default: return '<'; diff --git a/source/cntk.js b/source/cntk.js index 2b56d79b7b1..aafbecc412b 100644 --- a/source/cntk.js +++ b/source/cntk.js @@ -545,7 +545,7 @@ cntk.Tensor = class { return this._type; } - get layout() { + get encoding() { return '|'; } diff --git a/source/coreml.js b/source/coreml.js index 1aeed032f37..37af5d71185 100644 --- a/source/coreml.js +++ b/source/coreml.js @@ -687,7 +687,7 @@ coreml.Graph = class { } } }; - const loadModel = (model, values, group, weights) => { + const loadModel = (model, values, group) => { this._groups = this._groups | (group.length > 0 ? true : false); const description = model && model.description && model.description.metadata && model.description.metadata.shortDescription ? model.description.metadata.shortDescription : ''; switch (model.Type) { @@ -1000,7 +1000,7 @@ coreml.Graph = class { return new coreml.Argument(input.name, true, [ value ]); }); } - this._type = loadModel(model, values, '', weights); + this._type = loadModel(model, values, ''); if (this._description) { this._outputs = this._description.output.map((output) => { const value = values.input(output.name); @@ -1240,7 +1240,7 @@ coreml.Tensor = class { return null; } - get layout() { + get encoding() { switch (this._type.dataType) { case 'float32': return '|'; default: return '<'; diff --git a/source/dlc.js b/source/dlc.js index 3111d299e26..33c5af45445 100644 --- a/source/dlc.js +++ b/source/dlc.js @@ -243,10 +243,10 @@ dlc.Tensor = class { constructor(type, data) { this.type = type; if (data instanceof Uint8Array) { - this.layout = '<'; + this.encoding = '<'; this.values = data; } else { - this.layout = '|'; + this.encoding = '|'; switch (type.dataType) { case 'uint8': this.values = data.bytes; break; case 'float32': this.values = data.floats; break; @@ -360,6 +360,7 @@ dlc.Container = class { case 0x0308: return 'qint8'; case 0x0332: return 'qint32'; case 0x0408: return 'uint8'; + case 0x0416: return 'uint16'; case 0x0508: return 'boolean'; default: throw new dlc.Error("Unsupported data type '" + JSON.stringify(value) + "'."); } diff --git a/source/flax.js b/source/flax.js index 2d3da57332a..9b46a395c52 100644 --- a/source/flax.js +++ b/source/flax.js @@ -256,7 +256,7 @@ flax.Tensor = class { return this._type; } - get layout() { + get encoding() { switch (this._type.dataType) { case 'string': case 'object': diff --git a/source/grapher.js b/source/grapher.js index d2b9893ad8e..ffb4cec2c0e 100644 --- a/source/grapher.js +++ b/source/grapher.js @@ -253,12 +253,17 @@ grapher.Node = class { } select() { - this.element.classList.add('select'); - return [ this.element ]; + if (this.element) { + this.element.classList.add('select'); + return [ this.element ]; + } + return []; } deselect() { - this.element.classList.remove('select'); + if (this.element) { + this.element.classList.remove('select'); + } } static roundedRect(x, y, width, height, r1, r2, r3, r4) { diff --git a/source/hickle.js b/source/hickle.js index 0ffde6c5128..1b6b0c1326b 100644 --- a/source/hickle.js +++ b/source/hickle.js @@ -196,7 +196,7 @@ hickle.Tensor = class { return this._type; } - get layout() { + get encoding() { return this._littleEndian ? '<' : '>'; } diff --git a/source/index.html b/source/index.html index 0231db2a74f..40b3265c870 100644 --- a/source/index.html +++ b/source/index.html @@ -92,9 +92,9 @@ .titlebar-button { display: flex; justify-content: center; align-items: center; width: 46px; height: 32px; user-select: none; -webkit-app-region: no-drag; } .titlebar-button:hover { color: #000000; background-color: rgba(0, 0, 0, 0.15); } .titlebar-button-close:hover { color: #ffffff; background-color: #b43029; } -.menu-button { display: flex; justify-content: center; align-items: center; color: #aaaaaa; font-size: 16px; height: 32px; width: 32px; position: fixed; top: 0; left: 0; right: 0; bottom: 0; z-index: 2; -webkit-app-region: no-drag; -webkit-app-region: no-drag; user-select: none; } +.menu-button { display: flex; justify-content: center; align-items: center; color: #aaaaaa; font-size: 20px; height: 32px; width: 32px; position: fixed; top: 0; left: 0; right: 0; bottom: 0; z-index: 2; -webkit-app-region: no-drag; -webkit-app-region: no-drag; user-select: none; } .menu-button:hover { color: #000000; } -.menu { display: block; position: absolute; left: -16em; width: 16em; top: 0; height: 100%; z-index: 2; background-color: #ececec; border-right: 1px solid rgba(255, 255, 255, 0.5); padding-top: 40px; padding-bottom: 2px; margin-left: 0; margin-top: 0; overflow: hidden; transition: 0.1s; } +.menu { display: block; position: absolute; left: -17em; width: 17em; top: 0; height: 100%; z-index: 2; background-color: #ececec; border-right: 1px solid rgba(255, 255, 255, 0.5); padding-top: 40px; padding-bottom: 2px; margin-left: 0; margin-top: 0; overflow: hidden; transition: 0.1s; } .menu .menu-group { margin-bottom: 12px; } .menu .menu-group .menu-group-header { display: block; border: none; border-radius: 0; color: black; width: 100%; text-align: left; margin: 4px 12px 5px 12px; white-space: no-wrap; font-size: 11px; font-weight: bold; color: #bbbbbb; white-space: nowrap; } .menu .menu-group .menu-command { display: block; border: none; border-radius: 0; background-color: transparent; color: black; width: 100%; text-align: left; padding: 4px 12px 5px 12px; font-size: 12px; } @@ -496,6 +496,6 @@
- +