torch_geometric.data.Data — pytorch_geometric documentation
A data object describing a homogeneous graph. The data object can hold node-level, link-level and graph-level attributes. In general, Data tries to mimic the behavior of a regular Python dictionary. In addition, it provides useful functionality for analyzing graph structures, and provides basic PyTorch tensor functionalities. See here for the accompanying tutorial. x (torch.Tensor, optional) – Node feature matrix with shape [num_nodes, num_node_features]. (default: None) edge_index (LongTensor, optional) – Graph connectivity in COO format with shape [2, num_edges]. (default: None) edge_attr (torch.Tensor, optional) – Edge feature matrix with shape [num_edges, num_edge_features]. (default: None) y (torch.Tensor, optional) – Graph-level or node-level ground-truth labels with arbitrary shape. (default: None) pos (torch.Tensor, optional) – Node position matrix with shape [num_nodes, num_dimensions]. (default: None) time (torch.Tensor, optional) – The timestamps for each event with shape [n
torch_geometric.data.Data - pytorch_geometric documentation torch_geometric.data torch_geometric.data.Data View page source torch_geometric.data.Data class Data ( x : Optional [ Tensor ] = None , edge_index : Optional [ Tensor ] = None , edge_attr : Optional [ Tensor ] = None , y : Optional [ Union [ Tensor , int , float ] ] = None , pos : Optional [ Tensor ] = None , time : Optional [ Tensor ] = None , ** kwargs ) [source] Bases: BaseData , FeatureStore , GraphStore A data object describing a homogeneous graph. The data object can hold node-level, link-level and graph-level attributes. In
related reading
- torch_geometric.utils - pytorch_geometric documentationpytorch-geometric.readthedocs.io
- A Gentle Introduction to Graph Neural Networksdistill.pub
- torch.Tensor — PyTorch 2.12 documentationdocs.pytorch.org
- Tensors — PyTorch Tutorials 2.12.0+cu130 documentationpytorch.org
- Tensors — PyTorch Tutorials 2.13.0+cu130 documentationdocs.pytorch.org
- PyTorch internals : ezyang's blogblog.ezyang.com
- Learning PyTorch with Examples — PyTorch Tutorials 2.12.0+cu130 documentationpytorch.org
- PyTorch in One Hour: From Tensors to Training Neural Networks on Multiple GPUssebastianraschka.com
- torch.stackdocs.pytorch.org
- Understanding Convolutions on Graphsdistill.pub
- Torchvista: Building an Interactive Pytorch Visualization Package for Notebookstowardsdatascience.com
- torch.empty — PyTorch 2.12 documentationdocs.pytorch.org