From 465b43e931d63c0ad9150248a8dcc02a234f7fb2 Mon Sep 17 00:00:00 2001 From: gouzil <66515297+gouzil@users.noreply.github.com> Date: Mon, 14 Aug 2023 17:39:49 +0800 Subject: [PATCH] [clang-tidy] Open bugprone-integer-division Check (#56246) --- .clang-tidy | 2 +- paddle/fluid/framework/details/scope_buffered_monitor.cc | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.clang-tidy b/.clang-tidy index 7c1f905f2eb..e073b75ae07 100644 --- a/.clang-tidy +++ b/.clang-tidy @@ -14,7 +14,7 @@ Checks: ' -bugprone-inaccurate-erase, -bugprone-incorrect-roundings, -bugprone-infinite-loop, --bugprone-integer-division, +bugprone-integer-division, -bugprone-macro-repeated-side-effects, -bugprone-misplaced-operator-in-strlen-in-alloc, -bugprone-misplaced-widening-cast, diff --git a/paddle/fluid/framework/details/scope_buffered_monitor.cc b/paddle/fluid/framework/details/scope_buffered_monitor.cc index ebe020a19e2..bd53a5d4e19 100644 --- a/paddle/fluid/framework/details/scope_buffered_monitor.cc +++ b/paddle/fluid/framework/details/scope_buffered_monitor.cc @@ -29,7 +29,7 @@ namespace paddle { namespace framework { namespace details { -static constexpr double kMB = 1 / (1024 * 1024); +static constexpr double kMB = 1.0 / (1024.0 * 1024.0); static void GetTensors(Variable *var, std::unordered_set *tensor_set) { -- GitLab