Skip to main content
Ctrl+K
Home
main
  • Installing C++ Distributions of PyTorch
  • The C++ Frontend
  • C++ API Reference
    • ATen: Tensor Library
    • C10: Core Utilities
    • Autograd: Automatic Differentiation
    • CUDA Support
    • XPU Support
    • Neural Network Modules (torch::nn)
    • Optimizers (torch::optim)
    • Data Loading (torch::data)
    • Serialization (torch::serialize)
    • Torch Library API
    • Torch Stable API
  • FAQ
Go to pytorch.org
Ctrl+K
  • X
  • GitHub
  • PyTorch Forum
  • PyPi
main
  • Installing C++ Distributions of PyTorch
  • The C++ Frontend
  • C++ API Reference
    • ATen: Tensor Library
    • C10: Core Utilities
    • Autograd: Automatic Differentiation
    • CUDA Support
    • XPU Support
    • Neural Network Modules (torch::nn)
    • Optimizers (torch::optim)
    • Data Loading (torch::data)
    • Serialization (torch::serialize)
    • Torch Library API
    • Torch Stable API
  • FAQ
Go to pytorch.org
Ctrl+K
  • X
  • GitHub
  • PyTorch Forum
  • PyPi

Section Navigation

Core

  • ATen: Tensor Library
    • Tensor Class
    • Tensor Creation
    • Tensor Indexing
    • Tensor Accessors
  • C10: Core Utilities
    • Device and DeviceType
    • Device Guards
    • Streams
    • Core Types
    • Utilities
  • Autograd: Automatic Differentiation
    • Gradient Computation
    • Custom Autograd Functions
    • Gradient Modes
  • CUDA Support
    • CUDA Streams
    • CUDA Guards
    • CUDA Utility Functions
  • XPU Support
    • XPU Streams
    • XPU Utility Functions

C++ Frontend

  • Neural Network Modules (torch::nn)
    • Containers
    • Convolution Layers
    • Pooling Layers
    • Linear Layers
    • Activation Functions
    • Normalization Layers
    • Dropout Layers
    • Embedding Layers
    • Recurrent Layers
    • Transformer Layers
    • Loss Functions
    • Functional API
    • Utilities
  • Optimizers (torch::optim)
    • Gradient Descent Optimizers
    • Adaptive Learning Rate Optimizers
    • Second-Order Optimizers
    • Learning Rate Schedulers
  • Data Loading (torch::data)
    • Datasets
    • DataLoader
    • Samplers
    • Transforms
  • Serialization (torch::serialize)
    • Saving and Loading
    • Archives
    • Checkpoints

Extensions

  • Torch Library API
    • Operator Registration
    • Custom Classes
    • Library Versioning
  • Torch Stable API
    • Library Registration Macros
    • Stable Operators
    • Utilities
  • C++ API Reference
Rate this Page
★ ★ ★ ★ ★

C++ API Reference#

This section provides reference documentation for the PyTorch C++ API, organized by module.

Core

  • ATen: Tensor Library
    • Header Files
    • ATen Categories
  • C10: Core Utilities
    • Header Files
    • C10 Categories
  • Autograd: Automatic Differentiation
    • Header Files
    • Autograd Categories
  • CUDA Support
    • Header Files
    • CUDA Categories
  • XPU Support
    • Header Files
    • XPU Categories

C++ Frontend

  • Neural Network Modules (torch::nn)
    • Header Files
    • Module Base Class
    • Module Categories
  • Optimizers (torch::optim)
    • Header Files
    • Optimizer Base Class
    • Choosing an Optimizer
    • Optimizer Categories
  • Data Loading (torch::data)
    • Header Files
    • Module Categories
  • Serialization (torch::serialize)
    • Header Files
    • Serialization Categories

Extensions

  • Torch Library API
    • Header Files
    • Library API Categories
    • See Also
  • Torch Stable API
    • Header Files
    • Stable API Categories
    • See Also
Rate this Page
★ ★ ★ ★ ★

previous

The C++ Frontend

next

ATen: Tensor Library

Built with the PyData Sphinx Theme 0.15.4.

previous

The C++ Frontend

next

ATen: Tensor Library

Show Source
PyTorch Libraries
  • ExecuTorch
  • Helion
  • torchao
  • kineto
  • torchtitan
  • TorchRL
  • torchvision
  • torchaudio
  • tensordict
  • PyTorch on XLA Devices

Docs

Access comprehensive developer documentation for PyTorch

View Docs

Tutorials

Get in-depth tutorials for beginners and advanced developers

View Tutorials

Resources

Find development resources and get your questions answered

View Resources

Stay in touch for updates, event info, and the latest news

By submitting this form, I consent to receive marketing emails from the LF and its projects regarding their events, training, research, developments, and related announcements. I understand that I can unsubscribe at any time using the links in the footers of the emails I receive. Privacy Policy.

© PyTorch. Copyright © The Linux Foundation®. All rights reserved. The Linux Foundation has registered trademarks and uses trademarks. For more information, including terms of use, privacy policy, and trademark usage, please see our Policies page. Trademark Usage. Privacy Policy.

To analyze traffic and optimize your experience, we serve cookies on this site. By clicking or navigating, you agree to allow our usage of cookies. As the current maintainers of this site, Facebook’s Cookies Policy applies. Learn more, including about available controls: Cookies Policy.

© Copyright PyTorch Contributors.

Created using Sphinx 7.2.6.

Built with the PyData Sphinx Theme 0.15.4.