| 145 | |
| 146 | |
| 147 | def create_test_heterograph5(idtype): |
| 148 | g = dgl.heterograph( |
| 149 | { |
| 150 | ("user", "follows", "user"): ( |
| 151 | F.tensor([1, 2], dtype=idtype), |
| 152 | F.tensor([0, 1], dtype=idtype), |
| 153 | ), |
| 154 | ("user", "plays", "game"): ( |
| 155 | F.tensor([0, 1], dtype=idtype), |
| 156 | F.tensor([0, 1], dtype=idtype), |
| 157 | ), |
| 158 | }, |
| 159 | idtype=idtype, |
| 160 | device=F.ctx(), |
| 161 | ) |
| 162 | g.nodes["user"].data["h"] = F.copy_to( |
| 163 | F.tensor([1, 1, 1], dtype=idtype), ctx=F.ctx() |
| 164 | ) |
| 165 | g.nodes["game"].data["h"] = F.copy_to( |
| 166 | F.tensor([2, 2], dtype=idtype), ctx=F.ctx() |
| 167 | ) |
| 168 | g.edges["follows"].data["h"] = F.copy_to( |
| 169 | F.tensor([1, 2], dtype=idtype), ctx=F.ctx() |
| 170 | ) |
| 171 | g.edges["plays"].data["h"] = F.copy_to( |
| 172 | F.tensor([1, 2], dtype=idtype), ctx=F.ctx() |
| 173 | ) |
| 174 | return g |
| 175 | |
| 176 | |
| 177 | def get_redfn(name): |