March 2019
Intermediate to advanced
196 pages
4h 50m
English
Here is a little example adapted for eager execution from https://colab.research.google.com/notebooks/mlcc/creating_and_manipulating_tensors.ipynb#scrollTo=6UUluecQSCvr.
Notice that this example shows how to initialize an eager variable with a call to a TensorFlow function.
dice1 = tf.Variable(tf.random.uniform([10, 1], minval=1, maxval=7, dtype=tf.int32)) dice2 = tf.Variable(tf.random.uniform([10, 1], minval=1, maxval=7, dtype=tf.int32)) # We may add dice1 and dice2 since they share the same shape and size. dice_sum = dice1 + dice2 # We've got three separate 10x1 matrices. To produce a single # 10x3 matrix, we'll concatenate them along dimension 1. resulting_matrix = tf.concat(values=[dice1, ...
Read now
Unlock full access