[Tensor] OutputGrad defaults to be zero if not given
authorJihoon Lee <jhoon.it.lee@samsung.com>
Tue, 21 Dec 2021 09:02:02 +0000 (18:02 +0900)
committerJijoong Moon <jijoong.moon@samsung.com>
Wed, 29 Dec 2021 07:48:32 +0000 (16:48 +0900)
commit76f9b9164c35681b0726369cc48dae7332362e52
tree67f052a7f285bd4509afce0b5923554de805ee11
parent19db52c2b20de31324f1537f76165356f5822828
[Tensor] OutputGrad defaults to be zero if not given

This patch creates output grad(incoming) to all zero if the given output
is not trainable. This will make the given output be considered as
constant. If a user wants to check if output is constant-like(having
zero gradient as it's partner), she can easily check if
outputHasGradient

**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/layers/layer_context.cpp
nntrainer/layers/layer_context.h
nntrainer/layers/layer_node.h