Name: Towards AI Legal Name: Towards AI, Inc. Description: Towards AI is the world's leading artificial intelligence (AI) and technology publication. Read by thought-leaders and decision-makers around the world. Phone Number: +1-650-246-9381 Email: pub@towardsai.net
228 Park Avenue South New York, NY 10003 United States
Website: Publisher: https://towardsai.net/#publisher Diversity Policy: https://towardsai.net/about Ethics Policy: https://towardsai.net/about Masthead: https://towardsai.net/about
Name: Towards AI Legal Name: Towards AI, Inc. Description: Towards AI is the world's leading artificial intelligence (AI) and technology publication. Founders: Roberto Iriondo, , Job Title: Co-founder and Advisor Works for: Towards AI, Inc. Follow Roberto: X, LinkedIn, GitHub, Google Scholar, Towards AI Profile, Medium, ML@CMU, FreeCodeCamp, Crunchbase, Bloomberg, Roberto Iriondo, Generative AI Lab, Generative AI Lab VeloxTrend Ultrarix Capital Partners Denis Piffaretti, Job Title: Co-founder Works for: Towards AI, Inc. Louie Peters, Job Title: Co-founder Works for: Towards AI, Inc. Louis-François Bouchard, Job Title: Co-founder Works for: Towards AI, Inc. Cover:
Towards AI Cover
Logo:
Towards AI Logo
Areas Served: Worldwide Alternate Name: Towards AI, Inc. Alternate Name: Towards AI Co. Alternate Name: towards ai Alternate Name: towardsai Alternate Name: towards.ai Alternate Name: tai Alternate Name: toward ai Alternate Name: toward.ai Alternate Name: Towards AI, Inc. Alternate Name: towardsai.net Alternate Name: pub.towardsai.net
5 stars – based on 497 reviews

Frequently Used, Contextual References

TODO: Remember to copy unique IDs whenever it needs used. i.e., URL: 304b2e42315e

Resources

Our 15 AI experts built the most comprehensive, practical, 90+ lesson courses to master AI Engineering - we have pathways for any experience at Towards AI Academy. Cohorts still open - use COHORT10 for 10% off.

Publication

Tensors in Machine Learning: The Clearest Explanation You’ll Ever Read (ML Chapter-1)
Artificial Intelligence   Latest   Machine Learning

Tensors in Machine Learning: The Clearest Explanation You’ll Ever Read (ML Chapter-1)

Last Updated on November 25, 2025 by Editorial Team

Author(s): Sayan Chowdhury

Originally published on Towards AI.

Tensors in Machine Learning: The Clearest Explanation You’ll Ever Read (ML Chapter-1)

If you’ve ever opened a machine learning textbook or played with a deep-learning framework, you’ve seen the word tensor pop up everywhere. It sounds intimidating. It feels mathematical. And everyone seems to assume you already know what it means.

But here’s the good news:
A tensor is much simpler than people make it sound.

Why Are Tensors Everywhere in ML?

All machine learning systems work with numbers. Whether your input is:

an image, a chunk of text, an audio waveform, a row from your dataset, or even a video…your model only sees numbers. And those numbers must be stored in some structure.

That structure is a tensor.

What Exactly Is a Tensor?

A tensor is a structured container for numbers. Its structure depends on how many dimensions it has.

This “number of dimensions” is also called:

  • Rank
  • Order
  • Axes

All mean the same thing.

1. Scalars (Rank 0)

A scalar is just one number.

#Examples: 
Temperature= 31.2,
Learning_rate= 0.001
Loss_value= 2.43

2. Vectors (Rank 1)

A vector is a 1D list of numbers. It has length, but no width or height.

Examples: A 3D point: [2, 5, 7] , A color pixel: [120, 200, 45] , A word embedding (e.g., 300 numbers)

#A word like “king” can be represented as a 300-dimensional vector:
[0.12, -0.53, 0.91, ..., 0.04]

3. Matrices (Rank 2)

A matrix is a 2D grid of numbers: rows and columns.

Examples: grayscale image (28 × 28), confusion matrix, weight matrix for a neural network layer

#3x3 Image
[ 1 2 3 ]
[ 4 5 6 ]
[ 7 8 9 ]

4. Tensors (Rank 3 and above)

Once you go beyond 2D, you’re in tensor territory.

A tensor is simply: a vector of matrices, or a matrix of matrices, or a stacked collection of grids, or even a stack of stacks

# Rank 3 Tensor Example: RGB Image
Height × Width × Channels = 224 × 224 × 3
# Rank 4 Tensor Example: Batch of Images
Batch × Height × Width × Channels = 32 × 224 × 224 × 3
# Rank 5 Tensor Example: Video
Frames × Height × Width × Channels × Batch= 32 videos × 60 frames × 128 × 128 × 3

The shape tells you how many “directions” the data extends into.

Tensors in a Summary (Source: Sayan Chowdhury)

If you remember one idea from this article:

A tensor is just a structured container for numbers.
Different ranks represent different shapes, and ML models learn by transforming these tensors step by step.

Once you see tensors as nothing more than organized numbers, the entire Machine learning ecosystem becomes far easier to understand.

Thanks for reading. If you’d like more clear and practical ML content, hit the follow button .

Your support helps me keep creating useful Machine-learning explainers 💗😊

Join thousands of data leaders on the AI newsletter. Join over 80,000 subscribers and keep up to date with the latest developments in AI. From research to projects and ideas. If you are building an AI startup, an AI-related product, or a service, we invite you to consider becoming a sponsor.

Published via Towards AI


Take our 90+ lesson From Beginner to Advanced LLM Developer Certification: From choosing a project to deploying a working product this is the most comprehensive and practical LLM course out there!

Towards AI has published Building LLMs for Production—our 470+ page guide to mastering LLMs with practical projects and expert insights!


Discover Your Dream AI Career at Towards AI Jobs

Towards AI has built a jobs board tailored specifically to Machine Learning and Data Science Jobs and Skills. Our software searches for live AI jobs each hour, labels and categorises them and makes them easily searchable. Explore over 40,000 live jobs today with Towards AI Jobs!

Note: Content contains the views of the contributing authors and not Towards AI.