Closed aravind-gk closed 2 years ago
Hi, thanks for the pull. I agree that might cause "incorrect rounding for negative values". But the index value should be always positive so I assume there should no problem for the floor operation?
Yes, the final values resulting from the operations are the same. I just thought that deprecated warning should be fixed. Thanks for the quick reply!
I see. Will merge it. Thanks!
I encounter the following warning when I run the test example testmettack.py, because of a deprecated __floordiv_\ in PyTorch:
deeprobust-0.2.3-py3.7.egg/deeprobust/graph/utils.py:544: UserWarning: __floordiv__ is deprecated, and its behavior will change in a future version of pytorch. It currently rounds toward 0 (like the 'trunc' function NOT 'floor'). This results in incorrect rounding for negative values. To keep the current behavior, use torch.div(a, b, rounding_mode='trunc'), or for actual floor division, use torch.div(a, b, rounding_mode='floor').
This one-line change to utils.py fixes the above issue.