# Feature catalog — pytorch/pytorch

> Canonical page: https://codevetter.com/unpack/pytorch/feature-catalog

# Feature catalog — pytorch/pytorch

Scanned commit 5711f1a4586cb0a3dbb3d67538df814db48f94f4 (2026-09-22). Generated by codevetter codevetter 1.12.0 on 2026-09-22.

User-facing surface is huge: eager tensor ops bound from _VariableFunctions, the nn.Module/optim training stack, tape-based autograd, torch.compile (Dynamo+Inductor), torch.export and legacy TorchScript for graph capture, torch.distributed with pluggable collectives backends plus the torchrun elastic launcher, checkpointing via torch.save/load, data loading and multiprocessing helpers, quantization/sparse/fft/linalg/profiler subpackages, and C++ extension authoring via cpp_extension. New features typically surface either as torch.* functions (codegen-bound aten ops) or as subpackage imports in torch/__init__.py.
- Eager tensor ops are exposed by copying every member of _C._VariableFunctions into the torch namespace at import (PRIVATE_OPS like unique_dim are skipped; __all__ is extended for non-underscore names). — [torch/__init__.py#L2618-2645](https://github.com/pytorch/pytorch/blob/5711f1a4586cb0a3dbb3d67538df814db48f94f4/torch/__init__.py#L2618-L2645)
- torch.nn.Module is the model base class providing parameters(), state_dict()/load_state_dict(), and the __call__ -> forward dispatch used by all neural network code. — [torch/nn/modules/module.py#L407](https://github.com/pytorch/pytorch/blob/5711f1a4586cb0a3dbb3d67538df814db48f94f4/torch/nn/modules/module.py#L407) [torch/nn/modules/module.py#L2185-2539](https://github.com/pytorch/pytorch/blob/5711f1a4586cb0a3dbb3d67538df814db48f94f4/torch/nn/modules/module.py#L2185-L2539)
- torch.autograd.backward() and torch.autograd.grad() drive the tape-based engine: backward validates inputs, handles __torch_function__ overrides, builds grad tensors via _make_grads, then calls _engine_run_backward which invokes Variable._execution_engine.run_backward in C++. — [torch/autograd/__init__.py#L255-403](https://github.com/pytorch/pytorch/blob/5711f1a4586cb0a3dbb3d67538df814db48f94f4/torch/autograd/__init__.py#L255-L403) [torch/autograd/graph.py#L1100-1123](https://github.com/pytorch/pytorch/blob/5711f1a4586cb0a3dbb3d67538df814db48f94f4/torch/autograd/graph.py#L1100-L1123)
- torch.compile(model, fullgraph=, backend=, mode=, options=, dynamic=, recompile_limit=, isolate_recompiles=, dynamic_shapes=) is the JIT entry point: it wraps the backend string (default inductor) in _TorchCompileInductorWrapper/_TorchCompileWrapper and returns torch._dynamo.optimize(...)(model). — [torch/__init__.py#L3094-3338](https://github.com/pytorch/pytorch/blob/5711f1a4586cb0a3dbb3d67538df814db48f94f4/torch/__init__.py#L3094-L3338)
- compile modes are "default", "reduce-overhead" (CUDA graphs), "max-autotune" and "max-autotune-no-cudagraphs"; options keys include epilogue_fusion, max_autotune, fallback_random, shape_padding, triton.cudagraphs, trace.enabled and guard_filter_fn. — [torch/__init__.py#L3152-3196](https://github.com/pytorch/pytorch/blob/5711f1a4586cb0a3dbb3d67538df814db48f94f4/torch/__init__.py#L3152-L3196)
- torch.export.export()/save()/load() provide AoT graph capture producing ExportedPrograms; torch.compile is explicitly a no-op inside an export region. — [torch/export/__init__.py#L59-266](https://github.com/pytorch/pytorch/blob/5711f1a4586cb0a3dbb3d67538df814db48f94f4/torch/export/__init__.py#L59-L266) [torch/__init__.py#L3310-3319](https://github.com/pytorch/pytorch/blob/5711f1a4586cb0a3dbb3d67538df814db48f94f4/torch/__init__.py#L3310-L3319)
- TorchScript lives on via torch.jit (torch/jit/_script.py) and mobile .ptl artifacts; SECURITY.md treats them as executable code requiring trust. — [torch/jit/_script.py](https://github.com/pytorch/pytorch/blob/5711f1a4586cb0a3dbb3d67538df814db48f94f4/torch/jit/_script.py) [SECURITY.md#L59-63](https://github.com/pytorch/pytorch/blob/5711f1a4586cb0a3dbb3d67538df814db48f94f4/SECURITY.md#L59-L63)
- torch.distributed.init_process_group supports gloo/nccl/mpi/ucc/xccl and third-party backends, auto-selecting nccl for cuda, gloo for cpu, xccl for xpu when backend is omitted; collectives run over a Store established by rendezvous or init_method URL. — [torch/distributed/distributed_c10d.py#L2370-2472](https://github.com/pytorch/pytorch/blob/5711f1a4586cb0a3dbb3d67538df814db48f94f4/torch/distributed/distributed_c10d.py#L2370-L2472)
- torch.save writes a zip container (records: data.pkl, .format_version, .storage_alignment, byteorder, data/<key> storages); torch.load reads it with weights_only=True by default since 2.6, supporting map_location, mmap and a safe-globals allowlist. — [torch/serialization.py#L1184-1313](https://github.com/pytorch/pytorch/blob/5711f1a4586cb0a3dbb3d67538df814db48f94f4/torch/serialization.py#L1184-L1313) [torch/serialization.py#L1316-1445](https://github.com/pytorch/pytorch/blob/5711f1a4586cb0a3dbb3d67538df814db48f94f4/torch/serialization.py#L1316-L1445)
- Accelerator and utility subpackages imported at the end of __init__: cpu, cuda, mps, mtia, xpu, amp, autocast, distributions, fft, linalg, nested, sparse, special, profiler, hub, futures, multiprocessing, optim, nn, ao (quantization), quasirandom, masked. — [torch/__init__.py#L2715-2827](https://github.com/pytorch/pytorch/blob/5711f1a4586cb0a3dbb3d67538df814db48f94f4/torch/__init__.py#L2715-L2827)
- Higher-order and functional transforms (vmap, cond, sym_* operators) are part of the public API listed in torch.__all__. — [torch/__init__.py#L92-165](https://github.com/pytorch/pytorch/blob/5711f1a4586cb0a3dbb3d67538df814db48f94f4/torch/__init__.py#L92-L165)
- Custom C++/CUDA extensions are built JIT via torch.utils.cpp_extension.load()/load_inline() which generate ninja build files and compile into loadable modules. — [torch/utils/cpp_extension.py#L1880-2162](https://github.com/pytorch/pytorch/blob/5711f1a4586cb0a3dbb3d67538df814db48f94f4/torch/utils/cpp_extension.py#L1880-L2162)
- Determinism, dtype and RNG controls are torch-level functions calling into _C setters: use_deterministic_algorithms, set_float32_matmul_precision, set_default_dtype/_tensor_type, manual_seed, get/set_rng_state. — [torch/__init__.py#L1709-2071](https://github.com/pytorch/pytorch/blob/5711f1a4586cb0a3dbb3d67538df814db48f94f4/torch/__init__.py#L1709-L2071)

Every claim links to its cited files at the pinned commit. Citations identify source evidence; they do not establish runtime correctness. Independent CodeVetter scan — not reviewed by upstream maintainers.

## Public product links

- [CodeVetter](https://codevetter.com/)
- [Download](https://codevetter.com/download)
- [Documentation](https://codevetter.com/docs/)
- [Source](https://github.com/Codevetter/codevetter)
