import tensorflow as tf
# matrix2個を作成する
matrix1 = tf.constant([[3,4]])
matrix2 = tf.constant([[2],
[5]])
product = tf.matmul(matrix1,matrix2) #matrix multiply = np.dot(m1,m2);
# method 1
sess = tf.Session()
result = sess.run(product)
print(result)
sess.close()
# >>> [[26]]
# method 2
# sessはwith内で実行、close()しなくても問題ない
with tf.Session() as sess:
result2 = sess.run(product)
print(result2)
# >>>[[26]]
ーーーーーーーーーーーーーーーーーーーーーーー
matrix1* matrix2 = [[3*2+4*5]]=[[6+20]]=[[26]]