From 113548801f05c01e1e16962fa09a9446a52c73f5 Mon Sep 17 00:00:00 2001 From: kolinwei <331911734@qq.com> Date: Wed, 16 May 2018 16:55:29 +0800 Subject: [PATCH] change some code style --- benchmark/fluid/mnist.py | 4 ++-- benchmark/fluid/vgg.py | 4 +++- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/benchmark/fluid/mnist.py b/benchmark/fluid/mnist.py index 1cb4314fb2..8d51d4aa60 100644 --- a/benchmark/fluid/mnist.py +++ b/benchmark/fluid/mnist.py @@ -184,8 +184,8 @@ def run_benchmark(model, args): ] ) # The accuracy is the accumulation of batches, but not the current batch. accuracy.update( - value=np.array(np.mean(outs[1])), - weight=np.mean(np.array(outs[2]))) + value=np.array(np.mean(outs[1])), + weight=np.mean(np.array(outs[2]))) iters += 1 num_samples += len(y_data) loss = np.mean(np.array(outs[0])) diff --git a/benchmark/fluid/vgg.py b/benchmark/fluid/vgg.py index 261446e7e9..2a9566a45c 100644 --- a/benchmark/fluid/vgg.py +++ b/benchmark/fluid/vgg.py @@ -188,7 +188,9 @@ def main(): loss, acc, weight = train_exe.run( feed={"pixel": img_data, "label": y_data}, - fetch_list=[avg_cost.name, batch_acc.name, batch_size_tensor.name]) + fetch_list=[ + avg_cost.name, batch_acc.name, batch_size_tensor.name + ]) accuracy.add(value=np.array(np.mean(acc)), weight=np.mean(weight)) iters += 1 num_samples += len(y_data) -- GitLab