fixed: hard coding for max and min number will out of range in fp16, which will cause nan.
Author: ziliwang
Pull request: yes


Comments:
# [Codecov](https://codecov.io/gh/huggingface/pytorch-transformers/pull/1249?src=pr&el=h1) Report
> Merging [#1249](https://codecov.io/gh/huggingface/pytorch-transformers/pull/1249?src=pr&el=desc) into [master](https://codecov.io/gh/huggingface/pytorch-transformers/commit/364920e216c16d73c782a61a4cf6652e541fbe18?src=pr&el=desc) will **decrease** coverage by `0.21%`.
> The diff coverage is `61.11%`.

[![Impacted file tree graph](https://codecov.io/gh/huggingface/pytorch-transformers/pull/1249/graphs/tree.svg?width=650&token=9qOlN6Hb1c&height=150&src=pr)](https://codecov.io/gh/huggingface/pytorch-transformers/pull/1249?src=pr&el=tree)

```diff
@@            Coverage Diff             @@
##           master    #1249      +/-   ##
==========================================
- Coverage   81.23%   81.02%   -0.21%     
==========================================
  Files          57       57              
  Lines        8029     8035       +6     
==========================================
- Hits         6522     6510      -12     
- Misses       1507     1525      +18
```


| [Impacted Files](https://codecov.io/gh/huggingface/pytorch-transformers/pull/1249?src=pr&el=tree) | Coverage Δ | |
|---|---|---|
| [pytorch\_transformers/modeling\_transfo\_xl.py](https://codecov.io/gh/huggingface/pytorch-transformers/pull/1249/diff?src=pr&el=tree#diff-cHl0b3JjaF90cmFuc2Zvcm1lcnMvbW9kZWxpbmdfdHJhbnNmb194bC5weQ==) | `54.43% <60%> (-0.18%)` | :arrow_down: |
| [pytorch\_transformers/modeling\_utils.py](https://codecov.io/gh/huggingface/pytorch-transformers/pull/1249/diff?src=pr&el=tree#diff-cHl0b3JjaF90cmFuc2Zvcm1lcnMvbW9kZWxpbmdfdXRpbHMucHk=) | `90.03% <66.66%> (-0.25%)` | :arrow_down: |
| [pytorch\_transformers/file\_utils.py](https://codecov.io/gh/huggingface/pytorch-transformers/pull/1249/diff?src=pr&el=tree#diff-cHl0b3JjaF90cmFuc2Zvcm1lcnMvZmlsZV91dGlscy5weQ==) | `66.66% <0%> (-4.85%)` | :arrow_down: |
| [...orch\_transformers/tests/tokenization\_utils\_test.py](https://codecov.io/gh/huggingface/pytorch-transformers/pull/1249/diff?src=pr&el=tree#diff-cHl0b3JjaF90cmFuc2Zvcm1lcnMvdGVzdHMvdG9rZW5pemF0aW9uX3V0aWxzX3Rlc3QucHk=) | `92% <0%> (-4%)` | :arrow_down: |
| [...h\_transformers/tests/tokenization\_tests\_commons.py](https://codecov.io/gh/huggingface/pytorch-transformers/pull/1249/diff?src=pr&el=tree#diff-cHl0b3JjaF90cmFuc2Zvcm1lcnMvdGVzdHMvdG9rZW5pemF0aW9uX3Rlc3RzX2NvbW1vbnMucHk=) | `97.43% <0%> (-2.57%)` | :arrow_down: |
| [pytorch\_transformers/tokenization\_gpt2.py](https://codecov.io/gh/huggingface/pytorch-transformers/pull/1249/diff?src=pr&el=tree#diff-cHl0b3JjaF90cmFuc2Zvcm1lcnMvdG9rZW5pemF0aW9uX2dwdDIucHk=) | `95.86% <0%> (-0.83%)` | :arrow_down: |
| [pytorch\_transformers/tokenization\_transfo\_xl.py](https://codecov.io/gh/huggingface/pytorch-transformers/pull/1249/diff?src=pr&el=tree#diff-cHl0b3JjaF90cmFuc2Zvcm1lcnMvdG9rZW5pemF0aW9uX3RyYW5zZm9feGwucHk=) | `33.89% <0%> (-0.29%)` | :arrow_down: |

------

[Continue to review full report at Codecov](https://codecov.io/gh/huggingface/pytorch-transformers/pull/1249?src=pr&el=continue).
> **Legend** - [Click here to learn more](https://docs.codecov.io/docs/codecov-delta)
> `Δ = absolute <relative> (impact)`, `ø = not affected`, `? = missing data`
> Powered by [Codecov](https://codecov.io/gh/huggingface/pytorch-transformers/pull/1249?src=pr&el=footer). Last update [364920e...8bdee1c](https://codecov.io/gh/huggingface/pytorch-transformers/pull/1249?src=pr&el=lastupdated). Read the [comment docs](https://docs.codecov.io/docs/pull-request-comments).


LGTM, thanks @ziliwang