Skip to content

Commit c43679f

Browse files
authored
fix pglbox ce bug; test=develop (#65179)
1 parent c00f1de commit c43679f

File tree

1 file changed

+2
-3
lines changed

1 file changed

+2
-3
lines changed

paddle/fluid/framework/device_worker.cc

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -93,8 +93,7 @@ void PrintLodTensorType<float>(phi::DenseTensor* tensor,
9393
char separator,
9494
bool need_leading_separator,
9595
int num_decimals) {
96-
std::string buf;
97-
buf.resize(MAX_FLOAT_BUFF_SIZE);
96+
char buf[MAX_FLOAT_BUFF_SIZE]; // NOLINT
9897
auto count = tensor->numel();
9998
if (start < 0 || end > count) {
10099
VLOG(3) << "access violation";
@@ -109,7 +108,7 @@ void PrintLodTensorType<float>(phi::DenseTensor* tensor,
109108
out_val += "0";
110109
} else {
111110
std::string format = "%." + std::to_string(num_decimals) + "f";
112-
sprintf(&buf[0], &format[0], tensor->data<float>()[i]); // NOLINT
111+
sprintf(buf, &format[0], tensor->data<float>()[i]); // NOLINT
113112
out_val += buf;
114113
}
115114
}

0 commit comments

Comments
 (0)