- 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>
推薦閱讀
- 現(xiàn)代測(cè)控系統(tǒng)典型應(yīng)用實(shí)例
- 32位嵌入式系統(tǒng)與SoC設(shè)計(jì)導(dǎo)論
- Learning Apache Cassandra(Second Edition)
- 視覺(jué)檢測(cè)技術(shù)及智能計(jì)算
- 大數(shù)據(jù)平臺(tái)異常檢測(cè)分析系統(tǒng)的若干關(guān)鍵技術(shù)研究
- Maya極速引擎:材質(zhì)篇
- Docker High Performance(Second Edition)
- 學(xué)會(huì)VBA,菜鳥(niǎo)也高飛!
- 精通數(shù)據(jù)科學(xué):從線性回歸到深度學(xué)習(xí)
- 云計(jì)算和大數(shù)據(jù)的應(yīng)用
- 液壓機(jī)智能故障診斷方法集成技術(shù)
- 會(huì)聲會(huì)影X4中文版從入門(mén)到精通
- 一步步寫(xiě)嵌入式操作系統(tǒng)
- 人工智能:智能人機(jī)交互
- Moodle 2.0 Course Conversion(Second Edition)