- 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
推薦閱讀
- Augmented Reality with Kinect
- 基于Proteus和Keil的C51程序設計項目教程(第2版):理論、仿真、實踐相融合
- 計算機組裝·維護與故障排除
- 硬件產品經理手冊:手把手構建智能硬件產品
- 單片機原理及應用系統設計
- INSTANT ForgedUI Starter
- Manage Partitions with GParted How-to
- Apple Motion 5 Cookbook
- STM32嵌入式技術應用開發全案例實踐
- Machine Learning with Go Quick Start Guide
- 固態存儲:原理、架構與數據安全
- 單片機開發與典型工程項目實例詳解
- Spring Cloud實戰
- 筆記本電腦的結構、原理與維修
- ARM接口編程