Skip to content


Switch branches/tags

Name already in use

A tag already exists with the provided branch name. Many Git commands accept both tag and branch names, so creating this branch may cause unexpected behavior. Are you sure you want to create this branch?

Latest commit

Pull Request resolved: #248

Trying to trace a graph that used this Swish function with torchdynamo resulted
in this error:
torch._dynamo.variables.higher_order_ops: [WARNING] speculate_subgraph: while introspecting the user-defined autograd.Function, we were unable to trace function `trampoline_autograd_bwd` into a single graph.
This means that Dynamo was unable to prove safety for this API and will fall back to eager-mode PyTorch, which could lead to a slowdown.
torch._dynamo.exc.Unsupported: call_method GetAttrVariable(AutogradFunctionContextVariable(Function), saved_variables) __getitem__ (ConstantVariable(int),) {}

According to the modern pytorch tutorials, the attribute that should be used from the
autograd context is `saved_tensors` instead, which fixes the trace issue I saw.

I used this website for guidance:

Differential Revision: D49398231

fbshipit-source-id: 3627cd12ba7c3b7e4c4087cdb4125a665c09a039

Git stats


Failed to load latest commit information.
Latest commit message
Commit time

CircleCI CircleCI Coverage

A deep learning library for video understanding research.

Check the website for more information.

A PyTorchVideo-accelerated X3D model running on a Samsung Galaxy S10 phone. The model runs ~8x faster than real time, requiring roughly 130 ms to process one second of video. A PyTorchVideo-based SlowFast model performing video action detection.

X3D model Web Demo

Integrated to Huggingface Spaces with Gradio. See demo: Hugging Face Spaces


PyTorchVideo is a deeplearning library with a focus on video understanding work. PytorchVideo provides reusable, modular and efficient components needed to accelerate the video understanding research. PyTorchVideo is developed using PyTorch and supports different deeplearning video components like video models, video datasets, and video-specific transforms.

Key features include:

  • Based on PyTorch: Built using PyTorch. Makes it easy to use all of the PyTorch-ecosystem components.
  • Reproducible Model Zoo: Variety of state of the art pretrained video models and their associated benchmarks that are ready to use. Complementing the model zoo, PyTorchVideo comes with extensive data loaders supporting different datasets.
  • Efficient Video Components: Video-focused fast and efficient components that are easy to use. Supports accelerated inference on hardware.



Install PyTorchVideo inside a conda environment(Python >=3.7) with

pip install pytorchvideo

For detailed instructions please refer to


PyTorchVideo is released under the Apache 2.0 License.


Get started with PyTorchVideo by trying out one of our tutorials or by running examples in the tutorials folder.

Model Zoo and Baselines

We provide a large set of baseline results and trained models available for download in the PyTorchVideo Model Zoo.


Here is the growing list of PyTorchVideo contributors in alphabetical order (let us know if you would like to be added): Aaron Adcock, Amy Bearman, Bernard Nguyen, Bo Xiong, Chengyuan Yan, Christoph Feichtenhofer, Dave Schnizlein, Haoqi Fan, Heng Wang, Jackson Hamburger, Jitendra Malik, Kalyan Vasudev Alwala, Matt Feiszli, Nikhila Ravi, Ross Girshick, Tullie Murrell, Wan-Yen Lo, Weiyao Wang, Xiaowen Lin, Yanghao Li, Yilei Li, Zhengxing Chen, Zhicheng Yan.


We welcome new contributions to PyTorchVideo and we will be actively maintaining this library! Please refer to for full instructions on how to run the code, tests and linter, and submit your pull requests.

Citing PyTorchVideo

If you find PyTorchVideo useful in your work, please use the following BibTeX entry for citation.

    author =       {Haoqi Fan and Tullie Murrell and Heng Wang and Kalyan Vasudev Alwala and Yanghao Li and Yilei Li and Bo Xiong and Nikhila Ravi and Meng Li and Haichuan Yang and  Jitendra Malik and Ross Girshick and Matt Feiszli and Aaron Adcock and Wan-Yen Lo and Christoph Feichtenhofer},
    title = {{PyTorchVideo}: A Deep Learning Library for Video Understanding},
    booktitle = {Proceedings of the 29th ACM International Conference on Multimedia},
    year = {2021},
    note = {\url{}},