tensorflow纤细半精度

tensorflow纤细半精度,tensorflow,Tensorflow,有没有办法在slim库中定义dtype=tf.half?一般来说,假设我希望使用fp16进行训练,即希望所有张量都具有半精度。是否有办法将其指定为tf.slim?用于tensorflow的半精度使用:tf.float16 示例: import tensorflow as tf import tensorflow.contrib.slim as slim weights = slim.variable('weights', shape=[10, 1], dtype=tf.float16) 导入te

有没有办法在slim库中定义
dtype=tf.half
?一般来说,假设我希望使用
fp16
进行训练,即希望所有张量都具有半精度。是否有办法将其指定为
tf.slim

用于tensorflow的半精度使用:
tf.float16

示例:

import tensorflow as tf import tensorflow.contrib.slim as slim weights = slim.variable('weights', shape=[10, 1], dtype=tf.float16) 导入tensorflow作为tf 导入tensorflow.contrib.slim作为slim 权重=slim.variable('weights',shape=[10,1],dtype=tf.float16)
对于tensorflow中的半精度,请使用:
tf.float16

示例:

import tensorflow as tf import tensorflow.contrib.slim as slim weights = slim.variable('weights', shape=[10, 1], dtype=tf.float16) 导入tensorflow作为tf 导入tensorflow.contrib.slim作为slim 权重=slim.variable('weights',shape=[10,1],dtype=tf.float16)