阅读背景:

如何在张量流中乘以向量和矩阵而不进行重新整形?

来源:互联网 

This:

import numpy as np
a = np.array([1, 2, 1])
w = np.array([[.5, .6], [.7, .8], [.7, .8]])

print(np.dot(a, w))
# [ 2.6  3. ] # plain nice old matrix multiplication n x (n, m) -> m

import tensorflow as tf

a = tf.constant(a, dtype=tf.float64)
w = tf.constant(w)

with tf.Session() as sess:
    print(tf.matmul(a, w).eval())
import numpy as np
a = np.array([1, 2, 



你的当前访问异常,请进行认证后继续阅读剩余内容。

分享到: