diff --git a/nntrainer/tensor/tensor.cpp b/nntrainer/tensor/tensor.cpp index 220151cc86..b5b4ac3749 100644 --- a/nntrainer/tensor/tensor.cpp +++ b/nntrainer/tensor/tensor.cpp @@ -3479,7 +3479,7 @@ void Tensor::inv_sqrt_i() { #ifdef ENABLE_FP16 if (!contiguous) { apply_i<_FP16>([](_FP16 val) -> _FP16 { - return 1 / std::sqrt(static_cast(val)); + return static_cast<_FP16>(1 / std::sqrt(static_cast(val))); }); } else { inv_sqrt_inplace(this->size(), getData<_FP16>());