Allow Average Pooling modules to accept tensors with 0-dim batch sizes. (#62025)
authorSameer Deshmukh <sameer.deshmukh93@gmail.com>
Fri, 13 Aug 2021 18:27:47 +0000 (11:27 -0700)
committerFacebook GitHub Bot <facebook-github-bot@users.noreply.github.com>
Fri, 13 Aug 2021 18:31:17 +0000 (11:31 -0700)
commit38a825c64847741aa518fe69d4af584851d89cea
tree5cc196feb0a55356ee83342fe494771269dcea67
parentde7ae9e9b6a8537ca06727f76363002350a7bacc
Allow Average Pooling modules to accept tensors with 0-dim batch sizes. (#62025)

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.

It introduces changes and tests for allowing the Average Pooling layers to accept tensors with 0 sized batch dimensions and return meaningful results.

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

Reviewed By: VitalyFedyunin

Differential Revision: D30303256

Pulled By: jbschlosser

fbshipit-source-id: 5f727e62a7c58d2b8bb49fcc3bd7688474917ba5
aten/src/ATen/native/AdaptiveAveragePooling.cpp
aten/src/ATen/native/AdaptiveAveragePooling3d.cpp
aten/src/ATen/native/cuda/AdaptiveAveragePooling.cu
aten/src/ATen/native/cuda/AdaptiveAveragePooling3d.cu
test/test_nn.py