(self, g, h)
| 214 | |
| 215 | class DotPredictor(nn.Module): |
| 216 | def forward(self, g, h): |
| 217 | with g.local_scope(): |
| 218 | g.ndata["h"] = h |
| 219 | # Compute a new edge feature named 'score' by a dot-product between the |
| 220 | # source node feature 'h' and destination node feature 'h'. |
| 221 | g.apply_edges(fn.u_dot_v("h", "h", "score")) |
| 222 | # u_dot_v returns a 1-element vector for each edge so you need to squeeze it. |
| 223 | return g.edata["score"][:, 0] |
| 224 | |
| 225 | |
| 226 | ###################################################################### |
nothing calls this directly
no test coverage detected