Explorar el Código

Update onnx.js (#1447)

Lutz Roeder hace 11 meses
padre
commit
68cf7f2fe1
Se han modificado 1 ficheros con 7 adiciones y 7 borrados
  1. 7 7
      source/onnx.js

+ 7 - 7
source/onnx.js

@@ -183,13 +183,6 @@ onnx.Graph = class {
                 }
             }
         }
-        if (Array.isArray(graph.value_info)) {
-            for (const value of graph.value_info) {
-                const tensor = context.tensor(value.name);
-                tensor.type = context.createType(value.type);
-                tensor.description = value.doc_string;
-            }
-        }
         graph.input = graph.input.map((value) => {
             const tensor = context.tensor(value.name);
             tensor.type = context.createType(value.type);
@@ -1267,6 +1260,13 @@ onnx.Context.Graph = class {
                 this._initializers.set(sparse_initializer.values.name, tensor);
             }
         }
+        if (Array.isArray(graph.value_info)) {
+            for (const value of graph.value_info) {
+                const tensor = this.tensor(value.name);
+                tensor.type = this.createType(value.type);
+                tensor.description = value.doc_string;
+            }
+        }
         for (const node of graph.node) {
             node.input = node.input.map((name) => this.tensor(name));
             node.output = node.output.map((name) => this.tensor(name));