March 2019
Intermediate to advanced
196 pages
4h 50m
English
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>
Read now
Unlock full access