def tf_nan_to_zeros_float32(tensor):
"""
Mask NaN values with zeros
:param tensor that might have Nan values
:return: tensor with replaced Nan values with zeros
"""
return tf.select(tf.is_nan(tensor), tf.zeros(tf.shape(tensor), dtype=tf.float32), tensor)
train_tuner.py 文件源码
python
阅读 29
收藏 0
点赞 0
评论 0
评论列表
文章目录