Skip to content

Commit

Permalink
Add dummy argument to type bound procedure, function_name for
Browse files Browse the repository at this point in the history
types `activation_strategy_t`, `swish_t`, `relu_t`, `sigmoid_t` in
order to keep the elemental keyword.
  • Loading branch information
ktras committed Feb 1, 2024
1 parent 1cc3b41 commit 62e4230
Show file tree
Hide file tree
Showing 5 changed files with 16 additions and 11 deletions.
7 changes: 4 additions & 3 deletions src/inference_engine/activation_strategy_m.f90
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ module activation_strategy_m
type, abstract :: activation_strategy_t
contains
procedure(activation_i), nopass, deferred :: activation
procedure(function_name_i), nopass, deferred :: function_name
procedure(function_name_i), deferred :: function_name
end type

abstract interface
Expand All @@ -27,9 +27,10 @@ elemental function activation_i(x) result(y)
real(rkind) y
end function

elemental function function_name_i() result(string)
import string_t
elemental function function_name_i(self) result(string)
import string_t, activation_strategy_t
implicit none
class(activation_strategy_t), intent(in) :: self
type(string_t) string
end function

Expand Down
5 changes: 3 additions & 2 deletions src/inference_engine/relu_m.f90
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ module relu_m
contains
procedure, nopass :: activation
procedure, nopass :: activation_derivative
procedure, nopass :: function_name
procedure :: function_name
end type

interface
Expand All @@ -30,8 +30,9 @@ elemental module function activation_derivative(x) result(y)
real(rkind) y
end function

elemental module function function_name() result(string)
elemental module function function_name(self) result(string)
implicit none
class(relu_t), intent(in) :: self
type(string_t) string
end function

Expand Down
5 changes: 3 additions & 2 deletions src/inference_engine/sigmoid_m.f90
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ module sigmoid_m
contains
procedure, nopass :: activation
procedure, nopass :: activation_derivative
procedure, nopass :: function_name
procedure :: function_name
end type

interface
Expand All @@ -30,8 +30,9 @@ elemental module function activation_derivative(x) result(y)
real(rkind) y
end function

elemental module function function_name() result(string)
elemental module function function_name(self) result(string)
implicit none
class(sigmoid_t), intent(in) :: self
type(string_t) string
end function

Expand Down
5 changes: 3 additions & 2 deletions src/inference_engine/step_m.f90
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ module step_m
type, extends(activation_strategy_t) :: step_t
contains
procedure, nopass :: activation
procedure, nopass :: function_name
procedure :: function_name
end type

interface
Expand All @@ -23,8 +23,9 @@ elemental module function activation(x) result(y)
real(rkind) y
end function

elemental module function function_name() result(string)
elemental module function function_name(self) result(string)
implicit none
class(step_t), intent(in) :: self
type(string_t) string
end function

Expand Down
5 changes: 3 additions & 2 deletions src/inference_engine/swish_m.f90
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ module swish_m
contains
procedure, nopass :: activation
procedure, nopass :: activation_derivative
procedure, nopass :: function_name
procedure :: function_name
end type

interface
Expand All @@ -30,8 +30,9 @@ elemental module function activation_derivative(x) result(y)
real(rkind) y
end function

elemental module function function_name() result(string)
elemental module function function_name(self) result(string)
implicit none
class(swish_t), intent(in) :: self
type(string_t) string
end function

Expand Down

0 comments on commit 62e4230

Please sign in to comment.