This is the third tutorial in our TensorFlow tutorial series.

What is tensors in TensorFlow?

TensorFlow's central data type is the tensor. Tensors are the underlying components of computation and a fundamental data structure in TensorFlow. Without using complex mathematical interpretations, we can say a tensor (in TensorFlow) describes a multidimensional numerical array, with zero or n-dimensional collection of data, determined by rank, shape, and type.

A rank, shape and type are three parameters, by a tensors can be identified.

Rank: A tensor may have numerous dimensions, and the number of dimensions in a tensor is its rank.

Shape: The lengths of a tensor's dimensions form an array called the tensor's shape. In other words, the shape of a tensor is the number of rows and columns it has.

A zero-dimensional(rank zero) tensor is called a scalar; has shape of [1].

A one-dimensional(rank one) tensor is called a vector; has shape of [columns] or [rows].

A two-dimensional(rank two) tensor is called a matrix; has shape of [rows,columns].

Type: It is the data type assigned to the tensor's elements(items).

Need to remember below points about tensors:

Each tensor is an instance of the Tensor class.

A tensor may consist of numbers, strings, floating-point or Boolean values.

Each item or element of a tensor must have the same data type.

Using functions of the tf package we can create, process, transform and operate tensors.

Create tensors using different functions