Skip to content

Commit 3090f53

Browse files
committed
use stdlib_sum
1 parent d6ffa11 commit 3090f53

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/stdlib_specialfunctions_activations.fypp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
#:include "common.fypp"
22
#:set RANKS = range(2, MAXRANK + 1)
33
submodule(stdlib_specialfunctions) stdlib_specialfunctions_activations
4+
use stdlib_intrinsics, only: sum => stdlib_sum
45
implicit none
56

67
#:for rk, rt in REAL_KINDS_TYPES
@@ -333,8 +334,8 @@ end function
333334
! Fast intrinsics for accelerated activations
334335
!==================================================
335336

336-
#:for rk, rt in REAL_KINDS_TYPES
337337
! Source: https://fortran-lang.discourse.group/t/fastgpt-faster-than-pytorch-in-300-lines-of-fortran/5385/31
338+
#:for rk, rt in REAL_KINDS_TYPES
338339
elemental module function fast_tanh_${rk}$( x ) result( y )
339340
${rt}$, intent(in) :: x
340341
${rt}$ :: y
@@ -352,7 +353,6 @@ elemental module function fast_tanh_grad_${rk}$( x ) result( y )
352353
y = 1._${rk}$ - fast_tanh(x)**2
353354
end function
354355

355-
! Source: https://fortran-lang.discourse.group/t/fastgpt-faster-than-pytorch-in-300-lines-of-fortran/5385/31
356356
elemental module function fast_erf_${rk}$( x ) result( y )
357357
${rt}$, intent(in) :: x
358358
${rt}$ :: y

0 commit comments

Comments
 (0)