diff --git a/.clang-tidy b/.clang-tidy index 7c1f905f2eb3c091580991db771a357b2698218b..e073b75ae07002bff7e2867f8ada50f2ae376aea 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 ebe020a19e2ba7ec20b0ed06ead2a508cd735349..bd53a5d4e19cfaf15905c9c2118ce904c8ba1eba 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) {