函数功能:以三元组的形式返回图中定义的边。
下面是官方给出的解释
Return all the canonical edge types in the graph.
A canonical edge type is a string triplet (str, str, str) for source node type, edge type and destination node type.
Returns
All the canonical edge type triplets in a list.
Return type
list[(str, str, str)]
举个例子
import dgl
import torch
g = dgl.heterograph({
('user', 'follows', 'user')

该博客介绍了如何使用DGL库从异构图中获取规范化的边类型。`canonical_etypes`函数返回图中所有独特的三元组形式(源节点类型,边类型,目标节点类型),例如`('user','follows','user')`。示例展示了创建包含不同边类型的图,并调用`canonical_etypes`来列举所有边类型。
最低0.47元/天 解锁文章
1546

被折叠的 条评论
为什么被折叠?



