tensorflow随笔-constant

版权声明:本文为博主原创文章,未经博主允许不得转载。 https://blog.csdn.net/u010255642/article/details/82830588
 # -*- coding: utf-8 -*-
"""
Spyder Editor

[email protected]
"""
import tensorflow as tf
import numpy as np
a=tf.constant(np.array([[6,2]],dtype=np.float32))
b=tf.constant([[3,6],[1,3]],dtype=tf.float32)
res=tf.matmul(a,b)
with tf.Session() as sess:

    print sess.run(res)
[[20. 42.]]

猜你喜欢

转载自blog.csdn.net/u010255642/article/details/82830588
今日推荐