Ahmad
Ahmad

Reputation: 742

What is tensor Rank?

I came through tensor slices and tensor rank. I read a lot of material related to this but could not satisfy myself.

Can anyone explain thoroughly with the help of examples, specifically in the view of TensorFlow?

Upvotes: 1

Views: 260

Answers (1)

Nicolas Gervais
Nicolas Gervais

Reputation: 36674

tf.rank is like array.ndim in NumPy. It's the number of dimensions. E.g., a picture has rank 3:

640, 640, 3

A batched picture dataset has rank 4:

10000, 640, 640, 3

Tabular data has rank 2:

150, 4

It's that simple. Let me know if I should add anything.

Upvotes: 1

Related Questions