我看到一些tensorflow函数用于元素智能操作:reduce_sum,add,negative等。
例如这个代码:
import tensorflow as tf
distance = tf.reduce_sum(tf.abs(tf.add(xtr, tf.negative(xte))), reduction_indices=1)
当我尝试使用以下代码时,我发现它们具有相同的效果:
distance = tf.reduce_sum(tf.abs(xtr-xte), reduction_indices=1)
所以我想知道:
1,无论是add,negative,multiply随时可以被替换+,-,*?如果不是,你能给我一些例外的例子吗?
2,另外,如何列出所有具有相应运算符的函数?
MYYA
相关分类