Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix from_networkx in case where attributes are tensors #4486

Merged
merged 2 commits into from
Apr 20, 2022

Conversation

Padarn
Copy link
Contributor

@Padarn Padarn commented Apr 15, 2022

Fixes problem reported in #4445, the problem being that

torch.tensor([torch.Tensor([1,2,3], torch.Tensor([1,2,3]])

does not work, they need to be stacked instead.

@codecov
Copy link

codecov bot commented Apr 15, 2022

Codecov Report

Merging #4486 (d45ab6e) into master (e18198f) will decrease coverage by 0.11%.
The diff coverage is 100.00%.

❗ Current head d45ab6e differs from pull request most recent head a144f8b. Consider uploading reports for the commit a144f8b to get more accurate results

@@            Coverage Diff             @@
##           master    #4486      +/-   ##
==========================================
- Coverage   82.75%   82.63%   -0.12%     
==========================================
  Files         313      313              
  Lines       16261    16262       +1     
==========================================
- Hits        13456    13438      -18     
- Misses       2805     2824      +19     
Impacted Files Coverage Δ
torch_geometric/utils/convert.py 85.91% <100.00%> (+0.30%) ⬆️
torch_geometric/nn/conv/utils/typing.py 81.25% <0.00%> (-17.50%) ⬇️
torch_geometric/io/tu.py 93.58% <0.00%> (-2.57%) ⬇️
torch_geometric/nn/models/mlp.py 98.41% <0.00%> (-1.59%) ⬇️
torch_geometric/transforms/gdc.py 78.17% <0.00%> (-1.02%) ⬇️
torch_geometric/data/dataset.py 96.80% <0.00%> (-0.80%) ⬇️
torch_geometric/nn/conv/rgat_conv.py 83.76% <0.00%> (-0.53%) ⬇️
torch_geometric/graphgym/utils/comp_budget.py 15.51% <0.00%> (+0.51%) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update e18198f...a144f8b. Read the comment docs.

Copy link
Member

@rusty1s rusty1s left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you!

@rusty1s rusty1s changed the title Fix from_networkx in case where edge attributes are tensors Fix from_networkx in case where attributes are tensors Apr 20, 2022
@rusty1s rusty1s merged commit 2797208 into pyg-team:master Apr 20, 2022
wilcoln pushed a commit to wilcoln/pytorch_geometric that referenced this pull request Apr 21, 2022
* bug fix for tensor valued graphx

* merge

Co-authored-by: rusty1s <matthias.fey@tu-dortmund.de>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

from_networkx seems not compatible with set_node_attributes
2 participants