Basically, I am testing the difference speed of Conv2D and QuantizedConv2D. I found that if I use two constant nodes as input and filter, the QuantizedConv2D is faster than Conv2D; but if I use a placeholder node as input, and a constant node as a filter, the QuantizedConv2D is much slower than Conv2D.
I use "tf.Session.run" method to feed data to the placeholder.
My environment is:
tensorflow-1.3(only CPU), compile with source code, python2.7; (and when compiling tensorflow, I use -msse4.1)
I use python time module to test the cost time
a=time.time();
for i in range(NUM):
c=sess.run([output], feed_dict={data: np_list});
b=time.time();
costime = (b-a)/NUM;
Can anybody share the reason?