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.]]