(idtype)
| 65 | |
| 66 | |
| 67 | def create_test_heterograph4(idtype): |
| 68 | g = dgl.heterograph( |
| 69 | { |
| 70 | ("user", "follows", "user"): ( |
| 71 | F.tensor([0, 1, 1, 2, 2, 2], dtype=idtype), |
| 72 | F.tensor([0, 0, 1, 1, 2, 2], dtype=idtype), |
| 73 | ), |
| 74 | ("user", "plays", "game"): ( |
| 75 | F.tensor([0, 1], dtype=idtype), |
| 76 | F.tensor([0, 1], dtype=idtype), |
| 77 | ), |
| 78 | }, |
| 79 | idtype=idtype, |
| 80 | device=F.ctx(), |
| 81 | ) |
| 82 | g.nodes["user"].data["h"] = F.copy_to( |
| 83 | F.tensor([1, 1, 1], dtype=idtype), ctx=F.ctx() |
| 84 | ) |
| 85 | g.nodes["game"].data["h"] = F.copy_to( |
| 86 | F.tensor([2, 2], dtype=idtype), ctx=F.ctx() |
| 87 | ) |
| 88 | g.edges["follows"].data["h"] = F.copy_to( |
| 89 | F.tensor([1, 2, 3, 4, 5, 6], dtype=idtype), ctx=F.ctx() |
| 90 | ) |
| 91 | g.edges["plays"].data["h"] = F.copy_to( |
| 92 | F.tensor([1, 2], dtype=idtype), ctx=F.ctx() |
| 93 | ) |
| 94 | return g |
| 95 | |
| 96 | |
| 97 | def create_test_heterograph5(idtype): |
no test coverage detected