From 9ffe2b84e9a06aefe0f03daa4dabe547b086e616 Mon Sep 17 00:00:00 2001 From: gfjiangly <38396233+gfjiangly@users.noreply.github.com> Date: Sat, 20 Apr 2019 20:45:26 -0500 Subject: [PATCH] Optimization of the softmax layer (#914) * Optimize the loop structure to improve the speed of the softmax layer & Reduce memory consumption * use 4 space instead of tab --- src/layer/softmax.cpp | 154 ++++-------------------------------------- 1 file changed, 13 insertions(+), 141 deletions(-) diff --git a/src/layer/softmax.cpp b/src/layer/softmax.cpp index ad9ee76f3..20325b323 100644 --- a/src/layer/softmax.cpp +++ b/src/layer/softmax.cpp @@ -77,14 +77,10 @@ int Softmax::forward_inplace(Mat& bottom_top_blob, const Option& opt) const max = std::max(max, ptr[i]); } - for (int i=0; i