Skip to content

Commit

Permalink
Update CNTK test files (#153)
Browse files Browse the repository at this point in the history
  • Loading branch information
lutzroeder committed Jun 28, 2024
1 parent d47c714 commit 6ac4341
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 4 deletions.
8 changes: 4 additions & 4 deletions source/cntk.js
Original file line number Diff line number Diff line change
Expand Up @@ -177,13 +177,13 @@ cntk.Graph = class {
for (const input of obj.inputs) {
const value = values.map(input.uid, version, input);
// VariableKind { 0: 'input', 1: 'output', 2: 'parameter', 3: 'constant', 4: 'placeholder' }
if (input.kind === 0) {
if (input.kind === 0n) {
const inputName = input.name || input.uid;
this.inputs.push(new cntk.Argument(inputName, [value]));
}
}
for (const block of obj.primitive_functions) {
if (block.op === 57 && block.block_function_composite) {
if (block.op === 57n && block.block_function_composite) {
const list = [block.block_function_composite.root];
const output = map.get(block.block_function_composite.root);
const keys = block.block_function_composite_arguments_map_keys;
Expand Down Expand Up @@ -308,7 +308,7 @@ cntk.Node = class {
case 2: {
this.name = obj.name || obj.uid || null;
const output = obj.uid;
if (obj.op === 57) {
if (obj.op === 57n) {
this.type = { name: obj.uid, ...metadata.type(obj.uid) };
delete this.type.identifier;
} else if (Object.prototype.hasOwnProperty.call(obj, 'op')) {
Expand Down Expand Up @@ -501,7 +501,7 @@ cntk.TensorShape = class {
this.dimensions = shape.dims;
break;
case 2:
this.dimensions = shape.shape_dim.map((dimension) => Number(dimension));
this.dimensions = shape.shape_dim.map((dimension) => dimension.toNumber());
break;
default:
throw new cntk.Error(`Unsupported CNTK version '${version}'.`);
Expand Down
1 change: 1 addition & 0 deletions test/models.json
Original file line number Diff line number Diff line change
Expand Up @@ -971,6 +971,7 @@
"target": "DRNN.model",
"source": "https://github.com/lutzroeder/netron/files/9128732/DRNN.model.zip[DRNN.model]",
"format": "CNTK v2",
"assert": [ "model.graphs[0].nodes[3].type.name == 'Convolution'" ],
"link": "https://github.com/lutzroeder/netron/issues/153"
},
{
Expand Down

0 comments on commit 6ac4341

Please sign in to comment.