December 2017
Intermediate to advanced
536 pages
14h 23m
English
Let's start with constants:
t_1 = tf.constant(4)
t_2 = tf.constant([4, 3, 2])
tf.zeros([M,N],tf.dtype)
Let's take an example:
zero_t = tf.zeros([2,3],tf.int32) # Results in an 2×3 array of zeros: [[0 0 0], [0 0 0]]
tf.zeros_like(t_2) # Create a zero matrix of same shape as t_2 tf.ones_like(t_2) # Creates a ones matrix of same shape as t_2
Read now
Unlock full access