Fix documentation (#15372)
authorBenoit Rostykus <brostykus@netflix.com>
Wed, 19 Dec 2018 22:55:37 +0000 (14:55 -0800)
committerFacebook Github Bot <facebook-github-bot@users.noreply.github.com>
Wed, 19 Dec 2018 23:04:24 +0000 (15:04 -0800)
Summary:
Current documentation example doesn't compile. This fixes the doc so the example works.
Pull Request resolved: https://github.com/pytorch/pytorch/pull/15372

Differential Revision: D13522167

Pulled By: goldsborough

fbshipit-source-id: 5171a5f8e165eafabd9d1a28d23020bf2655f38b

docs/cpp/source/frontend.rst

index 5855c3e..545b772 100644 (file)
@@ -53,7 +53,7 @@ neural network on the MNIST dataset:
     torch::Tensor forward(torch::Tensor x) {
       // Use one of many tensor manipulation functions.
       x = torch::relu(fc1->forward(x));
-      x = torch::dropout(x, /*p=*/0.5);
+      x = torch::dropout(x, /*p=*/0.5, /*train=*/true);
       x = torch::sigmoid(fc2->forward(x));
       return x;
     }