From 29d00fb7767b9202fdda01cbd64f5150e5427eb4 Mon Sep 17 00:00:00 2001 From: Chen Fu <1316708+chenfucn@users.noreply.github.com> Date: Wed, 19 Apr 2023 17:24:35 -0700 Subject: [PATCH] Set proper default values for pool attributes (#15559) ### Description Setting proper default value for attributes of pool operators ### Motivation and Context Fixed AB#14719 Global pooling and pooling operators usually share the same underlying implementation. When we detect the operator is global, code for setting up the attributes is skipped. This may cause un-deterministic behavior. --- onnxruntime/core/providers/cpu/nn/pool_attributes.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/onnxruntime/core/providers/cpu/nn/pool_attributes.h b/onnxruntime/core/providers/cpu/nn/pool_attributes.h index 13796473dc..54f41f09f4 100644 --- a/onnxruntime/core/providers/cpu/nn/pool_attributes.h +++ b/onnxruntime/core/providers/cpu/nn/pool_attributes.h @@ -93,8 +93,8 @@ struct PoolAttributes { TensorShapeVector strides; TensorShapeVector dilations; // Introduced in MaxPool_10 // default_dilations is true if dilations is not set or all dilations are 1 - bool default_dilations; - AutoPadType auto_pad; + bool default_dilations{false}; + AutoPadType auto_pad{AutoPadType::NOTSET}; TensorShapeVector SetOutputSize(const TensorShape& input_shape, int64_t output_channel,