torch_geometric
Tensor Objects
A one-dimensional |
|
A COO |
Functions
- seed_everything(seed: int) None[source]
Sets the seed for generating random numbers in PyTorch,
numpyand Python.- Parameters:
seed (int) – The desired seed.
- get_home_dir() str[source]
Get the cache directory used for storing all PyG-related data.
If
set_home_dir()is not called, the path is given by the environment variable$PYG_HOMEwhich defaults to"~/.cache/pyg".
- set_home_dir(path: str) None[source]
Set the cache directory used for storing all PyG-related data.
- Parameters:
path (str) – The path to a local folder.
Optimizes the given PyG model/function via
torch.compile().
This function has the same signature as torch.compile() (see
here).
Note
torch_geometric.compile() is deprecated in favor of
torch.compile().
- class debug[source]
Context-manager that enables the debug mode to help track down errors and separate usage errors from real bugs.
with torch_geometric.debug(): out = model(data.x, data.edge_index)
- class set_debug(mode: bool)[source]
Context-manager that sets the debug mode on or off.
set_debugwill enable or disable the debug mode based on its argumentmode. It can be used as a context-manager or as a function.See
debugabove for more details.
- is_experimental_mode_enabled(options: Optional[Union[str, List[str]]] = None) bool[source]
Returns
Trueif the experimental mode is enabled. Seetorch_geometric.experimental_modefor a list of (optional) options.
- class experimental_mode(options: Optional[Union[str, List[str]]] = None)[source]
Context-manager that enables the experimental mode to test new but potentially unstable features.
with torch_geometric.experimental_mode(): out = model(data.x, data.edge_index)
- class set_experimental_mode(mode: bool, options: Optional[Union[str, List[str]]] = None)[source]
Context-manager that sets the experimental mode on or off.
set_experimental_modewill enable or disable the experimental mode based on its argumentmode. It can be used as a context-manager or as a function.See
experimental_modeabove for more details.