.. _sphx_glr_recipes_recipes: PyTorch Recipes --------------------------------------------- 1. defining_a_neural_network.py Defining a Neural Network in PyTorch https://pytorch.org/tutorials/recipes/recipes/defining_a_neural_network.html 2. what_is_state_dict.py What is a state_dict in PyTorch https://pytorch.org/tutorials/recipes/recipes/what_is_state_dict.html 3. saving_and_loading_models_for_inference.py Saving and loading models for inference in PyTorch https://pytorch.org/tutorials/recipes/recipes/saving_and_loading_models_for_inference.html 4. custom_dataset_transforms_loader.py Developing Custom PyTorch Dataloaders https://pytorch.org/tutorials/recipes/recipes/custom_dataset_transforms_loader.html 5. Captum_Recipe.py Model Interpretability using Captum https://pytorch.org/tutorials/recipes/recipes/Captum_Recipe.html 6. dynamic_quantization.py Dynamic Quantization https://pytorch.org/tutorials/recipes/recipes/dynamic_quantization.html 7. warmstarting_model_using_parameters_from_a_different_model.py Warmstarting models using parameters from different model https://pytorch.org/tutorials/recipes/recipes/warmstarting_model_using_parameters_from_a_different_model.html 8. zeroing_out_gradients.py Zeroing out gradients https://pytorch.org/tutorials/recipes/recipes/zeroing_out_gradients.html 9. mobile_perf.py PyTorch Mobile Performance Recipes https://pytorch.org/tutorials/recipes/mobile_perf.html 10. amp_recipe.py Automatic Mixed Precision https://pytorch.org/tutorials/recipes/amp_recipe.html 11. regional_compilation.py Reducing torch.compile cold start compilation time with regional compilation https://pytorch.org/tutorials/recipes/regional_compilation.html .. raw:: html
.. thumbnail-parent-div-open .. raw:: html
.. only:: html .. image:: /recipes/recipes/images/thumb/sphx_glr_tuning_guide_thumb.png :alt: :ref:`sphx_glr_recipes_recipes_tuning_guide.py` .. raw:: html
Performance Tuning Guide
.. raw:: html
.. only:: html .. image:: /recipes/recipes/images/thumb/sphx_glr_changing_default_device_thumb.png :alt: :ref:`sphx_glr_recipes_recipes_changing_default_device.py` .. raw:: html
Changing default device
.. raw:: html
.. only:: html .. image:: /recipes/recipes/images/thumb/sphx_glr_tensorboard_with_pytorch_thumb.png :alt: :ref:`sphx_glr_recipes_recipes_tensorboard_with_pytorch.py` .. raw:: html
How to use TensorBoard with PyTorch
.. raw:: html
.. only:: html .. image:: /recipes/recipes/images/thumb/sphx_glr_what_is_state_dict_thumb.png :alt: :ref:`sphx_glr_recipes_recipes_what_is_state_dict.py` .. raw:: html
What is a state_dict in PyTorch
.. raw:: html
.. only:: html .. image:: /recipes/recipes/images/thumb/sphx_glr_warmstarting_model_using_parameters_from_a_different_model_thumb.png :alt: :ref:`sphx_glr_recipes_recipes_warmstarting_model_using_parameters_from_a_different_model.py` .. raw:: html
Warmstarting model using parameters from a different model in PyTorch
.. raw:: html
.. only:: html .. image:: /recipes/recipes/images/thumb/sphx_glr_reasoning_about_shapes_thumb.png :alt: :ref:`sphx_glr_recipes_recipes_reasoning_about_shapes.py` .. raw:: html
Reasoning about Shapes in PyTorch
.. raw:: html
.. only:: html .. image:: /recipes/recipes/images/thumb/sphx_glr_module_load_state_dict_tips_thumb.png :alt: :ref:`sphx_glr_recipes_recipes_module_load_state_dict_tips.py` .. raw:: html
Tips for Loading an nn.Module from a Checkpoint
.. raw:: html
.. only:: html .. image:: /recipes/recipes/images/thumb/sphx_glr_defining_a_neural_network_thumb.png :alt: :ref:`sphx_glr_recipes_recipes_defining_a_neural_network.py` .. raw:: html
Defining a Neural Network in PyTorch
.. raw:: html
.. only:: html .. image:: /recipes/recipes/images/thumb/sphx_glr_zeroing_out_gradients_thumb.png :alt: :ref:`sphx_glr_recipes_recipes_zeroing_out_gradients.py` .. raw:: html
Zeroing out gradients in PyTorch
.. raw:: html
.. only:: html .. image:: /recipes/recipes/images/thumb/sphx_glr_timer_quick_start_thumb.png :alt: :ref:`sphx_glr_recipes_recipes_timer_quick_start.py` .. raw:: html
Timer quick start
.. raw:: html
.. only:: html .. image:: /recipes/recipes/images/thumb/sphx_glr_Captum_Recipe_thumb.png :alt: :ref:`sphx_glr_recipes_recipes_Captum_Recipe.py` .. raw:: html
Model Interpretability using Captum
.. raw:: html
.. only:: html .. image:: /recipes/recipes/images/thumb/sphx_glr_swap_tensors_thumb.png :alt: :ref:`sphx_glr_recipes_recipes_swap_tensors.py` .. raw:: html
Extension points in nn.Module for load_state_dict and tensor subclasses
.. raw:: html
.. only:: html .. image:: /recipes/recipes/images/thumb/sphx_glr_profiler_recipe_thumb.png :alt: :ref:`sphx_glr_recipes_recipes_profiler_recipe.py` .. raw:: html
PyTorch Profiler
.. raw:: html
.. only:: html .. image:: /recipes/recipes/images/thumb/sphx_glr_amp_recipe_thumb.png :alt: :ref:`sphx_glr_recipes_recipes_amp_recipe.py` .. raw:: html
Automatic Mixed Precision
.. raw:: html
.. only:: html .. image:: /recipes/recipes/images/thumb/sphx_glr_benchmark_thumb.png :alt: :ref:`sphx_glr_recipes_recipes_benchmark.py` .. raw:: html
PyTorch Benchmark
.. thumbnail-parent-div-close .. raw:: html
.. toctree:: :hidden: /recipes/recipes/tuning_guide /recipes/recipes/changing_default_device /recipes/recipes/tensorboard_with_pytorch /recipes/recipes/what_is_state_dict /recipes/recipes/warmstarting_model_using_parameters_from_a_different_model /recipes/recipes/reasoning_about_shapes /recipes/recipes/module_load_state_dict_tips /recipes/recipes/defining_a_neural_network /recipes/recipes/zeroing_out_gradients /recipes/recipes/timer_quick_start /recipes/recipes/Captum_Recipe /recipes/recipes/swap_tensors /recipes/recipes/profiler_recipe /recipes/recipes/amp_recipe /recipes/recipes/benchmark