Commit 440e3850 authored by Yong Tang's avatar Yong Tang Committed by drpngx
Browse files

Fix issue in Keras model complie with float64 mode (#19328)



* Fix issue in Keras model complie with float64 mode

This fix tries to address the issue raised in 19318 where
Keras model complie for `model.compile('rmsprop', 'mse')`
does not work in float64 mode.

The issue comes from `placeholder_with_default([1.]...`, which
returns dtype float32 by default (as `[1.]` was inteprated
as float32). Since placeholder does not have a output_dtype to pass,
this fix converts `[1.]` to float64 first before passing in.

This fix fixes 19318.

Signed-off-by: default avatarYong Tang <yong.tang.github@outlook.com>

* Fix pylint issue

Signed-off-by: default avatarYong Tang <yong.tang.github@outlook.com>

* Add test case for float64 and model compile

Signed-off-by: default avatarYong Tang <yong.tang.github@outlook.com>
parent a3b9e750
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please to comment