Browse Source

Fix TensorFlow input detection (#863)

Lutz Roeder 4 years ago
parent
commit
b908734e7b
1 changed files with 2 additions and 2 deletions
  1. 2 2
      source/tf.js

+ 2 - 2
source/tf.js

@@ -2174,7 +2174,7 @@ tf.Utility = class {
             return null;
         };
         const map_resource = (name, node, tensor) => {
-            if (node && node.op === 'Placeholder' && node.input.length === 0 && node.output.length === 1 && node.output[0].to.length === 1 && node.controlDependencies.length === 0) {
+            if (node && node.op === 'Placeholder' && node.input.length === 0 && node.output.length === 1 && node.controlDependencies.length === 0) {
                 const dtype = node.attr.dtype.type;
                 if (dtype === tf.proto.tensorflow.DataType.DT_RESOURCE) {
                     return new tf.Argument(name, null, tensor);
@@ -2229,7 +2229,7 @@ tf.Utility = class {
         }
         const input_map = new Map();
         for (const node of node_map.values()) {
-            if (node.op == 'Placeholder' && node.input.length === 0 && node.output.length === 1 && node.output[0].to.length === 1 && node.controlDependencies.length === 0) {
+            if (node.op == 'Placeholder' && node.input.length === 0 && node.output.length === 1 && node.controlDependencies.length === 0) {
                 const dtype = node.attr.dtype;
                 const shape = node.attr.shape;
                 if (dtype && dtype.type && shape && shape.shape) {