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

AttributeError: 'Feature' object has no attribute 'dim' #81

Closed lausannel closed 2 years ago

lausannel commented 3 years ago

When trying to change the offical example graph_sage_unsup.py of pytorch-geometric to fit torch-quiver, I ran into a problem of "AttributeError: 'Feature' object has no attribute 'dim'", which indicated that quiver.Feature class does not contain an attribute of "dim". I changed x = data.x.to(device) to x = quiver.Feature(rank=0, device_list=[0], device_cache_size="10M", cache_policy="device_replicate", csr_topo=csr_topo) x.from_cpu_tensor(data.x) as the other examples this repository provided but got a error in the following code

 def full_forward(self, x, edge_index):
      for i, conv in enumerate(self.convs):
          x = conv(x, edge_index)     <---- error code
          if i != self.num_layers - 1:
              x = x.relu()
              x = F.dropout(x, p=0.5, training=self.training)
      return x

The error is

File "/home/user/.local/lib/python3.7/site-packages/torch_scatter/utils.py", line 6, in broadcast
    dim = other.dim() + dim
AttributeError: 'Feature' object has no attribute 'dim'

Shall we add an 'dim' atrribute to quiver.Feature?

eedalong commented 3 years ago

Great, @lausannel will handle this