- TensorFlow 2.0 Quick Start Guide
- Tony Holdroyd
- 47字
- 2021-06-24 16:02:03
Declaring TensorFlow constants
TensorFlow constants may be declared as in the following example:
m_o_l = tf.constant(42)
m_o_l
# <tf.Tensor: id=45, shape=(), dtype=int32, numpy=42>
m_o_l.numpy()
# 42
Again, TensorFlow will infer the datatype, or it can be explicitly specified, as is the case with variables:
unit = tf.constant(1, dtype = tf.int64)
unit
# <tf.Tensor: id=48, shape=(), dtype=int64, numpy=1>
推薦閱讀
- 工業機器人技術及應用
- Learning Microsoft Azure Storage
- Visual C# 2008開發技術實例詳解
- 樂高創意機器人教程(中級 下冊 10~16歲) (青少年iCAN+創新創意實踐指導叢書)
- 永磁同步電動機變頻調速系統及其控制(第2版)
- 塊數據5.0:數據社會學的理論與方法
- 傳感器與物聯網技術
- Ruby on Rails敏捷開發最佳實踐
- Deep Reinforcement Learning Hands-On
- Machine Learning Algorithms(Second Edition)
- 學練一本通:51單片機應用技術
- 嵌入式GUI開發設計
- Web編程基礎
- INSTANT Adobe Story Starter
- 筆記本電腦維修之電路分析基礎