Show Menu
Cheatography

Tensorflow2.0 Cheat Sheet (DRAFT) by

Tensorflow 2.0 cheat sheet

This is a draft cheat sheet. It is a work in progress and is not finished yet.

Tensors

tensor = tf.con­sta­nt(­[[1,2], [3,4]])
np.squ­are­(te­nsor) # Apply np func to tf tensor
np.dot­(te­nsor, tensor) # Same for dot product
tensor.nu­mpy() # Transform to numpy array

String Tensors

tf_string = tf.con­sta­nt(­"­Ten­sor­flo­w")
tf.str­ing­s.l­eng­th(­tf_­string) get length
tf.str­ing­s.u­nic­ode­_de­cod­e(t­f_s­tring, "­UTF­8")
tf_str­ing­_array = tf.con­sta­nt(­['T­ens­orf­low', 'Deep Learning', 'AI'])