Suppress maybe used uninitialized warning as being false alert (#20886)

### Description
<!-- Describe your changes. -->


### Motivation and Context
<!-- - Why is this change required? What problem does it solve?
- If it fixes an open issue, please link to the issue here. -->

It breaks the python package pipeline.
A new run:

https://aiinfra.visualstudio.com/Lotus/_build/results?buildId=477415&view=logs&s=d66927fc-650e-5e6f-874c-ae9229c1e7e4

---------

Co-authored-by: Your Name <you@example.com>
This commit is contained in:
Ye Wang 2024-05-31 17:04:58 -07:00 committed by GitHub
parent 4e18344028
commit ad769f14a8
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -54,6 +54,11 @@ Status QMoE::ComputeInternal(OpKernelContext* context) const {
const Tensor* fc3_scales_optional = context->Input<Tensor>(9);
const Tensor* fc3_experts_bias_optional = context->Input<Tensor>(10);
#if defined(__GNUC__)
#pragma GCC diagnostic push
#pragma GCC diagnostic ignored "-Wmaybe-uninitialized" // Mute "maybe used uninitialized" warning for MoEParameters.
#endif
MoEParameters moe_params;
MoEQuantType quant_type = MoEQuantType::UINT4;
ORT_RETURN_IF_ERROR(CheckInputs(moe_params, quant_type, input, router_probs, fc1_experts_weights,
@ -135,6 +140,10 @@ Status QMoE::ComputeInternal(OpKernelContext* context) const {
reinterpret_cast<int*>(expert_for_source_row.get()), static_cast<int>(moe_params.num_rows),
static_cast<int>(moe_params.hidden_size), static_cast<int>(k_), Stream(context));
#if defined(__GNUC__)
#pragma GCC diagnostic pop
#endif
return Status::OK();
}