np和tf中创建矩阵

创建一个2层3行4列的矩阵

numpy:

np.random.randn(2,3,4)

tensorflow:

tf.random_normal([2,3,4])

import tensorflow as tf

a=tf.random_normal([2,3,4])
with tf.Session() as sess:
    print(sess.run(a)) 

猜你喜欢

转载自blog.csdn.net/eruiwen1624/article/details/89449471