Reduce duplicated function call
authorJihoon Lee <jhoon.it.lee@samsung.com>
Fri, 5 Jun 2020 06:56:44 +0000 (15:56 +0900)
committerJijoong Moon <jijoong.moon@samsung.com>
Mon, 8 Jun 2020 00:58:11 +0000 (09:58 +0900)
commitc527df4cf7c6d313993a61e8e59df2925ef4d78b
tree8cd5d95165d6baab5c604c60dba1956b756d785e
parentdb11a963cb712ece3f09f207ca319fc67202070f
Reduce duplicated function call

**Changes proposed in this PR:**
- Reduce `average()` call in `Optimizer::calculate
- Delete setZero call after construction `Tensor`
- Reduce indexing and multiplication in few loops

This PR results in better performance including roughly 60% decrease
in time spent in `Tensor::average()` in
Classification example(checked in vtune).

**Self evaluation:**
1. Build test: [X]Passed [ ]Failed [ ]Skipped
2. Run test: [X]Passed [ ]Failed [ ]Skipped

Signed-off-by: Jihoon Lee <jhoon.it.lee@samsung.com>
nntrainer/src/bn_layer.cpp
nntrainer/src/optimizer.cpp
nntrainer/src/tensor.cpp