Skip to content

Commit 10f39ad

Browse files
committed
Rollback #448
1 parent 945ac02 commit 10f39ad

File tree

1 file changed

+6
-3
lines changed

1 file changed

+6
-3
lines changed

src/TensorFlowNET.Core/Summaries/Summary.cs

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -37,10 +37,13 @@ public Tensor histogram(string name, Tensor tensor, string[] collections = null,
3737
return val;
3838
}
3939

40-
public Tensor merge_all(string key = "summaries", string scope= null, string name= null)
40+
public Tensor merge_all(string key = "summaries", string scope = null, string name = null)
4141
{
42-
var summary_ops = ops.get_collection<ITensorOrOperation>(key, scope: scope);
43-
return merge(summary_ops.Select(x => x as Tensor).ToArray(), name: name);
42+
var summary_ops = ops.get_collection(key, scope: scope);
43+
if (summary_ops == null)
44+
return null;
45+
else
46+
return merge((summary_ops as List<ITensorOrOperation>).Select(x => x as Tensor).ToArray(), name: name);
4447
}
4548

4649
/// <summary>

0 commit comments

Comments
 (0)