Defining Operations in TensorFlow

An operation in TensorFlow takes one or more inputs and produces one or more outputs. If we take a look at the TensorFlow API, we’ll see that TensorFlow has a massive collection of operations available. Here, we’ll take a look at a selected few of the myriad TensorFlow operations.

Comparison operations

Comparison operations are useful for comparing two tensors. The following code example includes a few useful comparison operations.

To understand the working of these operations, let’s consider two example tensors, x and y:

Get hands-on with 1200+ tech skills courses.