tensorflow数学运算

tensorflow数学运算

  1. 加法、 减法、乘法、 除法
a = tf.add(5, 2)  
b = tf.subtract(10, 4) 
c = tf.multiply(2, 5) 
x =tf.constant(10)
y = tf.constant(2)
z = tf.divide(x,y)
tf.cast(tf.constant(1), tf.float64)    
  1. 矩阵相乘,所以你要用 tf.matmul() 函数
    不要忘记矩阵相乘的规则,tf.matmul(a,b) 不等于 tf.matmul(b,a)。
原文地址:https://www.cnblogs.com/james0/p/8460131.html