diff --git a/src/TensorFlowNET.Core/Summaries/Summary.cs b/src/TensorFlowNET.Core/Summaries/Summary.cs index 84889845..56772087 100644 --- a/src/TensorFlowNET.Core/Summaries/Summary.cs +++ b/src/TensorFlowNET.Core/Summaries/Summary.cs @@ -37,10 +37,13 @@ namespace Tensorflow.Summaries return val; } - public Tensor merge_all(string key = "summaries", string scope= null, string name= null) + public Tensor merge_all(string key = "summaries", string scope = null, string name = null) { - var summary_ops = ops.get_collection(key, scope: scope); - return merge(summary_ops.Select(x => x as Tensor).ToArray(), name: name); + var summary_ops = ops.get_collection(key, scope: scope); + if (summary_ops == null) + return null; + else + return merge((summary_ops as List).Select(x => x as Tensor).ToArray(), name: name); } ///