From 1132d14eb9b38dfadd74fad6001a09872af7bd81 Mon Sep 17 00:00:00 2001 From: Jaeho Shin Date: Mon, 23 Jan 2017 13:47:41 -0800 Subject: [PATCH] coding style braces on every for body --- src/inference_result.cc | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/inference_result.cc b/src/inference_result.cc index c94f54160..0fece8405 100644 --- a/src/inference_result.cc +++ b/src/inference_result.cc @@ -56,8 +56,9 @@ InferenceResult::InferenceResult(const InferenceResult &other) void InferenceResult::merge_gradients_from(const InferenceResult &other) { assert(nweights == other.nweights); - for (size_t j = 0; j < nweights; ++j) + for (size_t j = 0; j < nweights; ++j) { weight_grads[j] += other.weight_grads[j]; + } } void InferenceResult::reset_gradients() { @@ -78,8 +79,9 @@ void InferenceResult::average_weights(size_t count) { void InferenceResult::copy_weights_to(InferenceResult &other) const { assert(nweights == other.nweights); - for (size_t j = 0; j < nweights; ++j) + for (size_t j = 0; j < nweights; ++j) { if (!weights_isfixed[j]) other.weight_values[j] = weight_values[j]; + } } void InferenceResult::show_weights_snippet(std::ostream &output) const {