This project aims to provide a faster workflow when using the PyTorch or fastai library in Visual Studio Code.
This extension provides code snippets for often used coding blocks as well as code example provided by the libraries for common deep learning tasks.
If this extension is installed and activated you might notice by start typing pytorch or fastai in your python file a dropdown list appears. Entries starting with pytorch: or fastai: represent code snippets refering to those libraries offered by this extension.
Snippets appear in the same way as code completion by using Ctrl+Space. There are placeholders, variables and choices defined inside the code snippets so you can jump from one to another just by pressing Tab. Examples on how to use this extension are shown below. For a full overview please take a look at the Snippet Collection.
Currently the snippets are working for the latest releases of the supported libraries:
fastai >= 1.0.21
pytorch >= 0.4.1
Be aware that at the time the fastai library is changing rapidly, so I can not guarantee that every snippet is actually working the way it is intended.
I will try to keep the snippets in line with the latest fastai library developments (as well as the latest PyTorch releases), so it might not work for you in case you are using an outdated version.