Fix a warning in pool.cc (#8168)

The warning is:
"Potential comparison of a constant with another constant. at D:\a_work\1\s\onnxruntime\core\providers\cuda\nn\pool.cc@167,21".

It was found by VS static code analyzer in our CUDA EP.
This commit is contained in:
Changming Sun 2021-06-28 07:58:02 -07:00 committed by GitHub
parent 821492f6f5
commit 9b75be3d3e
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -164,7 +164,7 @@ Status Pool<T, PoolType>::ComputeInternal(OpKernelContext* context) const {
}
cudnnPoolingMode_t mode = CUDNN_POOLING_MAX;
if (PoolType::type == onnxruntime::PoolType::kAveragePool) {
if constexpr (PoolType::type == onnxruntime::PoolType::kAveragePool) {
mode = pool_attrs_.count_include_pad ? CUDNN_POOLING_AVERAGE_COUNT_INCLUDE_PADDING
: CUDNN_POOLING_AVERAGE_COUNT_EXCLUDE_PADDING;
}