Category: File Formats
Definition
PTH files are PyTorch's native format for saving model weights, architecture definitions, and training states using Python's serialization protocol.
How It Works
PTH files use Python's pickle module to serialize PyTorch tensors and model state dictionaries. They can store complete models or just the learned parameters.
The format supports both eager and scripted PyTorch models, preserving computational graphs when needed.
Why It Matters
As PyTorch's standard format, PTH files are ubiquitous in research and production. They enable easy model sharing within the PyTorch ecosystem and support flexible saving strategies.
Most academic papers using PyTorch distribute their models as PTH files.
← Back to File Formats | All Terms