Overview of the PyTorch C++ Frontend
developThe PyTorch C++ frontend is a C++17 library designed for CPU and GPU tensor computation. It provides automatic differentiation and high-level building blocks for machine learning, mirroring the functionality of the Python frontend. It is intended for use cases where the Python interpreter is unsuitable, such as low-latency, high-performance, or highly multithreaded production environments (e.g., video games or production servers).
The frontend consists of several core components:
| Component | Description |
|---|---|
torch::Tensor | Automatically differentiable, efficient CPU and GPU enabled tensors |
torch::nn | A collection of composable modules for neural network modeling |
torch::optim | Optimization algorithms like SGD, Adam or RMSprop to train your models |
torch::data | Datasets, data pipelines and multi-threaded, asynchronous data loader |
torch::serialize | A serialization API for storing and loading model checkpoints |
torch::python | Glue to bind your C++ models into Python |
torch::jit | Pure C++ access to the TorchScript JIT compiler |