tensorflow 点乘 实例

彭维盛

关注

阅读 200

2022-07-27


import tensorflow as tf

a = tf.constant([[1,2,3],[1,2,3]])

b = tf.constant([[2,3,4]])

print(a.get_shape())

print(b.get_shape())

c = a*b

c= tf.Print(c,[c])

with tf.Session() as sess:
print(sess.run(c))

print结果: 
(2, 3)
(1, 3)
I tensorflow/core/kernels/logging_ops.cc:79] [[2 6 12]…]
[[ 2 6 12]
[ 2 6 12]]


精彩评论(0)

0 0 举报