瀏覽代碼

Update tf.js (#844)

Lutz Roeder 4 年之前
父節點
當前提交
cfdb98e0f7
共有 1 個文件被更改,包括 1 次插入1 次删除
  1. 1 1
      source/tf.js

+ 1 - 1
source/tf.js

@@ -2602,7 +2602,7 @@ tf.JsonReader = class {
 
     static decodeFunctionDefLibrary(json) {
         const message = new tf.proto.tensorflow.FunctionDefLibrary();
-        message.function = (json.function || []).map((json) => tf.JsonReader.decodeFunctionDef(json));
+        message.function = json ? (json.function || []).map((json) => tf.JsonReader.decodeFunctionDef(json)) : [];
         return message;
     }