prompt: We are currently solving the following issue within our repository. Here is the issue text:
  --- BEGIN ISSUE ---
  Dropout documentation is incorrect
  "Randomly zeroes some of the elements of the input tensor. The elements to zero are randomized on every forward call."
  
  This is incorrect; the function also scales up by 1/(1-p), which the implementation correctly does.
  
  --- END ISSUE ---
  
  Below are some code segments, each from a relevant file. One or more of these files may contain bugs.
  --- BEGIN FILES ---
  Path: `torch/nn/modules/dropout.py`
  Content:
  ```
  1 from .module import Module
  2 from .. import functional as F
  3 
  4 
  5 class Dropout(Module):
  6     r"""Randomly zeroes some of the elements of the input tensor.
  7     The elements to zero are randomized on every forward call.
  8 
  9     Args:
  10         p: probability of an element to be zeroed. Default: 0.5
  11         inplace: If set to True, will do this operation in-place. Default: false
  12 
  13     Shape:
  14         - Input: `Any`. Input can be of any shape
  15         - Output: `Same`. Output is of the same shape as input
  16 
  17     Examples::
  18 
  19         >>> m = nn.Dropout(p=0.2)
  20         >>> input = autograd.Variable(torch.randn(20, 16))
  21         >>> output = m(input)
  22     """
  23 
  24     def __init__(self, p=0.5, inplace=False):
  25         super(Dropout, self).__init__()
  26         if p < 0 or p > 1:
  27             raise ValueError("dropout probability has to be between 0 and 1, "
  28                              "but got {}".format(p))
  29         self.p = p
  30         self.inplace = inplace
  31 
  32     def forward(self, input):
  33         return F.dropout(input, self.p, self.training, self.inplace)
  34 
  35     def __repr__(self):
  36         inplace_str = ', inplace' if self.inplace else ''
  37         return self.__class__.__name__ + ' (' \
  38             + 'p = ' + str(self.p) \
  39             + inplace_str + ')'
  40 
  41 
  42 class Dropout2d(Module):
  43     r"""Randomly zeroes whole channels of the input tensor.
  44     The channels to zero-out are randomized on every forward call.
  45 
  46     *Usually the input comes from Conv2d modules.*
  47 
  48     As described in the paper
  49     `Efficient Object Localization Using Convolutional Networks`_ ,
  50     if adjacent pixels within feature maps are strongly correlated
  51     (as is normally the case in early convolution layers) then iid dropout
  52     will not regularize the activations and will otherwise just result
  53     in an effective learning rate decrease.
  54 
  55     In this case, :func:`nn.Dropout2d` will help promote independence between
  56     feature maps and should be used instead.
  57 
  58     Args:
  59         p (float, optional): probability of an element to be zeroed.
  60         inplace (bool, optional): If set to True, will do this operation in-place
  61 
  62     Shape:
  63         - Input: :math:`(N, C, H, W)`
  64         - Output: :math:`(N, C, H, W)` (same shape as input)
  65 
  66     Examples::
  67 
  68         >>> m = nn.Dropout2d(p=0.2)
  69         >>> input = autograd.Variable(torch.randn(20, 16, 32, 32))
  70         >>> output = m(input)
  71 
  72     .. _Efficient Object Localization Using Convolutional Networks:
  73        http://arxiv.org/abs/1411.4280
  74     """
  75 
  76     def __init__(self, p=0.5, inplace=False):
  77         super(Dropout2d, self).__init__()
  78         if p < 0 or p > 1:
  79             raise ValueError("dropout probability has to be between 0 and 1, "
  80                              "but got {}".format(p))
  81         self.p = p
  82         self.inplace = inplace
  83 
  84     def forward(self, input):
  85         return self._backend.Dropout2d(self.p, self.training, self.inplace)(input)
  86 
  87     def __repr__(self):
  88         inplace_str = ', inplace' if self.inplace else ''
  89         return self.__class__.__name__ + ' (' \
  90             + 'p=' + str(self.p) \
  91             + inplace_str + ')'
  92 
  93 
  94 class Dropout3d(Module):
  95     r"""Randomly zeroes whole channels of the input tensor.
  96     The channels to zero are randomized on every forward call.
  97 
  98     *Usually the input comes from Conv3d modules.*
  99 
  100     As described in the paper
  101     `Efficient Object Localization Using Convolutional Networks`_ ,
  102     if adjacent pixels within feature maps are strongly correlated
  103     (as is normally the case in early convolution layers) then iid dropout
  104     will not regularize the activations and will otherwise just result
  105     in an effective learning rate decrease.
  106 
  107     In this case, :func:`nn.Dropout3d` will help promote independence between
  108     feature maps and should be used instead.
  109 
  110     Args:
  111         p (float, optional): probability of an element to be zeroed.
  112         inplace (bool, optional): If set to True, will do this operation in-place
  113 
  114     Shape:
  115         - Input: :math:`(N, C, D, H, W)`
  116         - Output: :math:`(N, C, D, H, W)` (same shape as input)
  117 
  118     Examples::
  119 
  120         >>> m = nn.Dropout3d(p=0.2)
  121         >>> input = autograd.Variable(torch.randn(20, 16, 4, 32, 32))
  122         >>> output = m(input)
  123 
  124     .. _Efficient Object Localization Using Convolutional Networks:
  125        http://arxiv.org/abs/1411.4280
  126     """
  127 
  128     def __init__(self, p=0.5, inplace=False):
  129         super(Dropout3d, self).__init__()
  130         if p < 0 or p > 1:
  131             raise ValueError("dropout probability has to be between 0 and 1, "
  132                              "but got {}".format(p))
  133         self.p = p
  134         self.inplace = inplace
  135 
  136     def forward(self, input):
  137         return self._backend.Dropout3d(self.p, self.training, self.inplace)(input)
  138 
  139     def __repr__(self):
  140         inplace_str = ', inplace' if self.inplace else ''
  141         return self.__class__.__name__ + ' (' \
  142             + 'p=' + str(self.p) \
  143             + inplace_str + ')'
  144
  ```
  --- END FILES ---
  
  Please first localize the bug based on the issue statement, and then generate a patch according to the `git diff` format fenced by three backticks.
  
  Here is an example:
  
  ```diff
  diff --git a/examples/server_async.py b/examples/server_async.py
  --- a/examples/server_async.py
  +++ b/examples/server_async.py
  @@ -313,4 +313,4 @@
   
   
   if __name__ == "__main__":
  -    asyncio.run(run_async_server("."), debug=True)
  +    asyncio.run(run_async_server(), debug=True)
  diff --git a/examples/server_sync.py b/examples/server_sync.py
  --- a/examples/server_sync.py
  +++ b/examples/server_sync.py
  @@ -313,5 +313,5 @@
   
   
   if __name__ == "__main__":
  -    server = run_sync_server(".")
  +    server = run_sync_server()
       server.shutdown()
  
  ```
  
golden_diff: diff --git a/torch/nn/modules/dropout.py b/torch/nn/modules/dropout.py
  --- a/torch/nn/modules/dropout.py
  +++ b/torch/nn/modules/dropout.py
  @@ -3,9 +3,19 @@
   
   
   class Dropout(Module):
  -    r"""Randomly zeroes some of the elements of the input tensor.
  +    r"""During training, randomly zeroes some of the elements of the input
  +    tensor with probability *p* using samples from a bernoulli distribution.
       The elements to zero are randomized on every forward call.
   
  +    This has proven to be an effective technique for regularization and
  +    preventing the co-adaptation of neurons as described in the paper
  +    `Improving neural networks by preventing co-adaptation of feature
  +    detectors`_ .
  +
  +    Furthermore, the outputs are scaled by a factor of *1/(1-p)* during
  +    training. This means that during evaluation the module simply computes an
  +    identity function.
  +
       Args:
           p: probability of an element to be zeroed. Default: 0.5
           inplace: If set to True, will do this operation in-place. Default: false
  @@ -19,6 +29,8 @@
           >>> m = nn.Dropout(p=0.2)
           >>> input = autograd.Variable(torch.randn(20, 16))
           >>> output = m(input)
  +
  +    .. _Improving neural networks by preventing co-adaptation of feature detectors: https://arxiv.org/abs/1207.0580
       """
   
       def __init__(self, p=0.5, inplace=False):
  
verification_info: {"golden_diff": "diff --git a/torch/nn/modules/dropout.py b/torch/nn/modules/dropout.py\n--- a/torch/nn/modules/dropout.py\n+++ b/torch/nn/modules/dropout.py\n@@ -3,9 +3,19 @@\n \n \n class Dropout(Module):\n-    r\"\"\"Randomly zeroes some of the elements of the input tensor.\n+    r\"\"\"During training, randomly zeroes some of the elements of the input\n+    tensor with probability *p* using samples from a bernoulli distribution.\n     The elements to zero are randomized on every forward call.\n \n+    This has proven to be an effective technique for regularization and\n+    preventing the co-adaptation of neurons as described in the paper\n+    `Improving neural networks by preventing co-adaptation of feature\n+    detectors`_ .\n+\n+    Furthermore, the outputs are scaled by a factor of *1/(1-p)* during\n+    training. This means that during evaluation the module simply computes an\n+    identity function.\n+\n     Args:\n         p: probability of an element to be zeroed. Default: 0.5\n         inplace: If set to True, will do this operation in-place. Default: false\n@@ -19,6 +29,8 @@\n         >>> m = nn.Dropout(p=0.2)\n         >>> input = autograd.Variable(torch.randn(20, 16))\n         >>> output = m(input)\n+\n+    .. _Improving neural networks by preventing co-adaptation of feature detectors: https://arxiv.org/abs/1207.0580\n     \"\"\"\n \n     def __init__(self, p=0.5, inplace=False):\n", "issue": "Dropout documentation is incorrect\n\"Randomly zeroes some of the elements of the input tensor. The elements to zero are randomized on every forward call.\"\r\n\r\nThis is incorrect; the function also scales up by 1/(1-p), which the implementation correctly does.\n", "before_files": [{"content": "from .module import Module\nfrom .. import functional as F\n\n\nclass Dropout(Module):\n    r\"\"\"Randomly zeroes some of the elements of the input tensor.\n    The elements to zero are randomized on every forward call.\n\n    Args:\n        p: probability of an element to be zeroed. Default: 0.5\n        inplace: If set to True, will do this operation in-place. Default: false\n\n    Shape:\n        - Input: `Any`. Input can be of any shape\n        - Output: `Same`. Output is of the same shape as input\n\n    Examples::\n\n        >>> m = nn.Dropout(p=0.2)\n        >>> input = autograd.Variable(torch.randn(20, 16))\n        >>> output = m(input)\n    \"\"\"\n\n    def __init__(self, p=0.5, inplace=False):\n        super(Dropout, self).__init__()\n        if p < 0 or p > 1:\n            raise ValueError(\"dropout probability has to be between 0 and 1, \"\n                             \"but got {}\".format(p))\n        self.p = p\n        self.inplace = inplace\n\n    def forward(self, input):\n        return F.dropout(input, self.p, self.training, self.inplace)\n\n    def __repr__(self):\n        inplace_str = ', inplace' if self.inplace else ''\n        return self.__class__.__name__ + ' (' \\\n            + 'p = ' + str(self.p) \\\n            + inplace_str + ')'\n\n\nclass Dropout2d(Module):\n    r\"\"\"Randomly zeroes whole channels of the input tensor.\n    The channels to zero-out are randomized on every forward call.\n\n    *Usually the input comes from Conv2d modules.*\n\n    As described in the paper\n    `Efficient Object Localization Using Convolutional Networks`_ ,\n    if adjacent pixels within feature maps are strongly correlated\n    (as is normally the case in early convolution layers) then iid dropout\n    will not regularize the activations and will otherwise just result\n    in an effective learning rate decrease.\n\n    In this case, :func:`nn.Dropout2d` will help promote independence between\n    feature maps and should be used instead.\n\n    Args:\n        p (float, optional): probability of an element to be zeroed.\n        inplace (bool, optional): If set to True, will do this operation in-place\n\n    Shape:\n        - Input: :math:`(N, C, H, W)`\n        - Output: :math:`(N, C, H, W)` (same shape as input)\n\n    Examples::\n\n        >>> m = nn.Dropout2d(p=0.2)\n        >>> input = autograd.Variable(torch.randn(20, 16, 32, 32))\n        >>> output = m(input)\n\n    .. _Efficient Object Localization Using Convolutional Networks:\n       http://arxiv.org/abs/1411.4280\n    \"\"\"\n\n    def __init__(self, p=0.5, inplace=False):\n        super(Dropout2d, self).__init__()\n        if p < 0 or p > 1:\n            raise ValueError(\"dropout probability has to be between 0 and 1, \"\n                             \"but got {}\".format(p))\n        self.p = p\n        self.inplace = inplace\n\n    def forward(self, input):\n        return self._backend.Dropout2d(self.p, self.training, self.inplace)(input)\n\n    def __repr__(self):\n        inplace_str = ', inplace' if self.inplace else ''\n        return self.__class__.__name__ + ' (' \\\n            + 'p=' + str(self.p) \\\n            + inplace_str + ')'\n\n\nclass Dropout3d(Module):\n    r\"\"\"Randomly zeroes whole channels of the input tensor.\n    The channels to zero are randomized on every forward call.\n\n    *Usually the input comes from Conv3d modules.*\n\n    As described in the paper\n    `Efficient Object Localization Using Convolutional Networks`_ ,\n    if adjacent pixels within feature maps are strongly correlated\n    (as is normally the case in early convolution layers) then iid dropout\n    will not regularize the activations and will otherwise just result\n    in an effective learning rate decrease.\n\n    In this case, :func:`nn.Dropout3d` will help promote independence between\n    feature maps and should be used instead.\n\n    Args:\n        p (float, optional): probability of an element to be zeroed.\n        inplace (bool, optional): If set to True, will do this operation in-place\n\n    Shape:\n        - Input: :math:`(N, C, D, H, W)`\n        - Output: :math:`(N, C, D, H, W)` (same shape as input)\n\n    Examples::\n\n        >>> m = nn.Dropout3d(p=0.2)\n        >>> input = autograd.Variable(torch.randn(20, 16, 4, 32, 32))\n        >>> output = m(input)\n\n    .. _Efficient Object Localization Using Convolutional Networks:\n       http://arxiv.org/abs/1411.4280\n    \"\"\"\n\n    def __init__(self, p=0.5, inplace=False):\n        super(Dropout3d, self).__init__()\n        if p < 0 or p > 1:\n            raise ValueError(\"dropout probability has to be between 0 and 1, \"\n                             \"but got {}\".format(p))\n        self.p = p\n        self.inplace = inplace\n\n    def forward(self, input):\n        return self._backend.Dropout3d(self.p, self.training, self.inplace)(input)\n\n    def __repr__(self):\n        inplace_str = ', inplace' if self.inplace else ''\n        return self.__class__.__name__ + ' (' \\\n            + 'p=' + str(self.p) \\\n            + inplace_str + ')'\n", "path": "torch/nn/modules/dropout.py"}], "after_files": [{"content": "from .module import Module\nfrom .. import functional as F\n\n\nclass Dropout(Module):\n    r\"\"\"During training, randomly zeroes some of the elements of the input\n    tensor with probability *p* using samples from a bernoulli distribution.\n    The elements to zero are randomized on every forward call.\n\n    This has proven to be an effective technique for regularization and\n    preventing the co-adaptation of neurons as described in the paper\n    `Improving neural networks by preventing co-adaptation of feature\n    detectors`_ .\n\n    Furthermore, the outputs are scaled by a factor of *1/(1-p)* during\n    training. This means that during evaluation the module simply computes an\n    identity function.\n\n    Args:\n        p: probability of an element to be zeroed. Default: 0.5\n        inplace: If set to True, will do this operation in-place. Default: false\n\n    Shape:\n        - Input: `Any`. Input can be of any shape\n        - Output: `Same`. Output is of the same shape as input\n\n    Examples::\n\n        >>> m = nn.Dropout(p=0.2)\n        >>> input = autograd.Variable(torch.randn(20, 16))\n        >>> output = m(input)\n\n    .. _Improving neural networks by preventing co-adaptation of feature detectors: https://arxiv.org/abs/1207.0580\n    \"\"\"\n\n    def __init__(self, p=0.5, inplace=False):\n        super(Dropout, self).__init__()\n        if p < 0 or p > 1:\n            raise ValueError(\"dropout probability has to be between 0 and 1, \"\n                             \"but got {}\".format(p))\n        self.p = p\n        self.inplace = inplace\n\n    def forward(self, input):\n        return F.dropout(input, self.p, self.training, self.inplace)\n\n    def __repr__(self):\n        inplace_str = ', inplace' if self.inplace else ''\n        return self.__class__.__name__ + ' (' \\\n            + 'p = ' + str(self.p) \\\n            + inplace_str + ')'\n\n\nclass Dropout2d(Module):\n    r\"\"\"Randomly zeroes whole channels of the input tensor.\n    The channels to zero-out are randomized on every forward call.\n\n    *Usually the input comes from Conv2d modules.*\n\n    As described in the paper\n    `Efficient Object Localization Using Convolutional Networks`_ ,\n    if adjacent pixels within feature maps are strongly correlated\n    (as is normally the case in early convolution layers) then iid dropout\n    will not regularize the activations and will otherwise just result\n    in an effective learning rate decrease.\n\n    In this case, :func:`nn.Dropout2d` will help promote independence between\n    feature maps and should be used instead.\n\n    Args:\n        p (float, optional): probability of an element to be zeroed.\n        inplace (bool, optional): If set to True, will do this operation in-place\n\n    Shape:\n        - Input: :math:`(N, C, H, W)`\n        - Output: :math:`(N, C, H, W)` (same shape as input)\n\n    Examples::\n\n        >>> m = nn.Dropout2d(p=0.2)\n        >>> input = autograd.Variable(torch.randn(20, 16, 32, 32))\n        >>> output = m(input)\n\n    .. _Efficient Object Localization Using Convolutional Networks:\n       http://arxiv.org/abs/1411.4280\n    \"\"\"\n\n    def __init__(self, p=0.5, inplace=False):\n        super(Dropout2d, self).__init__()\n        if p < 0 or p > 1:\n            raise ValueError(\"dropout probability has to be between 0 and 1, \"\n                             \"but got {}\".format(p))\n        self.p = p\n        self.inplace = inplace\n\n    def forward(self, input):\n        return self._backend.Dropout2d(self.p, self.training, self.inplace)(input)\n\n    def __repr__(self):\n        inplace_str = ', inplace' if self.inplace else ''\n        return self.__class__.__name__ + ' (' \\\n            + 'p=' + str(self.p) \\\n            + inplace_str + ')'\n\n\nclass Dropout3d(Module):\n    r\"\"\"Randomly zeroes whole channels of the input tensor.\n    The channels to zero are randomized on every forward call.\n\n    *Usually the input comes from Conv3d modules.*\n\n    As described in the paper\n    `Efficient Object Localization Using Convolutional Networks`_ ,\n    if adjacent pixels within feature maps are strongly correlated\n    (as is normally the case in early convolution layers) then iid dropout\n    will not regularize the activations and will otherwise just result\n    in an effective learning rate decrease.\n\n    In this case, :func:`nn.Dropout3d` will help promote independence between\n    feature maps and should be used instead.\n\n    Args:\n        p (float, optional): probability of an element to be zeroed.\n        inplace (bool, optional): If set to True, will do this operation in-place\n\n    Shape:\n        - Input: :math:`(N, C, D, H, W)`\n        - Output: :math:`(N, C, D, H, W)` (same shape as input)\n\n    Examples::\n\n        >>> m = nn.Dropout3d(p=0.2)\n        >>> input = autograd.Variable(torch.randn(20, 16, 4, 32, 32))\n        >>> output = m(input)\n\n    .. _Efficient Object Localization Using Convolutional Networks:\n       http://arxiv.org/abs/1411.4280\n    \"\"\"\n\n    def __init__(self, p=0.5, inplace=False):\n        super(Dropout3d, self).__init__()\n        if p < 0 or p > 1:\n            raise ValueError(\"dropout probability has to be between 0 and 1, \"\n                             \"but got {}\".format(p))\n        self.p = p\n        self.inplace = inplace\n\n    def forward(self, input):\n        return self._backend.Dropout3d(self.p, self.training, self.inplace)(input)\n\n    def __repr__(self):\n        inplace_str = ', inplace' if self.inplace else ''\n        return self.__class__.__name__ + ' (' \\\n            + 'p=' + str(self.p) \\\n            + inplace_str + ')'\n", "path": "torch/nn/modules/dropout.py"}]}