def test_set_floatx(self):
"""
Make sure that changes to the global floatx are effectively
taken into account by the backend.
"""
# Keep track of the old value
old_floatx = floatx()
set_floatx('float16')
var = variable([10])
check_dtype(var, 'float16')
set_floatx('float64')
var = variable([10])
check_dtype(var, 'float64')
# Restore old value
set_floatx(old_floatx)
评论列表
文章目录