python
dwyjqkg
这个作者很懒,什么都没留下…
展开
-
Python之TensorFlow:张量运算
一、题目二、程序import tensorflow as tfx0=tf.ones([10],tf.float32)#print(x0)x1=tf.constant([64.3,99.6,145.45,63.75,135.46,92.85,86.97,144.76,59.3,116.03],tf.float32)#print(x1)x2=tf.constant([2,3,4,2,3,4,2,4,1,3],tf.float32)#print(x2)y=tf.constant([6原创 2021-10-25 12:46:55 · 642 阅读 · 0 评论 -
Python之Tensorflow:生成均匀分布随机数
一、题目生成一个[0,1)之间均匀分布的随机数数组,包含1000个元素, 随机种子为612。接收用户输入一个1-100之间的数字。打印随机数组中所有索引值可以被输入整数整除的数字,并打印序号和索引值。序号从1开始,依次加1。例如,用户输入50,则打印数组中索引值为0,50,100...1000的随机数。程序运行示例:请输入一个1-100之间的整数:50序号 索引值 随机数1 0 0.74011115777479082 50 0.47813945362377797...原创 2021-10-06 11:42:48 · 3178 阅读 · 0 评论