mirror of
https://github.com/pytorch/pytorch.git
synced 2026-11-20 09:04:25 +08:00
Replace max_pool with max_pool_with_indices (#8892)
* Create max_poolXd_with_indices * Match ATen names in ONNX symbolic
This commit is contained in:
committed by
GitHub
parent
edb88b5f3a
commit
290d20b094
@@ -340,10 +340,10 @@ TEST_CASE("integration/mnist", "[cuda]") {
|
||||
auto linear2 = model->add(Linear(50, 10), "linear2");
|
||||
|
||||
auto forward = [&](torch::Tensor x) {
|
||||
x = std::get<0>(at::max_pool2d(conv1->forward(x), {2, 2})).clamp_min(0);
|
||||
x = at::max_pool2d(conv1->forward(x), {2, 2}).relu();
|
||||
x = conv2->forward(x);
|
||||
x = drop2d->forward(x);
|
||||
x = std::get<0>(at::max_pool2d(x, {2, 2})).clamp_min(0);
|
||||
x = at::max_pool2d(x, {2, 2}).relu();
|
||||
|
||||
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 = std::get<0>(at::max_pool2d(conv1->forward(x), {2, 2})).clamp_min(0);
|
||||
x = at::max_pool2d(conv1->forward(x), {2, 2}).relu();
|
||||
x = batchnorm2d->forward(x);
|
||||
x = conv2->forward(x);
|
||||
x = std::get<0>(at::max_pool2d(x, {2, 2})).clamp_min(0);
|
||||
x = at::max_pool2d(x, {2, 2}).relu();
|
||||
|
||||
x = x.view({-1, 320});
|
||||
x = linear1->forward(x).clamp_min(0);
|
||||
|
||||
Reference in New Issue
Block a user