官术网_书友最值得收藏!

  • Mastering TensorFlow 1.x
  • Armando Fandango
  • 97字
  • 2021-06-25 22:50:55

Tensors generated from library functions

Tensors can also be generated from various TensorFlow functions. These generated tensors can either be assigned to a constant or a variable, or provided to their constructor at the time of initialization.

As an example, the following code generates a vector of 100 zeroes and prints it:

a=tf.zeros((100,))
print(tfs.run(a))

TensorFlow provides different types of functions to populate the tensors at the time of their definition:

  • Populating all elements with the same values
  • Populating elements with sequences
  • Populating elements with a random probability distribution, such as the normal distribution or the uniform distribution
主站蜘蛛池模板: 义马市| 石家庄市| 壶关县| 巫山县| 渭南市| 永胜县| 蓬安县| 莱阳市| 琼中| 阿克陶县| 遵义县| 莱芜市| 石台县| 青岛市| 东海县| 沙田区| 巨野县| 本溪| 新乡县| 仙居县| 黔西县| 陵川县| 信阳市| 高雄市| 皮山县| 洛宁县| 沙坪坝区| 库尔勒市| 宕昌县| 仙桃市| 台前县| 六盘水市| 白银市| 天镇县| 杭锦旗| 尼玛县| 杭州市| 津南区| 隆子县| 浦城县| 分宜县|