Repolode
pytorch

pytorch/pytorch

A Python deep learning framework offering GPU-accelerated tensor computation and dynamic neural networks built on autograd.

Open-source alternative to:TensorFlowMATLAB

Stars
104,939
Forks
32,419
Open issues
17,651
Last commit
6 hours ago

What is it?

PyTorch is a Python package for two main purposes: tensor computation similar to NumPy, with strong GPU acceleration, and building deep neural networks on a tape-based autograd system. Tensors can live on the CPU or GPU, and the library includes a wide range of routines for slicing, indexing, math, linear algebra and reductions.

Neural networks in PyTorch are built and run imperatively, so the graph can change on every execution rather than being fixed ahead of time. The project is designed to integrate with the Python ecosystem, letting developers use NumPy, SciPy and Cython alongside it, and offers C++ extension APIs for custom layers.

The repository also covers building from source with CUDA, ROCm and Intel GPU support, plus Docker images and prebuilt wheels for Linux, macOS and Windows.

Key features

  • 01GPU-accelerated tensors with a NumPy-like API
  • 02Tape-based autograd for automatic differentiation of tensor operations
  • 03Dynamic computation graphs that can change on each run
  • 04torch.nn library for building neural network layers and models
  • 05C++ extension API for writing custom operations

Use cases

  • Training deep learning models on NVIDIA, AMD or Intel GPUs
  • Prototyping research models that need flexible, changing network structures
  • Using GPU-accelerated NumPy-style computation in scientific workloads
  • Building custom neural network layers in Python or C++

Quick start

  1. 1

    Install prebuilt binaries via Conda or pip using the commands on the official website

  2. 2

    Clone the PyTorch source code

    git clone https://github.com/pytorch/pytorch
  3. 3

    Install development dependencies from the PyTorch directory

    pip install --group dev
  4. 4

    Build and install PyTorch in editable mode

    python -m pip install --no-build-isolation -v -e .

Things to know

  • Building from source needs at least 10 GB of disk space and 30-60 minutes for the first build.
  • Source builds require a C++20 compiler, such as gcc 11.3 or newer on Linux.
  • The license is not clearly identified in the project metadata, so check the LICENSE file before commercial use.

Topics

FAQ

What is pytorch?
A Python deep learning framework offering GPU-accelerated tensor computation and dynamic neural networks built on autograd. PyTorch is a Python package for two main purposes: tensor computation similar to NumPy, with strong GPU acceleration, and building deep neural networks on a tape-based autograd system. Tensors can live on the CPU or GPU, and the library includes a wide range of routines for slicing, indexing, math, linear algebra and reductions.
Is pytorch free to use? What license does it have?
pytorch is open source under the Other license. Check the license terms before using it in commercial products.
Is pytorch still maintained?
Actively maintained. The last commit to pytorch was on Oct 21, 2026.
What can I use pytorch for?
Training deep learning models on NVIDIA, AMD or Intel GPUs Prototyping research models that need flexible, changing network structures Using GPU-accelerated NumPy-style computation in scientific workloads Building custom neural network layers in Python or C++
How do I install pytorch?
Install prebuilt binaries via Conda or pip using the commands on the official website Clone the PyTorch source code: git clone https://github.com/pytorch/pytorch Install development dependencies from the PyTorch directory: pip install --group dev Build and install PyTorch in editable mode: python -m pip install --no-build-isolation -v -e .
Where can I get pytorch?
The source code and installation instructions are on GitHub: https://github.com/pytorch/pytorch

Summary generated by AI from the project's README. GitHub stats refresh daily.

Related projects