0
点赞
收藏
分享

微信扫一扫

theano T.dot 实例 (是tf.matmul而不是点乘)

楠蛮鬼影 2022-07-27 阅读 135


import theano
import numpy as np
import theano.tensor as T
ones = theano.shared(np.float32([[1,2,3],[4,5,6],[7,8,9]]))

print(ones.get_value())

result = T.dot(ones,ones)

print(result.eval())

结果:

[[ 1. 2. 3.]
[ 4. 5. 6.]
[ 7. 8. 9.]]

[[ 30. 36. 42.]
[ 66. 81. 96.]
[ 102. 126. 150.]]


举报

相关推荐

0 条评论