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

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>
主站蜘蛛池模板: 遂川县| 济源市| 昭苏县| 大理市| 聊城市| 乐东| 滨海县| 金乡县| 库尔勒市| 桓台县| 台江县| 甘孜| 密云县| 兴城市| 巩义市| 广德县| 铁岭县| 阜城县| 河北区| 湟源县| 美姑县| 河南省| 墨竹工卡县| 临城县| 边坝县| 永城市| 嫩江县| 班玛县| 玉山县| 二连浩特市| 巴彦淖尔市| 清水县| 新密市| 平安县| 绥芬河市| 洱源县| 大洼县| 西青区| 龙陵县| 内丘县| 海宁市|