PyTorch: Tensor computation with GPU acceleration
Python framework for differentiable tensor computation and deep learning.
Learn more about PyTorch
PyTorch is a Python machine learning library that provides tensor computation primitives and automatic differentiation capabilities. It implements reverse-mode automatic differentiation using a tape-based approach, which records operations during forward passes and replays them during backpropagation. The library supports both CPU and GPU computation, with particular emphasis on NVIDIA CUDA acceleration, while also supporting AMD ROCm and Intel GPU platforms. Common applications include deep learning research, scientific computing as a NumPy alternative, and production deployment of neural network models through its JIT compilation system.
Dynamic Computation Graphs
Tape-based autograd records operations at runtime, allowing network architectures to change between iterations without recompilation. Build conditional models with native Python control flow instead of framework-specific graph construction APIs.
Python-Native Execution Model
Imperative execution semantics mean tensors behave like NumPy arrays with standard Python debugging tools. Step through code with pdb, inspect tensors at any point, and iterate without separate compilation phases.
Unified Multi-GPU Backend
Provides seamless distributed training across multiple GPUs with automatic memory management and gradient synchronization. Scale from single GPU to multi-node clusters with minimal code changes using built-in parallelism primitives.
import torch
# Create tensors and perform operations
x = torch.tensor([[1.0, 2.0], [3.0, 4.0]])
y = torch.tensor([[5.0, 6.0], [7.0, 8.0]])
# Matrix multiplication and addition
result = torch.matmul(x, y) + 10
print(result)See how people are using PyTorch
Top in AI & ML
Related Repositories
Discover similar tools and frameworks used by developers
Text Generation WebUI
Gradio-based UI for running LLMs locally with multiple model format and extension support.
StabilityMatrix
Multi-backend inference UI manager with embedded dependencies.
tiktoken
Fast BPE tokenizer for OpenAI language models.
ComfyUI
Visual graph-based diffusion model workflow builder.
Ultralytics YOLO
PyTorch library for YOLO-based real-time computer vision.