0
点赞
收藏
分享

微信扫一扫

tensorflow 点乘 实例

彭维盛 2022-07-27 阅读 200


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 条评论