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

Error in _prob2cornerflow() function #39

Open
JasonGUTU opened this issue May 3, 2021 · 3 comments
Open

Error in _prob2cornerflow() function #39

JasonGUTU opened this issue May 3, 2021 · 3 comments

Comments

@JasonGUTU
Copy link

JasonGUTU commented May 3, 2021

out, indice = max_pool(avg_pool(pr))

In this line, the indice is of type long int, and the d is also an int. however, the results of / maybe a float type number, resulting in an error in the following calculation.

Can you help me with this line? What is it about?

@JasonGUTU JasonGUTU changed the title Erro人 Error in _prob2cornerflow() function May 3, 2021
@dbm9741
Copy link

dbm9741 commented May 20, 2021

I have the same issue.... If you try to run it using Pytorch 1.0 the problem goes away.

I was able to fix the problem by replacing

indice += indice / (d - 1) # in original coordinate

with indice += torch.div(indice, d-1, rounding_mode='trunc')

@josephinemonica
Copy link

@dbm9741 Is the rounding_mode supposed to be 'trunc' or something else e.g., 'floor'?

@dbm9741
Copy link

dbm9741 commented Apr 20, 2022

@josephinemonica I don't think it matters as the indices can only be positive number and floor and trunc will give you the same result for positive number.

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

No branches or pull requests

3 participants