Commit 3f11d45
authored
[BUG] Fix Calculation of # Sampled Nodes/Edges with Zero Input Size (#283)
Fixes a bug found when running `movielens_mnmg.py` on input with a large number of negative edges. Some batches end up with no positive edges of the input type, which causes PyTorch to throw an exception when trying to calculate the number of nodes, since the returned tensor is empty.
The fix is to check if the returned tensor is empty, and just set the number of output nodes to zero if it is.
Authors:
- Alex Barghi (https://github.com/alexbarghi-nv)
Approvers:
- Tingyu Wang (https://github.com/tingyu66)
URL: #2831 parent f2b7f50 commit 3f11d45
1 file changed
+12
-2
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
371 | 371 | | |
372 | 372 | | |
373 | 373 | | |
| 374 | + | |
| 375 | + | |
| 376 | + | |
| 377 | + | |
| 378 | + | |
374 | 379 | | |
375 | 380 | | |
376 | | - | |
| 381 | + | |
| 382 | + | |
| 383 | + | |
| 384 | + | |
| 385 | + | |
| 386 | + | |
377 | 387 | | |
378 | 388 | | |
379 | 389 | | |
380 | | - | |
| 390 | + | |
381 | 391 | | |
382 | 392 | | |
383 | 393 | | |
| |||
0 commit comments