Skip to content

Commit

Permalink
Show TensorFlow Lite tensor shape (#71)
Browse files Browse the repository at this point in the history
  • Loading branch information
lutzroeder committed Sep 17, 2018
1 parent 8004e95 commit d163f41
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 11 deletions.
18 changes: 10 additions & 8 deletions src/tflite-metadata.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,9 @@
{ "name": "output", "type": "T" }
],
"attributes": [
{ "name": "padding", "type": "Padding" },
{ "name": "stride_w", "type": "int" },
{ "name": "stride_h", "type": "int" },
{ "name": "padding", "type": "Padding", "default": "SAME" },
{ "name": "stride_w", "type": "int", "default": 1 },
{ "name": "stride_h", "type": "int", "default": 1 },
{ "name": "fused_activation_function", "type": "ActivationFunctionType", "default": "NONE" },
{ "name": "dilation_w_factor", "type": "int", "default": 1 },
{ "name": "dilation_h_factor", "type": "int", "default": 1 }
Expand Down Expand Up @@ -105,11 +105,13 @@
{ "name": "output", "type": "T" }
],
"attributes": [
{ "name": "padding", "type": "Padding" },
{ "name": "stride_w", "type": "int" },
{ "name": "stride_h", "type": "int" },
{ "name": "depth_multiplier", "type": "int" },
{ "name": "fused_activation_function", "type": "ActivationFunctionType", "default": "NONE" }
{ "name": "padding", "type": "Padding", "default": "SAME" },
{ "name": "stride_w", "type": "int", "default": 1 },
{ "name": "stride_h", "type": "int", "default": 1 },
{ "name": "depth_multiplier", "type": "int", "default": 1 },
{ "name": "fused_activation_function", "type": "ActivationFunctionType", "default": "NONE" },
{ "name": "dilation_w_factor", "type": "int", "default": 1 },
{ "name": "dilation_h_factor", "type": "int", "default": 1 }
]
}
},
Expand Down
11 changes: 8 additions & 3 deletions src/view.js
Original file line number Diff line number Diff line change
Expand Up @@ -566,8 +566,9 @@ class View {
}
tuple.from = {
node: nodeId,
name: output.name
};
name: output.name,
type: connection.type
};
});
});

Expand Down Expand Up @@ -655,6 +656,7 @@ class View {
}
tuple.from = {
node: nodeId,
type: connection.type
};
});
var types = input.connections.map(connection => connection.type || '').join('\n');
Expand Down Expand Up @@ -689,7 +691,10 @@ class View {
if (tuple.from != null) {
tuple.to.forEach((to) => {
var text = '';
if (tuple.from.name && to.name) {
if (tuple.from.type && tuple.from.type.shape && tuple.from.type.shape.length > 0) {
text = tuple.from.type.shape.join('\u00D7');
}
else if (tuple.from.name && to.name) {
text = tuple.from.name + ' \u21E8 ' + to.name;
}
else if (tuple.from.name) {
Expand Down

0 comments on commit d163f41

Please sign in to comment.