From: Jihoon Lee Date: Thu, 13 Jan 2022 15:20:30 +0000 (+0900) Subject: [Fix] BN life span X-Git-Tag: accepted/tizen/unified/20220323.062643~40 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=1ecdce7fb02c1de5bf4bbe5232c43933df055738;p=platform%2Fcore%2Fml%2Fnntrainer.git [Fix] BN life span t_reduced is used in forward, but lifespan was in backwarding. This patch fixes the issue **Self evaluation:** 1. Build test: [X]Passed [ ]Failed [ ]Skipped 2. Run test: [X]Passed [ ]Failed [ ]Skipped Signed-off-by: Jihoon Lee --- diff --git a/nntrainer/layers/bn_layer.cpp b/nntrainer/layers/bn_layer.cpp index 5c7b553..f65d042 100644 --- a/nntrainer/layers/bn_layer.cpp +++ b/nntrainer/layers/bn_layer.cpp @@ -128,7 +128,7 @@ void BatchNormalizationLayer::finalize(InitLayerContext &context) { */ wt_idx[BNParams::t_full] = context.requestTensor(in_dim, "tensor_full", Tensor::Initializer::NONE, - false, TensorLifespan::BACKWARD_FUNC_LIFESPAN); + false, TensorLifespan::CALC_DERIV_LIFESPAN); /** * caches variance + epsilon as well. */ @@ -140,7 +140,7 @@ void BatchNormalizationLayer::finalize(InitLayerContext &context) { */ wt_idx[BNParams::t_reduced] = context.requestTensor(dim, "tensor_reduced", Tensor::Initializer::NONE, - false, TensorLifespan::BACKWARD_FUNC_LIFESPAN); + false, TensorLifespan::FORWARD_DERIV_LIFESPAN); } void BatchNormalizationLayer::setProperty(