[layers/activation_func] Apply template on activation functions
authorskykongkong8 <ss.kong@samsung.com>
Thu, 10 Aug 2023 00:30:22 +0000 (09:30 +0900)
committerJijoong Moon <jijoong.moon@samsung.com>
Mon, 21 Aug 2023 06:29:23 +0000 (15:29 +0900)
commit55e3df24b5df6d6c510cb78f47ef499e180640f3
treeccc3dab3beef2cc576917bf61534da217170cbc3
parentcf44a13631c01e9bd7c7bb489b60227bac0aa765
[layers/activation_func] Apply template on activation functions

**Changes proposed in this PR:**

- For mixed precision, activation functions should be revised to a function template to avoid bulky code
- In order to use function template for setActivation, we need another function template to handle multiple types of activation function
- Minor fixes for template instantiation, and this will be revised proplerly for fp16 use in the next PR

Resolves:

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

Signed-off-by: skykongkong8 <ss.kong@samsung.com>
nntrainer/layers/acti_func.cpp
nntrainer/layers/acti_func.h
nntrainer/layers/loss/cross_entropy_sigmoid_loss_layer.cpp
nntrainer/utils/util_func.cpp
nntrainer/utils/util_func.h
test/unittest/unittest_nntrainer_activations.cpp