Unverified Commit e9c3c0e8 authored by Mufei Li's avatar Mufei Li Committed by GitHub
Browse files

[Model] Simplify RGCN



* Update (#5)

* Update

* Update

* Update

* Update

* Update

* Update

* Update

* Update

* Update

* Update

* Update

* Update

* Update

* FIx

* Try

* Update

* Update

* Update

* Fix

* Update

* Fix

* Fix

* Fix

* Fix

* Update

* Fix

* Update

* Update

* Update

* Fix

* Fix

* Update

* Update

* Update

* Update

* Fix

* Fix

* Fix

* Update

* Update

* Update

* Update

* Update

* Update README.md

* Update

* Fix

* Update

* Update

* Fix

* Fix

* Fix

* Update

* Update

* Update
Co-authored-by: default avatarUbuntu <ubuntu@ip-172-31-6-240.us-west-2.compute.internal>

* Update

* Update

* Fix

* Update

* Update

* Update

* Fix

* Update

* Update

* Update

* Update

* Update

* Update

* CI
Co-authored-by: default avatarUbuntu <ubuntu@ip-172-31-6-240.us-west-2.compute.internal>
Co-authored-by: default avatarUbuntu <ubuntu@ip-172-31-57-123.us-west-2.compute.internal>
Co-authored-by: default avatarQuan (Andy) Gan <coin2028@hotmail.com>
parent 22272de6
...@@ -1811,6 +1811,22 @@ def test_reorder_graph(idtype): ...@@ -1811,6 +1811,22 @@ def test_reorder_graph(idtype):
rfg = dgl.reorder_graph(fg) rfg = dgl.reorder_graph(fg)
assert 'csr' in sum(rfg.formats().values(), []) assert 'csr' in sum(rfg.formats().values(), [])
@unittest.skipIf(dgl.backend.backend_name == "tensorflow", reason="TF doesn't support a slicing operation")
@parametrize_dtype
def test_norm_by_dst(idtype):
# Case1: A homogeneous graph
g = dgl.graph(([0, 1, 1], [1, 1, 2]), idtype=idtype, device=F.ctx())
eweight = dgl.norm_by_dst(g)
assert F.allclose(eweight, F.tensor([0.5, 0.5, 1.0]))
# Case2: A heterogeneous graph
g = dgl.heterograph({
('user', 'follows', 'user'): ([0, 1], [1, 2]),
('user', 'plays', 'game'): ([0, 1, 1], [1, 1, 2])
}, idtype=idtype, device=F.ctx())
eweight = dgl.norm_by_dst(g, etype=('user', 'plays', 'game'))
assert F.allclose(eweight, F.tensor([0.5, 0.5, 1.0]))
@parametrize_dtype @parametrize_dtype
def test_module_add_self_loop(idtype): def test_module_add_self_loop(idtype):
g = dgl.graph(([1, 1], [1, 2]), idtype=idtype, device=F.ctx()) g = dgl.graph(([1, 1], [1, 2]), idtype=idtype, device=F.ctx())
......
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