| 115 | |
| 116 | |
| 117 | def create_test_heterograph4(idtype): |
| 118 | g = dgl.heterograph( |
| 119 | { |
| 120 | ("user", "follows", "user"): ( |
| 121 | F.tensor([0, 1, 1, 2, 2, 2], dtype=idtype), |
| 122 | F.tensor([0, 0, 1, 1, 2, 2], dtype=idtype), |
| 123 | ), |
| 124 | ("user", "plays", "game"): ( |
| 125 | F.tensor([0, 1], dtype=idtype), |
| 126 | F.tensor([0, 1], dtype=idtype), |
| 127 | ), |
| 128 | }, |
| 129 | idtype=idtype, |
| 130 | device=F.ctx(), |
| 131 | ) |
| 132 | g.nodes["user"].data["h"] = F.copy_to( |
| 133 | F.tensor([1, 1, 1], dtype=idtype), ctx=F.ctx() |
| 134 | ) |
| 135 | g.nodes["game"].data["h"] = F.copy_to( |
| 136 | F.tensor([2, 2], dtype=idtype), ctx=F.ctx() |
| 137 | ) |
| 138 | g.edges["follows"].data["h"] = F.copy_to( |
| 139 | F.tensor([1, 2, 3, 4, 5, 6], dtype=idtype), ctx=F.ctx() |
| 140 | ) |
| 141 | g.edges["plays"].data["h"] = F.copy_to( |
| 142 | F.tensor([1, 2], dtype=idtype), ctx=F.ctx() |
| 143 | ) |
| 144 | return g |
| 145 | |
| 146 | |
| 147 | def create_test_heterograph5(idtype): |