Repository: pytorch
Issue: torch.distributions.multinomial.Multinomial (an example mistake of docs)?
Labels: module: distributions,module: docs,triaged

### 🐛 Describe the bug

The tutorial example:
[https://pytorch.org/docs/stable/distributions.html#multinomial](url)
`m = Multinomial(100, torch.tensor([ 1., 1., 1., 1.]))`
`x = m.sample()  # equal probability of 0, 1, 2, 3`
`tensor([ 21.,  24.,  30.,  25.])`

`Multinomial(probs=torch.tensor([1., 1., 1., 1.])).log_prob(x)`
`tensor([-4.1338])`

**I met an Error and the value was not  -4.1338, whilst I run this script at local.**

My naive scripts is as:
`import torch`
`from torch.distributions import Multinomial`
`x = torch.tensor([21.0,  24.0,  30.0,  25.0])`
`try:`
  `print(Multinomial(probs=torch.tensor([1., 1., 1., 1.])).log_prob(x))`
`except ValueError:`
  `print('triggle ValueError!')`
`m = Multinomial(100, torch.tensor([ 1., 1., 1., 1.]))`
`x = torch.tensor([21.0,  24.0,  30.0,  25.0])`
`print(m.log_prob(x))`

prints as:
`triggle ValueError! `
`tensor(-7.7168)`

Undoubtly, this example is wrong, and should be modified as:

`m = Multinomial(100, torch.tensor([ 1., 1., 1., 1.]))`
`x = m.sample()  # equal probability of 0, 1, 2, 3`
`tensor([ 21.,  24.,  30.,  25.])`

`m.log_prob(x)`
`tensor(-7.7168)`

### Versions

PyTorch version: 1.10.2
Is debug build: False
CUDA used to build PyTorch: 11.3
ROCM used to build PyTorch: N/A

OS: Ubuntu 20.04.4 LTS (x86_64)
GCC version: (Ubuntu 9.3.0-17ubuntu1~20.04) 9.3.0
Clang version: Could not collect
CMake version: Could not collect
Libc version: glibc-2.31

Python version: 3.9.7 (default, Sep 16 2021, 13:09:58)  [GCC 7.5.0] (64-bit runtime)
Python platform: Linux-5.13.0-30-generic-x86_64-with-glibc2.31
Is CUDA available: True
CUDA runtime version: 10.1.243
GPU models and configuration: GPU 0: NVIDIA GeForce RTX 3070 Laptop GPU
Nvidia driver version: 470.103.01
cuDNN version: Could not collect
HIP runtime version: N/A
MIOpen runtime version: N/A
Is XNNPACK available: True

Versions of relevant libraries:
[pip3] numpy==1.21.2
[pip3] torch==1.10.2
[pip3] torchaudio==0.10.2
[pip3] torchvision==0.11.3
[conda] blas                      1.0                         mkl  
[conda] cudatoolkit               11.3.1               h2bc3f7f_2  
[conda] ffmpeg                    4.3                  hf484d3e_0    pytorch
[conda] mkl                       2021.4.0           h06a4308_640  
[conda] mkl-service               2.4.0            py39h7f8727e_0  
[conda] mkl_fft                   1.3.1            py39hd3c417c_0  
[conda] mkl_random                1.2.2            py39h51133e4_0  
[conda] numpy                     1.21.2           py39h20f2e39_0  
[conda] numpy-base                1.21.2           py39h79a1101_0  
[conda] pytorch                   1.10.2          py3.9_cuda11.3_cudnn8.2.0_0    pytorch
[conda] pytorch-mutex             1.0                        cuda    pytorch
[conda] torchaudio                0.10.2               py39_cu113    pytorch
[conda] torchvision               0.11.3               py39_cu113    pytorch

cc @fritzo @neerajprad @alicanb @nikitaved @brianjo @mruberry