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

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>
主站蜘蛛池模板: 新晃| 咸宁市| 惠州市| 墨竹工卡县| 格尔木市| 光泽县| 丹棱县| 泽普县| 衢州市| 新宁县| 台江县| 文安县| 溧阳市| 宜章县| 辰溪县| 宣城市| 鄄城县| 巫山县| 虎林市| 临沂市| 济宁市| 永新县| 申扎县| 垫江县| 洛南县| 神农架林区| 泾川县| 江安县| 商河县| 台中市| 罗江县| 潜山县| 花莲市| 泾阳县| 夏津县| 辛集市| 三台县| 渑池县| 图片| 遂川县| 汉源县|