-
Notifications
You must be signed in to change notification settings - Fork 26.3k
Use _six for inf and nan #9500
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
Use _six for inf and nan #9500
Conversation
facebook-github-bot
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@ssnl has imported this pull request. If you are a Facebook employee, you can view this diff on Phabricator.
facebook-github-bot
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@ssnl has imported this pull request. If you are a Facebook employee, you can view this diff on Phabricator.
|
i'll merge after #9487 is merged. |
facebook-github-bot
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@ssnl has imported this pull request. If you are a Facebook employee, you can view this diff on Phabricator.
facebook-github-bot
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@ssnl is landing this pull request. If you are a Facebook employee, you can view this diff on Phabricator.
* Use _six for inf and nan (#9500) Summary: Things like `float('inf')` are actually quite expensive. ```py In [1]: import math In [2]: %timeit -n 200 math.inf 49.3 ns ± 1.42 ns per loop (mean ± std. dev. of 7 runs, 200 loops each) In [3]: %timeit -n 200 float('inf') 194 ns ± 39.1 ns per loop (mean ± std. dev. of 7 runs, 200 loops each) ``` Pull Request resolved: #9500 Reviewed By: soumith Differential Revision: D8876229 Pulled By: SsnL fbshipit-source-id: 78602b76bb53d5588910b58270930c0bd413d2d7 * use int64_t for im2col
Summary:
Things like `float('inf')` are actually quite expensive.
```py
In [1]: import math
In [2]: %timeit -n 200 math.inf
49.3 ns ± 1.42 ns per loop (mean ± std. dev. of 7 runs, 200 loops each)
In [3]: %timeit -n 200 float('inf')
194 ns ± 39.1 ns per loop (mean ± std. dev. of 7 runs, 200 loops each)
```
Pull Request resolved: pytorch#9500
Reviewed By: soumith
Differential Revision: D8876229
Pulled By: SsnL
fbshipit-source-id: 78602b76bb53d5588910b58270930c0bd413d2d7
Summary:
Things like `float('inf')` are actually quite expensive.
```py
In [1]: import math
In [2]: %timeit -n 200 math.inf
49.3 ns ± 1.42 ns per loop (mean ± std. dev. of 7 runs, 200 loops each)
In [3]: %timeit -n 200 float('inf')
194 ns ± 39.1 ns per loop (mean ± std. dev. of 7 runs, 200 loops each)
```
Pull Request resolved: pytorch#9500
Reviewed By: soumith
Differential Revision: D8876229
Pulled By: SsnL
fbshipit-source-id: 78602b76bb53d5588910b58270930c0bd413d2d7
Summary:
Things like `float('inf')` are actually quite expensive.
```py
In [1]: import math
In [2]: %timeit -n 200 math.inf
49.3 ns ± 1.42 ns per loop (mean ± std. dev. of 7 runs, 200 loops each)
In [3]: %timeit -n 200 float('inf')
194 ns ± 39.1 ns per loop (mean ± std. dev. of 7 runs, 200 loops each)
```
Pull Request resolved: pytorch#9500
Reviewed By: soumith
Differential Revision: D8876229
Pulled By: SsnL
fbshipit-source-id: 78602b76bb53d5588910b58270930c0bd413d2d7
Things like
float('inf')are actually quite expensive.