Repository: incubator-singa Updated Branches: refs/heads/master d5b6a30d0 -> a8c8211f4
SINGA-44 A bug when reseting metric values When reseting the values of Metric object, we didn't use reference which made the resetting invalid. Fixed the bug by using reference. Project: http://git-wip-us.apache.org/repos/asf/incubator-singa/repo Commit: http://git-wip-us.apache.org/repos/asf/incubator-singa/commit/4446889d Tree: http://git-wip-us.apache.org/repos/asf/incubator-singa/tree/4446889d Diff: http://git-wip-us.apache.org/repos/asf/incubator-singa/diff/4446889d Branch: refs/heads/master Commit: 4446889df52924b29f28d88b797d661b0acb1b3e Parents: a92a1c7 Author: Wei Wang <[email protected]> Authored: Wed Aug 12 15:43:07 2015 +0800 Committer: Wei Wang <[email protected]> Committed: Wed Aug 12 15:43:07 2015 +0800 ---------------------------------------------------------------------- src/utils/common.cc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/incubator-singa/blob/4446889d/src/utils/common.cc ---------------------------------------------------------------------- diff --git a/src/utils/common.cc b/src/utils/common.cc index f733497..3bba398 100644 --- a/src/utils/common.cc +++ b/src/utils/common.cc @@ -175,7 +175,7 @@ void Metric::Add(const string& name, float value) { } void Metric::Reset() { - for(auto e : entry_) { + for(auto& e : entry_) { e.second.first = 0; e.second.second = 0; }
