Elffuss BraidHub

kikocis/ncnn public

Fix tanh typo for rvv. (#5584)

* Fix tanh typo for rvv.

* Fix tanh for rvv fp16.
Changesetf02fb0de18a8f193d2ff9919c15d5ea7d6f6283b86f7e79e533bc869265093c6
Authorzhangyang2057 <zhangyang@canaan-creative.com> · 2024-07-18 14:19 +08:00
CommitterGitHub <noreply@github.com> · 2024-07-18 14:19 +08:00
Parents7ff5deef62d9

Browse the files at this changeset

2 files changed

modified src/layer/riscv/rvv_mathfun.h +1 −1
@@ -308,7 +308,7 @@
308308 \
309309 /* clamp the inputs to the range [-9, 9] since anything outside */ \
310310 /* this range is -/+1.0f in single-precision. */ \
311- x2 = vfmin_vf_f32m##LMUL(x, c_tanh_hi, vl); \
311+ x2 = vfmin_vf_f32m##LMUL(x2, c_tanh_hi, vl); \
312312 \
313313 /* since the polynomials are odd/even, we need x**2. */ \
314314 vfloat32m##LMUL##_t z = vfmul_vv_f32m##LMUL(x2, x2, vl); \
modified src/layer/riscv/rvv_mathfun_fp16s.h +1 −1
@@ -308,7 +308,7 @@
308308 \
309309 /* clamp the inputs to the range [-9, 9] since anything outside */ \
310310 /* this range is -/+1.0f in single-precision. */ \
311- x2 = vfmin_vf_f16m##LMUL(x, c_tanh_hi, vl); \
311+ x2 = vfmin_vf_f16m##LMUL(x2, c_tanh_hi, vl); \
312312 \
313313 /* since the polynomials are odd/even, we need x**2. */ \
314314 vfloat16m##LMUL##_t z = vfmul_vv_f16m##LMUL(x2, x2, vl); \