fix typo in readme.md

1123
ZhangGe6 4 years ago
parent 637aeea7f1
commit 7efab04f3a

@ -18,7 +18,7 @@ Currently, the following editing operations are supported:
- Delete a single node. - Delete a single node.
- Delete a node and all the nodes rooted on it. - Delete a node and all the nodes rooted on it.
- Recover a deleted node. - Recover a deleted node.
- [x] Rename the name of node inputs/outputs - [x] Rename the node inputs/outputs
- [x] Rename the model inputs/outputs - [x] Rename the model inputs/outputs
- [x] Edit the attribute of nodes - [x] Edit the attribute of nodes
- [x] Add new nodes (experimental) - [x] Add new nodes (experimental)
@ -136,8 +136,8 @@ The process is shown in the following figure:
<img src="./docs/rename_io.gif" style="zoom:75%;" /> <img src="./docs/rename_io.gif" style="zoom:75%;" />
## Rename the name of node inputs/outputs ## Rename the model inputs/outputs
Click the model input/output node, type a new name for it in the sidebar, then we are done. Click the model input/output node, type a new name in the sidebar, then we are done.
## Edit the attribute of nodes ## Edit the attribute of nodes

@ -1077,11 +1077,13 @@ onnx.Tensor = class {
toString() { toString() {
const context = this._context(); const context = this._context();
// console.log(context)
if (context.state) { if (context.state) {
return ''; return '';
} }
context.limit = 10000; context.limit = 10000;
const value = this._decode(context, 0); const value = this._decode(context, 0);
console.log(value)
return onnx.Tensor._stringify(value, '', ' '); return onnx.Tensor._stringify(value, '', ' ');
} }
@ -1260,6 +1262,7 @@ onnx.Tensor = class {
} }
static _stringify(value, indentation, indent) { static _stringify(value, indentation, indent) {
// console.log(value, Array.isArray(value)) // ..., false
if (Array.isArray(value)) { if (Array.isArray(value)) {
const result = []; const result = [];
result.push(indentation + '['); result.push(indentation + '[');

@ -883,6 +883,7 @@ sidebar.ArgumentView = class {
let name = this._argument.name || ''; let name = this._argument.name || '';
this._hasId = name ? true : false; this._hasId = name ? true : false;
this._hasKind = initializer && initializer.kind ? true : false; this._hasKind = initializer && initializer.kind ? true : false;
// console.log(this._hasId, this._hasKind, type) // true true ...
if (this._hasId || (!this._hasKind && !type)) { if (this._hasId || (!this._hasKind && !type)) {
this._hasId = true; this._hasId = true;
@ -914,12 +915,14 @@ sidebar.ArgumentView = class {
} }
else if (this._hasKind) { else if (this._hasKind) {
console.log("this._hasKind is called")
const kindLine = this._host.document.createElement('div'); const kindLine = this._host.document.createElement('div');
kindLine.className = 'sidebar-view-item-value-line'; kindLine.className = 'sidebar-view-item-value-line';
kindLine.innerHTML = 'kind: <b>' + initializer.kind + '</b>'; kindLine.innerHTML = 'kind: <b>' + initializer.kind + '</b>';
this._element.appendChild(kindLine); this._element.appendChild(kindLine);
} }
else if (type) { else if (type) {
console.log("type is called")
const typeLine = this._host.document.createElement('div'); const typeLine = this._host.document.createElement('div');
typeLine.className = 'sidebar-view-item-value-line-border'; typeLine.className = 'sidebar-view-item-value-line-border';
typeLine.innerHTML = 'type: <code><b>' + type.toString().split('<').join('&lt;').split('>').join('&gt;') + '</b></code>'; typeLine.innerHTML = 'type: <code><b>' + type.toString().split('<').join('&lt;').split('>').join('&gt;') + '</b></code>';
@ -1009,6 +1012,8 @@ sidebar.ArgumentView = class {
valueLine.className = 'sidebar-view-item-value-line-border'; valueLine.className = 'sidebar-view-item-value-line-border';
contentLine.innerHTML = state || initializer.toString(); contentLine.innerHTML = state || initializer.toString();
console.log(initializer)
console.log(state, initializer.toString())
} }
catch (err) { catch (err) {
contentLine.innerHTML = err.toString(); contentLine.innerHTML = err.toString();

Loading…
Cancel
Save