Lutz Roeder vor 1 Jahr
Ursprung
Commit
7f62c30706
2 geänderte Dateien mit 4 neuen und 6 gelöschten Zeilen
  1. 3 3
      source/tnn-metadata.json
  2. 1 3
      source/tnn.js

+ 3 - 3
source/tnn-metadata.json

@@ -67,7 +67,7 @@
       { "name": "axis", "type": "int32", "default": 0 }
     ],
     "inputs": [
-      { "name": "input", "option": "variadic" }
+      { "name": "input", "type": "Tensor[]" }
     ],
     "outputs": [
       { "name": "output" }
@@ -495,7 +495,7 @@
       { "name": "axis", "type": "int32", "default": 0 }
     ],
     "inputs": [
-      { "name": "input", "option": "variadic" }
+      { "name": "input", "type": "Tensor[]" }
     ],
     "outputs": [
       { "name": "output" }
@@ -676,7 +676,7 @@
       { "name": "input" }
     ],
     "outputs": [
-      { "name": "output", "option": "variadic" }
+      { "name": "output", "type": "Tensor[]" }
     ]
   },
   {

+ 1 - 3
source/tnn.js

@@ -180,13 +180,12 @@ tnn.Node = class {
             const argument = new tnn.Argument(name, value, type, visible);
             this.attributes.push(argument);
         }
-
         const inputs = layer.inputs;
         let inputIndex = 0;
         if (this.type && this.type.inputs) {
             for (const inputDef of this.type.inputs) {
                 if (inputIndex < inputs.length || inputDef.option !== 'optional') {
-                    const inputCount = (inputDef.option === 'variadic') ? (inputs.length - inputIndex) : 1;
+                    const inputCount = (inputDef.type === 'Tensor[]') ? (inputs.length - inputIndex) : 1;
                     const inputArguments = inputs.slice(inputIndex, inputIndex + inputCount).filter((id) => id !== '' || inputDef.option !== 'optional').map((id) => values.map(id));
                     const argument = new tnn.Argument(inputDef.name, inputArguments);
                     this.inputs.push(argument);
@@ -199,7 +198,6 @@ tnn.Node = class {
                 return new tnn.Argument(inputName, [values.map(input)]);
             }));
         }
-
         const outputs = layer.outputs;
         let outputIndex = 0;
         if (this.type && this.type.outputs) {