Fix style issues reported by clang-tidy (#1167)

This commit is contained in:
Fangjun Kuang
2024-07-23 09:26:36 +08:00
committed by GitHub
parent d32a46169f
commit 299f1a852b
7 changed files with 21 additions and 22 deletions

View File

@@ -157,8 +157,8 @@ Ort::Value View(Ort::Value *v) {
float ComputeSum(const Ort::Value *v, int32_t n /*= -1*/) {
std::vector<int64_t> shape = v->GetTensorTypeAndShapeInfo().GetShape();
auto size = static_cast<int32_t>(std::accumulate(
shape.begin(), shape.end(), 1, std::multiplies<int64_t>()));
auto size = static_cast<int32_t>(
std::accumulate(shape.begin(), shape.end(), 1, std::multiplies<>()));
if (n != -1 && n < size && n > 0) {
size = n;
}
@@ -170,8 +170,8 @@ float ComputeSum(const Ort::Value *v, int32_t n /*= -1*/) {
float ComputeMean(const Ort::Value *v, int32_t n /*= -1*/) {
std::vector<int64_t> shape = v->GetTensorTypeAndShapeInfo().GetShape();
auto size = static_cast<int32_t>(std::accumulate(
shape.begin(), shape.end(), 1, std::multiplies<int64_t>()));
auto size = static_cast<int32_t>(
std::accumulate(shape.begin(), shape.end(), 1, std::multiplies<>()));
if (n != -1 && n < size && n > 0) {
size = n;