Allow 0-dim batch sizes for AdaptiveMaxPool and MaxPool. (#62088)
authorSameer Deshmukh <sameer.deshmukh93@gmail.com>
Fri, 13 Aug 2021 14:31:42 +0000 (07:31 -0700)
committerFacebook GitHub Bot <facebook-github-bot@users.noreply.github.com>
Fri, 13 Aug 2021 14:33:17 +0000 (07:33 -0700)
commitcb23976f9f304a6db62b612c83aae371a077031f
treee507e45192125e80060f67e2e6746b0e9d7e20e2
parent72bc6dc8c31f977036195536292170ac9132751d
Allow 0-dim batch sizes for AdaptiveMaxPool and MaxPool. (#62088)

Summary:
This issue fixes a part of https://github.com/pytorch/pytorch/issues/12013, which is summarized concretely in  https://github.com/pytorch/pytorch/issues/38115.

This PR allows `MaxPool` and `AdaptiveMaxPool` to accept tensors whose batch size is 0. Some changes have been made to modernize the tests so that they will show the name of C++ function that throws an error.

Pull Request resolved: https://github.com/pytorch/pytorch/pull/62088

Reviewed By: bdhirsh

Differential Revision: D30281285

Pulled By: jbschlosser

fbshipit-source-id: 52bffc67bfe45a78e11e4706b62cce1469eba1b9
aten/src/ATen/native/AdaptiveMaxPooling2d.cpp
aten/src/ATen/native/AdaptiveMaxPooling3d.cpp
aten/src/ATen/native/AveragePool3d.cpp
aten/src/ATen/native/DilatedMaxPool3d.cpp
aten/src/ATen/native/MaxPooling.cpp
aten/src/ATen/native/Pool.h
aten/src/ATen/native/cuda/AdaptiveMaxPooling2d.cu
aten/src/ATen/native/cuda/AdaptiveMaxPooling3d.cu
aten/src/ATen/native/cuda/DilatedMaxPool2d.cu
aten/src/ATen/native/cuda/DilatedMaxPool3d.cu
test/test_nn.py