Skip to content

Commit c62110d

Browse files
committed
remove unused dim variable
1 parent 497600d commit c62110d

File tree

2 files changed

+7
-12
lines changed

2 files changed

+7
-12
lines changed

src/stdlib_specialfunctions.fypp

+3-6
Original file line numberDiff line numberDiff line change
@@ -321,10 +321,9 @@ module stdlib_specialfunctions
321321
!! softmax function. Available for ranks 1 to 4
322322
!> ([Specification](../page/specs/stdlib_specialfunctions.html#softmax))
323323
#:for rk, rt in REAL_KINDS_TYPES
324-
pure module function softmax_r1_${rk}$( x , dim ) result( y )
324+
pure module function softmax_r1_${rk}$( x ) result( y )
325325
${rt}$, intent(in) :: x(:)
326326
${rt}$ :: y(size(x))
327-
integer, intent(in), optional :: dim
328327
end function
329328
#:for rank in RANKS
330329
pure module function softmax_r${rank}$_${rk}$( x , dim ) result( y )
@@ -343,10 +342,9 @@ module stdlib_specialfunctions
343342
!! Gradient of the softmax function. Available for ranks 1 to 4
344343
!> ([Specification](../page/specs/stdlib_specialfunctions.html#softmax_grad))
345344
#:for rk, rt in REAL_KINDS_TYPES
346-
pure module function softmax_grad_r1_${rk}$( x , dim ) result( y )
345+
pure module function softmax_grad_r1_${rk}$( x ) result( y )
347346
${rt}$, intent(in) :: x(:)
348347
${rt}$ :: y(size(x))
349-
integer, intent(in), optional :: dim
350348
end function
351349
#:for rank in RANKS
352350
pure module function softmax_grad_r${rank}$_${rk}$( x , dim ) result( y )
@@ -365,10 +363,9 @@ module stdlib_specialfunctions
365363
!! softmax function. Available for ranks 1 to 4
366364
!> ([Specification](../page/specs/stdlib_specialfunctions.html#logsoftmax))
367365
#:for rk, rt in REAL_KINDS_TYPES
368-
pure module function logsoftmax_r1_${rk}$( x, dim ) result( y )
366+
pure module function logsoftmax_r1_${rk}$( x ) result( y )
369367
${rt}$, intent(in) :: x(:)
370368
${rt}$ :: y(size(x))
371-
integer, intent(in), optional :: dim
372369
end function
373370
#:for rank in RANKS
374371
pure module function logsoftmax_r${rank}$_${rk}$( x , dim ) result( y )

src/stdlib_specialfunctions_activations.fypp

+4-6
Original file line numberDiff line numberDiff line change
@@ -203,10 +203,9 @@ end function
203203
! softmax
204204
!==================================================
205205
#:for rk, rt in REAL_KINDS_TYPES
206-
pure module function softmax_r1_${rk}$( x , dim ) result( y )
206+
pure module function softmax_r1_${rk}$( x ) result( y )
207207
${rt}$, intent(in) :: x(:)
208208
${rt}$ :: y(size(x))
209-
integer, intent(in), optional :: dim
210209

211210
y = exp(x - maxval(x))
212211
y = y / sum(y)
@@ -242,10 +241,9 @@ pure module function softmax_r${rank}$_${rk}$( x , dim ) result( y )
242241
end function
243242
#:endfor
244243

245-
pure module function softmax_grad_r1_${rk}$( x , dim ) result( y )
244+
pure module function softmax_grad_r1_${rk}$( x ) result( y )
246245
${rt}$, intent(in) :: x(:)
247246
${rt}$ :: y(size(x))
248-
integer, intent(in), optional :: dim
249247

250248
y = softmax(x)
251249
y = y * (1._${rk}$ - y)
@@ -272,10 +270,10 @@ end function
272270
! logsoftmax
273271
!==================================================
274272
#:for rk, rt in REAL_KINDS_TYPES
275-
pure module function logsoftmax_r1_${rk}$( x, dim ) result( y )
273+
pure module function logsoftmax_r1_${rk}$( x ) result( y )
276274
${rt}$, intent(in) :: x(:)
277275
${rt}$ :: y(size(x))
278-
integer, intent(in), optional :: dim
276+
279277
y = x - maxval(x)
280278
y = y - log( sum(exp(y)) )
281279
end function

0 commit comments

Comments
 (0)