官术网_书友最值得收藏!

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>
主站蜘蛛池模板: 甘洛县| 侯马市| 新野县| 应用必备| 新巴尔虎右旗| 巧家县| 汉沽区| 汉沽区| 昭通市| 巴林右旗| 保康县| 伊通| 砚山县| 邹平县| 克东县| 大石桥市| 肥东县| 绥芬河市| 余姚市| 梨树县| 保定市| 大英县| 政和县| 祁连县| 南靖县| 保亭| 米易县| 朝阳市| 忻城县| 白城市| 莒南县| 穆棱市| 措勤县| 朝阳县| 邳州市| 丰镇市| 大关县| 龙山县| 舞阳县| 扎赉特旗| 江达县|