mirror of
https://github.com/pytorch/pytorch.git
synced 2025-10-20 21:14:14 +08:00
[Distributed] [7/N] Fix clang-tidy warnings in torch/csrc/distributed/c10d (#124987)
This PR continues to clean clang-tidy warnings in torch/csrc/distributed/c10d, following #124701. In addition, libfmt dependency is added in CMake code to enable using it in the headers. The libfmt has to be added as private dependency to torch_cuda and torch_hip because they include torch/csrc/distributed/c10d/Utils.hpp which uses libfmt. Pull Request resolved: https://github.com/pytorch/pytorch/pull/124987 Approved by: https://github.com/malfet
This commit is contained in:
@ -30,10 +30,10 @@ class Counter {
|
||||
return count_;
|
||||
}
|
||||
double variance() const noexcept {
|
||||
return m2_ / count_;
|
||||
return m2_ / static_cast<double>(count_);
|
||||
}
|
||||
double sample_variance() const noexcept {
|
||||
return m2_ / (count_ - 1);
|
||||
return m2_ / static_cast<double>(count_ - 1);
|
||||
}
|
||||
|
||||
private:
|
||||
|
Reference in New Issue
Block a user