Skip to content

Commit

Permalink
Suppressing warnings generated by the test_prop_nodes_topo test. (d…
Browse files Browse the repository at this point in the history
…mlc#6651)

Co-authored-by: Hongzhi (Steve), Chen <[email protected]>
  • Loading branch information
drivanov and frozenbugs authored Feb 19, 2024
1 parent b569e4b commit 13cbad3
Showing 1 changed file with 11 additions and 3 deletions.
14 changes: 11 additions & 3 deletions tests/python/common/test_propagate.py
Original file line number Diff line number Diff line change
Expand Up @@ -100,9 +100,17 @@ def test_prop_nodes_topo(idtype):
tree.ndata["x"] = F.zeros((5, 2))
# set all leaf nodes to be ones
tree.nodes[[1, 3, 4]].data["x"] = F.ones((3, 2))
dgl.prop_nodes_topo(
tree, message_func=mfunc, reduce_func=rfunc, apply_node_func=None
)

# Filtering DGLWarning:
# The input graph for the user-defined edge
# function does not contain valid edges
import warnings

with warnings.catch_warnings():
warnings.simplefilter("ignore", category=UserWarning)
dgl.prop_nodes_topo(
tree, message_func=mfunc, reduce_func=rfunc, apply_node_func=None
)
# root node get the sum
assert F.allclose(tree.nodes[0].data["x"], F.tensor([[3.0, 3.0]]))

Expand Down

0 comments on commit 13cbad3

Please sign in to comment.