Skip to content

Commit 8aed2d9

Browse files
author
Jack Dunham
committed
Fix type inference in TensorNetwork construction
1 parent 5bc18db commit 8aed2d9

File tree

1 file changed

+1
-2
lines changed

1 file changed

+1
-2
lines changed

src/tensornetwork.jl

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -66,8 +66,7 @@ end
6666
tensornetwork_edges(tensors) = tensornetwork_edges(NamedEdge, tensors)
6767

6868
function TensorNetwork(f::Base.Callable, graph::AbstractGraph)
69-
tensors = Dictionary(vertices(graph), f.(vertices(graph)))
70-
return TensorNetwork(graph, tensors)
69+
return TensorNetwork(graph, Dictionary(map(f, vertices(graph))))
7170
end
7271
function TensorNetwork(graph::AbstractGraph, tensors)
7372
tn = _TensorNetwork(graph, tensors)

0 commit comments

Comments
 (0)