- 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
推薦閱讀
- 用“芯”探核:龍芯派開發實戰
- ATmega16單片機項目驅動教程
- Mastering Delphi Programming:A Complete Reference Guide
- 深入淺出SSD:固態存儲核心技術、原理與實戰
- Linux運維之道(第2版)
- Artificial Intelligence Business:How you can profit from AI
- Learning Game Physics with Bullet Physics and OpenGL
- 計算機組裝與維修技術
- 計算機組裝維修與外設配置(高等職業院校教改示范教材·計算機系列)
- 單片機開發與典型工程項目實例詳解
- Managing Data and Media in Microsoft Silverlight 4:A mashup of chapters from Packt's bestselling Silverlight books
- Wireframing Essentials
- 嵌入式系統原理及應用:基于ARM Cortex-M4體系結構
- 施耐德M241/251可編程序控制器應用技術
- Mastering Unity 2D Game Development