Skip to content

Commit e6b4496

Browse files
authored
Fix val warning (#74468)
1 parent 1f6fa8f commit e6b4496

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

paddle/phi/kernels/impl/accuracy_check_kernel_impl.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -108,7 +108,7 @@ struct AccuracyCheckFunctor<phi::CPUContext, phi::dtype::complex<T>> {
108108
for (int i = 0; i < num; i++) {
109109
out_data[i] = true;
110110
}
111-
bool val;
111+
bool val = false;
112112
int res_index = -1;
113113
for (int i = 0; i < num; i++) {
114114
const phi::dtype::complex<T> a = in_a[i], b = in_b[i];

paddle/phi/kernels/impl/einsum_grad_kernel_impl.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ DenseTensor PerformTileAndReduction(const Context& dev_ctx,
4444
std::vector<int64_t> resize_dims;
4545
std::vector<int64_t> recover_shape;
4646
std::vector<int64_t> t_shape = common::vectorize<int64_t>(t.dims());
47-
for (int i = 0; i < op_label.size(); i++) {
47+
for (size_t i = 0; i < op_label.size(); i++) {
4848
int c = op_label[i];
4949
if (label2type[c] == LabelType::Reduction) {
5050
repeat_times.push_back(label2shape[c]);
@@ -64,7 +64,7 @@ DenseTensor PerformTileAndReduction(const Context& dev_ctx,
6464
"shape size: `%d`, but got label nums: `%d`",
6565
t_shape.size(),
6666
op_label.size()));
67-
for (int i = 0; i < op_label.size(); i++) {
67+
for (size_t i = 0; i < op_label.size(); i++) {
6868
int c = op_label[i];
6969
if (label2type[c] == LabelType::Contraction &&
7070
t_shape[i] != label2shape[c]) {

0 commit comments

Comments
 (0)