diff options
author | Yong Tang <yong.tang.github@outlook.com> | 2018-04-13 11:38:43 -0700 |
---|---|---|
committer | Jonathan Hseu <vomjom@vomjom.net> | 2018-04-13 11:38:43 -0700 |
commit | 0c2ca00e1082ab2692af68af183083e41393f6c4 (patch) | |
tree | 1818912e3c2fdf1631cc5df148c9e82f1ce2d082 /CODEOWNERS | |
parent | 692a71da6aad55dcaa597633aaf88de8322ca8ab (diff) |
Fix crash when invalid dtype was passed (#18481)
* Fix crash when invalid dtype was passed
This fix tries to address the issue raised in 18474
where crash may happen if invalid dtype (e.g., `"[,]"`)
is passed to `tf.constant(tf.string, "[,]")`. The crash
happens during the comparision of `"[,]"` and numpy dtype
candidate (e.g., `np.dtype([("qint8", np.int8, 1)])`:
```
>>> import numpy as np
>>> np.dtype([("qint8", np.int8, 1)]) == "[,]"
Segmentation fault: 11
```
This fix adds a type check to make sure the type of the passed
dtype is either numpy.dtype or type.
This fix fixes 18474.
Signed-off-by: Yong Tang <yong.tang.github@outlook.com>
* Add test case for invalid type to tf.constant
Signed-off-by: Yong Tang <yong.tang.github@outlook.com>
Diffstat (limited to 'CODEOWNERS')
0 files changed, 0 insertions, 0 deletions