mirror of
https://github.com/pytorch/pytorch.git
synced 2026-11-20 09:04:25 +08:00
fbshipit-source-id: ba600fcd2b5cefc7621357bdeb05e24cea02e5af
This commit is contained in:
@@ -340,10 +340,10 @@ TEST_CASE("integration/mnist", "[cuda]") {
|
||||
auto linear2 = model->add(Linear(50, 10), "linear2");
|
||||
|
||||
auto forward = [&](torch::Tensor x) {
|
||||
x = at::max_pool2d(conv1->forward(x), {2, 2}).relu();
|
||||
x = std::get<0>(at::max_pool2d(conv1->forward(x), {2, 2})).clamp_min(0);
|
||||
x = conv2->forward(x);
|
||||
x = drop2d->forward(x);
|
||||
x = at::max_pool2d(x, {2, 2}).relu();
|
||||
x = std::get<0>(at::max_pool2d(x, {2, 2})).clamp_min(0);
|
||||
|
||||
x = x.view({-1, 320});
|
||||
x = linear1->forward(x).clamp_min(0);
|
||||
@@ -377,10 +377,10 @@ TEST_CASE("integration/mnist/batchnorm", "[cuda]") {
|
||||
auto linear2 = model->add(Linear(50, 10), "linear2");
|
||||
|
||||
auto forward = [&](torch::Tensor x) {
|
||||
x = at::max_pool2d(conv1->forward(x), {2, 2}).relu();
|
||||
x = std::get<0>(at::max_pool2d(conv1->forward(x), {2, 2})).clamp_min(0);
|
||||
x = batchnorm2d->forward(x);
|
||||
x = conv2->forward(x);
|
||||
x = at::max_pool2d(x, {2, 2}).relu();
|
||||
x = std::get<0>(at::max_pool2d(x, {2, 2})).clamp_min(0);
|
||||
|
||||
x = x.view({-1, 320});
|
||||
x = linear1->forward(x).clamp_min(0);
|
||||
|
||||
Reference in New Issue
Block a user