TF Ops (Part 2)

Know about common TF ops performed on tensors, and learn about linear algebra operations supported by the TF framework.

Common TF ops

Here, we discuss some important TF ops applied to tensors. These include the following:

  • tf.transpose(): This is for taking the transpose of a tensor.

  • tf.matmul(): This is for matrix (tensor) multiplication.

  • tf.reshape(): This is to change the shape of the tensor.

  • tf.reduce_mean(): This is for reducing a tensor using its mean (equivalent to np.mean() in NumPy).

  • tf.reduce_sum(): This is for reducing a tensor using its sum (equivalent to np.sum() in NumPy).

  • tf.reduce_max(): This is for reducing a tensor using its maximum value (equivalent to np.max() in NumPy).

  • tf.squeeze(): This is to remove dimensions of size 1 from a tensor.

  • tf.slice(): This is to extract a slice of the specified size from an input tensor.

  • tf.tile(): This is for tiling a tensor a number of times along each axis as specified by some multiple.

Get hands-on with 1200+ tech skills courses.