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)。
posted @ 2018-02-22 21:16  james.yj  阅读(1120)  评论(0编辑  收藏  举报