What's the difference in adding methods to TensorFlow?

Adding three methods: +

, tf.add

, tf.nn.biad_add

. I made a test in ipython, here is the test data.

a = tf.Variable([[1,2],[3,4]])
b = tf.Variable([10,20])

      

All three methods were returned array([[11, 22],[13, 24]], dtype=int32)

. So what's the difference between the two?

Thank!

+3


source to share


1 answer


From tensorflow documentation here :

Unlike tf.add, the offset type can be different from the value when both are quantized.



tf.add

is a common addition operation, whereas tf.nn.bias_add

should be used specifically to add bias to weights, which throws an exception if the dtypes do not match.

+1


source







All Articles