Shortcuts

PyTorch Recipes

Recipes are bite-sized bite-sized, actionable examples of how to use specific PyTorch features, different from our full-length tutorials.


Loading data in PyTorch

Learn how to use PyTorch packages to prepare and load common datasets for your model.

Basics

Defining a Neural Network

Learn how to use PyTorch's torch.nn package to create and define a neural network the MNIST dataset.

Basics

What is a state_dict in PyTorch

Learn how state_dict objects, Python dictionaries, are used in saving or loading models from PyTorch.

Basics

Saving and loading models for inference in PyTorch

Learn about the two approaches for saving and loading models for inference in PyTorch - via the state_dict and via the entire model.

Basics

Saving and loading a general checkpoint in PyTorch

Saving and loading a general checkpoint model for inference or resuming training can be helpful for picking up where you last left off. In this recipe, explore how to save and load multiple checkpoints.

Basics

Saving and loading multiple models in one file using PyTorch

In this recipe, learn how saving and loading multiple models can be helpful for reusing models that you have previously trained.

Basics

Docs

Access comprehensive developer documentation for PyTorch

View Docs

Tutorials

Get in-depth tutorials for beginners and advanced developers

View Tutorials

Resources

Find development resources and get your questions answered

View Resources