- TensorFlow 2.0 Quick Start Guide
- Tony Holdroyd
- 47字
- 2021-06-24 16:02:03
Finding the size (number of elements) of a tensor
The number of elements in a tensor is easily obtained. Notice also, again, the use of the .numpy() function to extract the Python value from the tensor:
s = tf.size(input=t2).numpy()
s
The output will be as follows:
12
推薦閱讀
- Clojure Data Analysis Cookbook
- Unreal Engine:Game Development from A to Z
- Cinema 4D R13 Cookbook
- 2018西門子工業(yè)專家會議論文集(上)
- 數(shù)據(jù)庫原理與應(yīng)用技術(shù)學習指導
- 工業(yè)機器人應(yīng)用案例集錦
- Visual FoxPro程序設(shè)計
- 空間機械臂建模、規(guī)劃與控制
- Mastering pfSense
- 網(wǎng)絡(luò)存儲·數(shù)據(jù)備份與還原
- Puppet 3 Beginner’s Guide
- Hands-On DevOps
- 單片機C51應(yīng)用技術(shù)
- ARM體系結(jié)構(gòu)與編程
- 歐姆龍CP1系列PLC原理與應(yīng)用