From: SeoHyungjun Date: Wed, 23 Aug 2023 07:26:03 +0000 (+0900) Subject: [Ahub] Fix Ahub issue X-Git-Tag: accepted/tizen/8.0/unified/20231005.093407~12 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=70ae8cac753568c04569e5ddc35080470ea2d01f;p=platform%2Fcore%2Fml%2Fnntrainer.git [Ahub] Fix Ahub issue Restore does not work as expected after changing ostream type. Added because there is no code to restore the variable out. Changed the code where the nesting depth was set incorrectly to the correct location. Signed-off-by: SeoHyungjun --- diff --git a/nntrainer/tensor/tensor.cpp b/nntrainer/tensor/tensor.cpp index d4989db..f73dcce 100644 --- a/nntrainer/tensor/tensor.cpp +++ b/nntrainer/tensor/tensor.cpp @@ -2649,8 +2649,8 @@ void Tensor::print(std::ostream &out) const { } out << "-------" << std::endl; } - out.copyfmt(init); } + out.copyfmt(init); } else if (getDataType() == ml::train::TensorDim::DataType::FP16) { #ifdef ENABLE_FP16 const _FP16 *data = getData<_FP16>(); @@ -2696,8 +2696,8 @@ void Tensor::print(std::ostream &out) const { } out << "-------" << std::endl; } - out.copyfmt(init); } + out.copyfmt(init); #else throw std::invalid_argument("Error: enable-fp16 is not enabled"); #endif @@ -2878,6 +2878,7 @@ void Tensor::print_(std::ostream &out, uint opt) const { out << getData()[i] << ", "; } } + out.copyfmt(init); } std::ostream &operator<<(std::ostream &out, Tensor const &m) {