Dropout.patch 782 B

12345678910111213141516171819202122
  1. --- /usr/local/lib/python3.5/dist-packages/torch/nn/modules/dropout.py
  2. +++ /usr/local/lib/python3.5/dist-packages/torch/nn/modules/dropout.py
  3. @@ -18,8 +18,8 @@
  4. inplace: If set to ``True``, will do this operation in-place. Default: ``False``
  5. Shape:
  6. - - Input: :math:`(*)`. Input can be of any shape
  7. - - Output: :math:`(*)`. Output is of the same shape as input
  8. + - Input: `Any`. Input can be of any shape
  9. + - Output: `Same`. Output is of the same shape as input
  10. Examples::
  11. @@ -31,6 +31,7 @@
  12. detectors: https://arxiv.org/abs/1207.0580
  13. """
  14. - def forward(self, input: Tensor) -> Tensor:
  15. + @weak_script_method
  16. + def forward(self, input):
  17. return F.dropout(input, self.p, self.training, self.inplace)