remove some spurious warnings fixing take 2 (#72542)
Summary:
This adds an extra special case for size 1, stride 0 Tensors. These are considered contiguous by the backend but in practice come from view ops quite often.
Until we properly detect views in accumulategrad, this ensures we don't break more things.
Pull Request resolved: https://github.com/pytorch/pytorch/pull/72542
Reviewed By: bdhirsh
Differential Revision: D34085476
Pulled By: albanD
fbshipit-source-id: 1b31e0a2c86abfb0cbe9a2b11c6a168903d460f7
(cherry picked from commit 6695df00791acf48f40e9dc9c8b481e5e289f995)