torch_geometric

张量对象

索引

一个一维的index张量,附加了额外的(元)数据。

EdgeIndex

A COO edge_index tensor with additional (meta)data attached.

函数

seed_everything(seed: int) None[source]

设置用于在numpy中生成随机数的种子。

Parameters:

seed (int) – 所需的种子。

Return type:

None

get_home_dir() str[source]

获取用于存储所有相关数据的缓存目录。

如果未调用set_home_dir(),路径由环境变量$PYG_HOME给出,默认值为"~/.cache/pyg"

Return type:

str

set_home_dir(path: str) None[source]

设置用于存储所有相关数据的缓存目录。

Parameters:

path (str) – 本地文件夹的路径。

Return type:

None

is_compiling() bool[source]

如果 通过 torch.compile() 进行编译,则返回 True

Return type:

bool 翻译后的内容: bool 在这个例子中,`bool` 是一个Python函数名称,根据翻译规则1,不需要翻译。因此,翻译后的内容保持不变。

is_debug_enabled() bool[source]

如果启用了调试模式,则返回 True

Return type:

bool 翻译后的内容: bool 在这个例子中,`bool` 是一个Python函数名称,根据翻译规则1,不需要翻译。因此,翻译后的内容保持不变。

class debug[source]

上下文管理器,启用调试模式以帮助追踪错误并将使用错误与实际错误分开。

with torch_geometric.debug():
    out = model(data.x, data.edge_index)
class set_debug(mode: bool)[source]

上下文管理器,用于设置调试模式的开启或关闭。

set_debug 将根据其参数 mode 启用或禁用调试模式。 它可以作为上下文管理器或函数使用。

有关更多详细信息,请参见上面的debug

is_experimental_mode_enabled(options: Optional[Union[str, List[str]]] = None) bool[source]

如果启用了实验模式,则返回 True。有关(可选的)选项列表,请参见 torch_geometric.experimental_mode

Return type:

bool 翻译后的内容: bool 在这个例子中,`bool` 是一个Python函数名称,根据翻译规则1,不需要翻译。因此,翻译后的内容保持不变。

class experimental_mode(options: Optional[Union[str, List[str]]] = None)[source]

上下文管理器,用于启用实验模式以测试新但可能不稳定的功能。

with torch_geometric.experimental_mode():
    out = model(data.x, data.edge_index)
Parameters:

options (strlist, 可选) – 目前没有实验性功能。

class set_experimental_mode(mode: bool, options: Optional[Union[str, List[str]]] = None)[source]

上下文管理器,用于开启或关闭实验模式。

set_experimental_mode 将根据其参数 mode 启用或禁用实验模式。 它可以作为上下文管理器或函数使用。

有关更多详细信息,请参见上面的experimental_mode

disable_dynamic_shapes(required_args: List[str]) Callable[source]

一个装饰器,用于禁用给定参数的动态形状使用,即如果未传递required_args并且需要自动推断时,它将引发错误。

Return type:

Callable