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

Get no error while using list object in bg.set_batch_num_nodes() but will get an AttributeError when using AvgPool to pool the batched graph #6577

Closed
NormanZyq opened this issue Nov 16, 2023 · 1 comment · Fixed by #6578
Assignees

Comments

@NormanZyq
Copy link

🐛 Bug

If use a list object as the argument of set_batch_num_nodes(), we get no error, and it seems the graph is successfully batched with the number of nodes. However, if I use AvgPooling to pool the batched graph, I would get an error:

AttributeError: 'list' object has no attribute 'dtype'

It's obvious that the list is not supported in this case.
If I use tensor, everything works fine, as the doc mentioned.

To Reproduce

Steps to reproduce the behavior:

Please refer to the notebook:
https://colab.research.google.com/drive/1n-tfuPp3R59olfxgN4I9NJ95bNUmdsdJ?usp=sharing

Expected behavior

If I use a list, there should be an error raised, or it can be transformed into tensor automatically

Environment

  • DGL Version (e.g., 1.0): 1.1.2
  • Backend Library & Version (e.g., PyTorch 0.4.1, MXNet/Gluon 1.3): 2.1.0+cu118
  • OS (e.g., Linux): Linux
  • How you installed DGL (conda, pip, source): pip
  • Build command you used (if compiling from source):
  • Python version: 3.10.12
  • CUDA/cuDNN version (if applicable):
  • GPU models and configuration (e.g. V100):
  • Any other relevant information:

Additional context

@Rhett-Ying
Copy link
Collaborator

Thanks for reporting this. We do need to avoid passing unexpected data.

@Rhett-Ying Rhett-Ying self-assigned this Nov 17, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants