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
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;
}