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 Nan when powering tesnors with float32 #5

Open
metya opened this issue Mar 19, 2018 · 3 comments
Open

Get Nan when powering tesnors with float32 #5

metya opened this issue Mar 19, 2018 · 3 comments

Comments

@metya
Copy link

metya commented Mar 19, 2018

Hi!

I'm from here issue tensorflow repo.

The issue was closed and to do not open it again I write here to answer your this question

Is it a common scenario to calculate the power of negative numbers?

Yes. If I calculate power any tensors float32 type with negative number, all negative number turn to NaN, no metter what powet is ( equal to 2 or more then 2 or odd).
But if initialize tensor with float 64, everything will be fine.

Due to the special function unit is limited resource in GPU, you should use multiply if your power is small integer.

Ok, I got it, I can multiply tensors on itself, but it is really stupid, and ruined pipeline) And in the code from someone else where is normal TF I'll get NaN anyway and not only NaN in calulate power but optimizers and other stuff uder the hood just may not work properly.

So what shoud I do?

I don't want to downgrade my Cuda и СuDNN, I just want to use the last ones with last TF without compile it by myself.

And by the way, thanks you for doing it! Many people, I'm sure, aprecciate for that.

@fo40225
Copy link
Owner

fo40225 commented Mar 19, 2018

After the 1.7.0 release, I will use SSE2 and AVX2 to build the wheel. SSE2 will not use --fast-math to have the same behavior as the official pip version. AVX2 uses --fast-math to speed up.

@metya
Copy link
Author

metya commented Mar 19, 2018

Cool! Thanks for that. I'll be wait)

@fo40225
Copy link
Owner

fo40225 commented Mar 31, 2018

I have uploaded 1.7.0, feel free to test it.

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

2 participants