"tests/git@developer.sourcefind.cn:renzhc/diffusers_dcu.git" did not exist on "b41abb223086f7bb45583f1c85fea6449b1da82d"
Unverified Commit 13cbad32 authored by Andrei Ivanov's avatar Andrei Ivanov Committed by GitHub
Browse files

Suppressing warnings generated by the `test_prop_nodes_topo` test. (#6651)


Co-authored-by: default avatarHongzhi (Steve), Chen <chenhongzhi.nkcs@gmail.com>
parent b569e4be
......@@ -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]]))
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment