Browse Source

Update tf.js

Lutz Roeder 3 years ago
parent
commit
e4e4740e49
1 changed files with 6 additions and 0 deletions
  1. 6 0
      source/tf.js

+ 6 - 0
source/tf.js

@@ -324,6 +324,9 @@ tf.ModelFactory = class {
                             run_metadata.push(metadata);
                             break;
                         }
+                        default: {
+                            throw new tf.Error("Unknown event type '" + event.what + "'.");
+                        }
                     }
                 }
                 if (saved_model.meta_graphs.every((meta_graph) => meta_graph.graph_def.node.every((node) => node.op.startsWith('aten::') || node.op.startsWith('prim::') || node.op === 'IO Node'))) {
@@ -1131,6 +1134,9 @@ tf.Attribute = class {
                 }
                 break;
             }
+            default: {
+                throw new tf.Error("Unknown attribute value type '" + JSON.stringify(value.value) + "'.");
+            }
         }
         if (schema) {
             if (Object.prototype.hasOwnProperty.call(schema, 'visible') && !schema.visible) {