pytorch / pytorch
Tensors and dynamic neural networks in Python with strong GPU acceleration.
PyTorch is a layered hybrid: a Python surface that users import, sitting on top of a substantial C++ core. The directory layout follows that division closely, separating the tensor library, the low-level core abstractions, and the Python bindings so each layer can be built and tested independently.
- Strict layering, with each language boundary given its own top-level directory.
- Generated binding code produced at build time rather than committed.
- Tests kept in a single top-level directory rather than colocated per module.
Notable Directories
/torchThe Python package users import, including bindings down into the C++ layers.
/atenATen, the C++ tensor library providing the underlying operator implementations.
/c10Core abstractions shared across the codebase, such as device and dtype primitives.
/toolsCode generation and build tooling that stitches the C++ and Python layers together.
Build Your Own Ecosystem
Learn from pytorch's structure and craft your own software scaffolding.