quiver-team / torch-quiver

PyTorch Library for Low-Latency, High-Throughput Graph Learning on GPUs.
https://torch-quiver.readthedocs.io/en/latest/
Apache License 2.0
293 stars 36 forks source link

Add dim attribute and an example #82

Closed lausannel closed 2 years ago

lausannel commented 3 years ago

81 Add an 'dim' attribute to quiver.Feature class which indicates the number of dimensions

Meanwhile, add an examples of offcial pytorch-geometric and its quiver version, which is now still in progress Code changes are shown below

#############################
# Original Pyg Code
#############################
# train_loader = NeighborSampler(data.edge_index, sizes=[10, 10], batch_size=256,
#                                shuffle=True, num_nodes=data.num_nodes)
train_loader = torch.utils.data.DataLoader(train_idx,
                                           batch_size=256,
                                           shuffle=True,
                                           drop_last=True)

csr_topo = quiver.CSRTopo(data.edge_index)

quiver_sampler = GraphSageSampler(csr_topo, sizes =[10, 10], device=0)
...
######################
# Original Pyg Code
######################
# for batch_size, n_id, adjs in train_loader:
for seeds in train_loader:
    n_id, batch_size, adjs = sample(data.edge_index, seeds)
ZenoTan commented 2 years ago

Don't forget to format your code