Skip to content

Commit

Permalink
Might not use set_state at rnn_layer level
Browse files Browse the repository at this point in the history
  • Loading branch information
castelao committed Nov 14, 2023
1 parent 3fa5281 commit fbab488
Showing 1 changed file with 5 additions and 18 deletions.
23 changes: 5 additions & 18 deletions src/nf/nf_rnn_layer.f90
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ module nf_rnn_layer
procedure :: get_params
procedure :: init
procedure :: set_params
procedure :: set_state
! procedure :: set_state

end type rnn_layer

Expand Down Expand Up @@ -127,24 +127,11 @@ module subroutine init(self, input_shape)
!! Shape of the input layer
end subroutine init

module subroutine reset(self)
!! Reset layer state
!!
!! Currently reset state to zero but might be worth reconsidering it
!! in the future.
class(rnn_layer), intent(in out) :: self
end subroutine reset
!module subroutine set_state(self, state)
! type(rnn_layer), intent(inout) :: self
! real, intent(in), optional :: state(:)
!end subroutine set_state

end interface

subroutine set_state(self, state)
type(rnn_layer), intent(inout) :: self
real, intent(in), optional :: state(:)
if (present(state)) then
self % state = state
else
self % state = 0
end if
end subroutine set_state

end module nf_rnn_layer

0 comments on commit fbab488

Please sign in to comment.