Skip to content

Commit

Permalink
Merge branch 'lutzroeder:main' into main
Browse files Browse the repository at this point in the history
  • Loading branch information
Chizkiyahu authored Sep 3, 2023
2 parents 6834109 + b70307a commit fd582a4
Show file tree
Hide file tree
Showing 42 changed files with 1,515 additions and 409 deletions.
8 changes: 4 additions & 4 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@
"email": "[email protected]",
"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",
Expand All @@ -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": {
Expand Down
8 changes: 4 additions & 4 deletions source/bigdl.js
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand All @@ -349,8 +349,8 @@ bigdl.Tensor = class {
return this._type;
}

get layout() {
return this._layout;
get encoding() {
return this._encoding;
}

get values() {
Expand Down
2 changes: 1 addition & 1 deletion source/caffe.js
Original file line number Diff line number Diff line change
Expand Up @@ -627,7 +627,7 @@ caffe.Tensor = class {
return this._type;
}

get layout() {
get encoding() {
return '|';
}

Expand Down
2 changes: 1 addition & 1 deletion source/caffe2.js
Original file line number Diff line number Diff line change
Expand Up @@ -561,7 +561,7 @@ caffe2.Tensor = class {
return null;
}

get layout() {
get encoding() {
return '|';
}

Expand Down
6 changes: 4 additions & 2 deletions source/circle-metadata.json
Original file line number Diff line number Diff line change
Expand Up @@ -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" }
]
},
{
Expand All @@ -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 }
]
},
{
Expand Down
114 changes: 110 additions & 4 deletions source/circle-schema.js
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,8 @@ $root.circle.TensorType = {
RESOURCE: 13,
VARIANT: 14,
UINT32: 15,
UINT16: 16
UINT16: 16,
INT4: 17
};

$root.circle.CustomQuantization = class CustomQuantization {
Expand Down Expand Up @@ -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) {
Expand All @@ -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 $;
}

Expand All @@ -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 $;
}
};
Expand Down Expand Up @@ -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 {
Expand Down Expand Up @@ -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);
Expand Down Expand Up @@ -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);
Expand Down Expand Up @@ -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 $;
}

Expand All @@ -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 $;
}
};
Expand Down Expand Up @@ -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 $;
}

Expand All @@ -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 $;
}
};
Expand Down Expand Up @@ -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) {
Expand Down
2 changes: 1 addition & 1 deletion source/circle.js
Original file line number Diff line number Diff line change
Expand Up @@ -555,7 +555,7 @@ circle.Tensor = class {
return this._type;
}

get layout() {
get encoding() {
switch (this._type.dataType) {
case 'string': return '|';
default: return '<';
Expand Down
2 changes: 1 addition & 1 deletion source/cntk.js
Original file line number Diff line number Diff line change
Expand Up @@ -545,7 +545,7 @@ cntk.Tensor = class {
return this._type;
}

get layout() {
get encoding() {
return '|';
}

Expand Down
6 changes: 3 additions & 3 deletions source/coreml.js
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down Expand Up @@ -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);
Expand Down Expand Up @@ -1240,7 +1240,7 @@ coreml.Tensor = class {
return null;
}

get layout() {
get encoding() {
switch (this._type.dataType) {
case 'float32': return '|';
default: return '<';
Expand Down
5 changes: 3 additions & 2 deletions source/dlc.js
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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) + "'.");
}
Expand Down
2 changes: 1 addition & 1 deletion source/flax.js
Original file line number Diff line number Diff line change
Expand Up @@ -256,7 +256,7 @@ flax.Tensor = class {
return this._type;
}

get layout() {
get encoding() {
switch (this._type.dataType) {
case 'string':
case 'object':
Expand Down
11 changes: 8 additions & 3 deletions source/grapher.js
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down
2 changes: 1 addition & 1 deletion source/hickle.js
Original file line number Diff line number Diff line change
Expand Up @@ -196,7 +196,7 @@ hickle.Tensor = class {
return this._type;
}

get layout() {
get encoding() {
return this._littleEndian ? '<' : '>';
}

Expand Down
Loading

0 comments on commit fd582a4

Please sign in to comment.