I am experimenting with the quantization of a neural network in Tensorflow 1.1.
According to the documentation, the tanh
operation supports floating point inputs as well as fixed point inputs of type qint32
. However, I can't get this to work:
import tensorflow as tf
sess = tf.InteractiveSession()
x = tf.constant([1.,2.,3.], dtype=tf.float32)
from tensorflow.python.ops.gen_array_ops import quantize_v2
x_quant = quantize_v2(x, min_range=0., max_range=4., T=tf.qint32)
y_quant = tf.nn.tanh(x_quant[0])
The code yields an error message:
TypeError: Value passed to parameter 'x' has DataType qint32 not in list of allowed values: float16, float32, float64, complex64, complex128
Is there a way out or is it just a bug in the docs?