Error in creating an offline PDF documentatin for PyTorch
I wanted to make an offline PDF on my system for PyTorch documentation. After reading from several resources  #1, #2, #3
git clone https://github.com/pytorch/pytorch

cd pytorch/docs/

make latexpdf

First two commands are working fine. Third command leads to the following error
Traceback (most recent call last):
  File &quot;source/scripts/build_activation_images.py&quot;, line 70, in &lt;module&gt;
    function = torch.nn.modules.activation.__dict__[function_name]()
KeyError: 'SiLU'

How to overcome this error and make a PDF document of PyTorch?

1.4.0 is the version of PyTorch in my system
print(torch.__version__)
1.4.0

3.8.3 is the version of Python in my system
python -V
Python 3.8.3


The PyTorch version installed in your machine (1.4.0) is older than the one you cloned (most recent). Two ways to fix it:

Checkout to the version you have installed (if you want the doc of 1.4 version):

git clone https://github.com/pytorch/pytorch

# move back to the 1.4 release, which you have installed in your machine
cd pytorch
git checkout release/1.4

cd docs
make latexpdf


Upgrade to the most-recent PyTorch version (if you want the most recent doc):

# upgrade PyTorch to the nightly release (change it accordingly)
python -m pip install --pre torch torchvision torchaudio -f https://download.pytorch.org/whl/nightly/cu102/torch_nightly.html

git clone https://github.com/pytorch/pytorch

cd pytorch/docs/

make latexpdf

