- 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
推薦閱讀
- GNU-Linux Rapid Embedded Programming
- Hands-On Intelligent Agents with OpenAI Gym
- 會聲會影X5視頻剪輯高手速成
- Mastering Elastic Stack
- PostgreSQL 10 Administration Cookbook
- HTML5 Canvas Cookbook
- 電子設備及系統(tǒng)人機工程設計(第2版)
- 自動化生產(chǎn)線安裝與調(diào)試(三菱FX系列)(第二版)
- Visual Studio 2010 (C#) Windows數(shù)據(jù)庫項目開發(fā)
- 從零開始學JavaScript
- Building Google Cloud Platform Solutions
- 大數(shù)據(jù)時代的調(diào)查師
- 信息系統(tǒng)安全保障評估
- Hands-On Artificial Intelligence for Beginners
- Practical Autodesk AutoCAD 2021 and AutoCAD LT 2021