Don't want to get left behind? Learn to build with A.I. now 🤖

Top 4 Reasons Why You Should Learn PyTorch

Daniel Bourke
Daniel Bourke
hero image

Are you thinking of getting started in Machine Learning but not sure which framework to learn?

Maybe PyTorch (you clicked on this post after all). But you heard TensorFlow was great too. What about all the other options?

Your time is valuable and with so many options available, you want to know which one is worth learning first and why.

I'm going to spoil it for you but you can't go wrong with either PyTorch or TensorFlow. But now that I said that, I'll bet you that by the end of this post, you'll choose PyTorch 😉.

Only one way to find out I guess, right?

But first...

What is PyTorch?

PyTorch is an open-source Python-based framework for machine learning. This simply means that it's based on the incredibly popular Python programming language, and the Torch ML library.

And because it's open-source, it allows anyone around the world to download and contribute (with adequate checks) to the PyTorch source code, which currently has over 60,000 stars on GitHub.

Pytorch star rating on Github

Due to this popularity, many of the world’s most impressive machine learning and artificial intelligence (AI) models are built using PyTorch, and I'll share some examples in just a second.

Note: By building, I mean, the algorithms are coded in PyTorch and then are used for various tasks such as:

  • Computer vision
  • Natural language processing
  • Speech-to-text and text-to-speech
  • Text-to-image generation (such as the one below)
  • Time series forecasting and analysis
  • Self-driving cars
  • and more!

Here you can see an example of artwork created by AI, which has really taken off in recent months.

An artificial intelligence system being born out of a computer with flames coming out of it

Chances are if there’s a machine learning task that you can think of, there’s a PyTorch model out there for it.

Note: For simplicity, I use the terms artificial intelligence (AI), machine learning (ML) and deep learning interchangeably. Deep learning is a form of ML and ML is a form of AI. PyTorch is mostly known for deep learning, the form of ML used for many of the latest AI advancements.

Why learn PyTorch (or even use it at all)?

Even if we ignore all the possible applications listed above where you can use PyTorch, there are still multiple other reasons to learn and use it.

For starters, it’s a very capable machine learning framework with a unique twist.

Let me explain:

I’m a big fan of the idea that you should learn the language rather than just the framework. In this case, learn the language of machine learning, rather than just a framework for it.

This will give you a deeper understanding and make you much more capable at using the framework you choose.

(Anyone can drill a hole, but putting up a shelf correctly takes more skill than knowing how to use a drill).

all the gear and no idea

So the beautiful unique twist with PyTorch is that you will actually learn the language of machine learning at the exact same time as you're learning to use PyTorch itself.


Well, the main objectives of machine learning are:

  1. Turn your data into numbers
  2. Build an algorithm to find patterns in it

Sounds easy?

Sure it does. But those two problems are what some of the best engineers and researchers in the world are working on right now, and the solutions keep changing.

PyTorch helps you build these solutions.

So by learning to use PyTorch for various problems, (like you would in the Zero to Mastery: PyTorch for Deep Learning course) you get to double the bang for your buck.

You’ll be learning machine learning and how to use one of the main tools for machine learning at the same.

Learning machine learning by doing machine learning. Genius right?

How about a few more reasons why you should learn it...

Reason #1 - Many of the biggest technology companies in the world use PyTorch

Several of the world’s biggest technology companies such as OpenAI (creators of GPT-3), Microsoft, Amazon, Tesla, Meta (Facebook and Instagram), Airbnb, Apple and many more large companies use PyTorch to power their machine learning products.

Multiple FAANG companies use PyTorch to power their AI

What like?

  • The computer vision algorithms in Tesla’s self-driving system, Autopilot, are built using PyTorch
  • The translation, speech-to-text, feed-curation and voice recognition algorithms inside Facebook and Instagram are created with PyTorch

Pretty cool right?

And there’s a trickle-down effect, because if the largest technology companies use PyTorch, many other companies will too. (And have already started).

And the more companies using it, the more jobs there will be available for people that know how to use PyTorch.

Heck, PyTorch is even used in weed-killing tractors!

PyTorch used with tractor AI

Reason #2 - PyTorch comes with accelerated computing out of the box

If machine learning is finding patterns in data and deep learning is finding deep patterns in data, how exactly does it work?

Lots and lots of calculations. Specifically, matrix multiplications.

ai pattern recognition

I won’t get into specifics here but you can see the free matrix multiplication chapter in the PyTorch Fundamentals notebook at for more detail.

The important point is that machine learning requires performing mathematical operations at scale. As you can imagine, these operations require computer processing power and some forms of computer processors are faster than others.

Graphics Processing Units (GPUs) or the newer Tensor Processing Units (TPUs) are generally faster than Compute Processing Units (CPUs) at matrix multiplications (the main operation behind many deep learning algorithms).

And the great news is that PyTorch comes with the ability to perform accelerated computations on these devices out of the box.

All with a single line of code:

# Send "thing_you_want_to_GPU" to the GPU ("cuda" is the framework for GPU computing)
thing_you_want_to_GPU ="cuda")

Accelerated computing means you can perform machine learning experiments faster, figure out what doesn’t work faster, and in turn, figure out what does work faster.

Reason #3 - PyTorch is the top machine learning research framework

It’s no surprise PyTorch is so widely used by many of the largest technology companies, especially when you realize that PyTorch is also the most used machine learning research framework.

According to (one of the best places to view the latest and greatest in the world of machine learning), as of September 2022, PyTorch is the machine learning framework used for 64% of machine learning research teams who publish their code.

papers with code trends september 2022

Impressive right?

And just like before with FAANG adoption, if the latest research is being published with PyTorch, then the industry starts to follow and use it also.

For further proof, the use of PyTorch on the popular data science challenge website, Kaggle, has grown year-on-year for the past five years (as reported in their 2022 machine learning and data science survey).

kaggle machine learning and data-science survey for 2022 shops major pytorch growth

Reason #4 - PyTorch comes with plenty of integrations to other machine learning libraries

PyTorch originated at Facebook due to a need to process the large amounts of data the company was getting and to help with their ad platforms targeting.

Then in 2017, they open-sourced PyTorch to allow others to benefit from its capabilities. But open-sourcing PyTorch wasn't purely altruistic. It also meant that other talented engineers, outside of Facebook, would also start to work on it.

This means the PyTorch ecosystem today has contributors from various people and industries all over the world.

A handful of examples include:

  • fastai - The fastest way to get state-of-the-art results in several deep learning domains.
  • Lightning - Build and train PyTorch models without all of the boilerplate code.
  • VISSL - A computer vision library for state-of-the-art Self-Supervised Learning models built with PyTorch.
  • Detectron2 - A computer vision platform for object detection and image segmentation.
  • Albumentations - An image augmentation library for applying data augmentation in computer vision pipelines.
  • Captum - A library for interpreting what goes on inside a PyTorch model.

You can see a full list of the integrations on the PyTorch Ecosystem page.

Bonus reason #5 - PyTorch is fun!

The most important reason (and because no one likes using tools that suck to work with).

With just a couple of lines of code, PyTorch allows us to do incredibly interesting and fun things that simply weren’t possible 10 years ago even if you had a team of 20 engineers and a year of compute time!

That’s crazy to think about, and PyTorch is only getting better.

If you’ve never done it before, writing machine learning code, especially using PyTorch feels like part art, part science.

Like a Japanese tea ceremony to convince data to reveal its secrets, every experiment brings a surprise.

That’s why I designed the Zero to Mastery: PyTorch for Deep Learning course to be as hands-on as possible.

Inside, you’ll learn important machine learning concepts by writing thousands of lines of PyTorch code:

  • We’ll write every line together
  • If I get it wrong, you’ll get it wrong
  • And I get it right, you’ll get it right too

It's a blast!

Which is better? PyTorch or TensorFlow?

Although this article is focused on PyTorch, I’m putting this here because this question comes up a lot, and it might be the last thing that stops you from learning.

So which framework wins the great PyTorch vs. TensorFlow battle?

Maybe I'll do a deep dive into this soon diving into specific use cases for each. But my overall conclusion will still likely be that you can't go wrong picking either one.

The simple answer is what I said before: learning the language of machine learning is more important than the framework you choose.

Both allow you to do this.

  • Both are open-source
  • Both are widely used... PyTorch is used by all the companies mentioned above, while TensorFlow is used by Google (and many others)
  • What you can do in PyTorch, you can do in TensorFlow and what you can do in TensorFlow, you can do in PyTorch
  • Both allow you to learn the "language of machine learning" so you can easily bridge between the two if you need

They're both great. Flip a coin and pick one. What matters more is that you just get started. You won't regret being part of this incredibly fun industry.

And even better news? No matter which one you choose, we have courses on both!

So, how do I get started with PyTorch?

All you need to do is install, learn and apply!

PyTorch runs on almost any computing system you can think of (Linux, Windows, Mac) and you can install it via the instructions on the PyTorch install page.

However, the quickest way to get started is via Google Colab, a free and online compute environment (the same one we use in the ZTM PyTorch course).

Go ahead and learn PyTorch today

And it's as simple as that!

So what are you waiting for? Go ahead and learn PyTorch today and start building projects of your own.

Who knows... you could be the next ML hire at Tesla.

More from Zero To Mastery

The 3 Most Common PyTorch Errors (And How To Solve Them) preview
The 3 Most Common PyTorch Errors (And How To Solve Them)

PyTorch is one of the largest ML libraries available, so it's common to make mistakes when using it. Here are the top 3 user errors and how to fix them.

How To Get Paid While Learning To Code preview
How To Get Paid While Learning To Code

Learning to code takes time, but that doesn't mean you can't get paid for being a coder while you're still learning... Here's 10 methods you can use, today 💰.

AMA Deep Dive on PyTorch, Deep Learning, Machine Learning + More preview
AMA Deep Dive on PyTorch, Deep Learning, Machine Learning + More

Is Machine Learning difficult to learn? How much does it pay, and which framework should you use? Daniel Bourke answers these questions & more in this AMA.