Skip to content

Commit

Permalink
fix hamilton graph network example
Browse files Browse the repository at this point in the history
  • Loading branch information
cpehle committed Jan 7, 2023
1 parent 51f5990 commit e5b1659
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion jraph/examples/hamiltonian_graph_network.py
Original file line number Diff line number Diff line change
Expand Up @@ -199,7 +199,8 @@ def set_system_state(
position: np.ndarray,
momentum: np.ndarray) -> jraph.GraphsTuple:
"""Sets the non-static parameters of the graph (momentum, position)."""
nodes = static_graph.nodes.copy(position=position, momentum=momentum)
nodes = static_graph.nodes.set("position", position)
nodes = nodes.set("momentum", momentum)
return static_graph._replace(nodes=nodes)


Expand Down

0 comments on commit e5b1659

Please sign in to comment.