Understanding Tensor Mathematics

Let's now look at different mathematical computations using tensors:

  • Let's define two scalars and try to add and multiply them using TensorFlow:

  • We can add and multiply them and display the results:

  • We can also create a new scalar tensor by adding the two tensors:

  • We can also perform complex tensor functions:

Get 40 Algorithms Every Programmer Should Know now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.