Fix cuDNN error message when it's Conv2d (#45729) (#45770)
Summary:
Originally introduced in https://github.com/pytorch/pytorch/issues/45023. When I was doing test in the original PR, it was a Conv3d, so this problem was not discovered.
Arrays in `ConvolutionParams` have a fixed length of 3 or 5. This is because `max_dim` is set as a constexpr of 3, regardless of Conv2d or Conv3d. The current code will make some error message be weird. See below in the comments.
https://github.com/pytorch/pytorch/blob/9201c37d020007979e144693d86c8e8599e2fd8f/aten/src/ATen/native/cudnn/Conv.cpp#L212-L226
Pull Request resolved: https://github.com/pytorch/pytorch/pull/45729
Reviewed By: mruberry
Differential Revision: D24081542
Pulled By: ngimel
fbshipit-source-id: 141f8946f4d0db63a723131775731272abeaa6ab