Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fixing bugs in
model_parallel
example (#9231)
Two bugs were fixed in `examples/multi_gpu/model_parallel.py`. The first one was the attribute error: ``` File "/workspace/examples/multi_gpu/model_parallel.py", line 30, in forward x, edge_index = x.to(self.device2), edge_index.to(self.device2) File "/usr/local/lib/python3.10/dist-packages/torch/nn/modules/module.py", line 1704, in __getattr__ raise AttributeError(f"'{type(self).__name__}' object has no attribute '{name}'") AttributeError: 'GCN' object has no attribute 'device2' ``` After fixing the initial error, the next one appeared: ``` File "/workspace/examples/multi_gpu/model_parallel.py", line 58, in test out = model(data.x, data.edge_index, data.edge_attr) File "/usr/local/lib/python3.10/dist-packages/torch/nn/modules/module.py", line 1527, in _wrapped_call_impl return self._call_impl(*args, **kwargs) File "/usr/local/lib/python3.10/dist-packages/torch/nn/modules/module.py", line 1536, in _call_impl return forward_call(*args, **kwargs) TypeError: GCN.forward() takes 3 positional arguments but 4 were given ``` By the way, `data.edge_attr` is equal to `None`. With these fixes, the example works fine. --------- Co-authored-by: rusty1s <matthias.fey@tu-dortmund.de>
- Loading branch information