TensorFlow 产生任意随机数
tensorflow 如何生成各种随机数,不要限制在框架内!
X = tf.placeholder(tf.int32,shape=(None,None))
int1 = sess.run(X,feed_dict={X:[random.choices([1,2,3,4,5,6,7,8],k=5) for _ in range(10)]})
int2 = sess.run(tf.constant([random.choices([1,2,3,4,5,6,7,8],k=5) for _ in range(10)]))
int3 = sess.run(tf.convert_to_tensor([random.choices([1,2,3,4,5,6,7,8],k=5) for _ in range(10)]))
float1= sess.run(tf.random_normal([2, 3], mean=-1, stddev=4))