trunk/3fcba4cbd8240313754258a6ffaf1abc0e098b99: Expose SavedTensor constructor from Python for internal use (#174333)
The framework now exposes a core constructor, enabling custom checkpoint implementations for advanced AI training.
The PyTorch team has merged a significant internal API change (pull request #174333) that exposes the SavedTensor constructor to Python. This allows developers to directly construct SavedVariable objects—PyTorch's mechanism for preserving tensors during backward pass computations—by passing a tensor and a boolean indicating whether it's an inplace output. Previously, this constructor was internal to PyTorch's C++ core. The change, authored with Claude AI and approved by core maintainer albanD, is specifically designed for implementing custom checkpoint APIs where manual management of saved tensors is required, offering more control over memory usage during complex training sequences.
- Exposes the internal SavedTensor constructor to Python for direct SavedVariable creation.
- Enables manual saved tensor management for custom checkpoint implementations, improving control.
- Authored using Claude AI and approved by PyTorch maintainer albanD in PR #174333.
Why It Matters
Gives AI researchers and engineers finer control over memory during training, enabling more efficient custom models.