reset_state_recurrent Subroutine

private subroutine reset_state_recurrent(this)

Reset the hidden state of the recurrent layer

Type Bound

recurrent_layer_type

Arguments

Type IntentOptional Attributes Name
class(recurrent_layer_type), intent(inout) :: this

Instance of the recurrent layer


Source Code

  subroutine reset_state_recurrent(this)
    !! Reset the hidden state of the recurrent layer
    implicit none

    ! Arguments
    class(recurrent_layer_type), intent(inout) :: this
    !! Instance of the recurrent layer

    this%time_step = 0
    if(associated(this%hidden_state))then
       call this%hidden_state%deallocate()
       nullify(this%hidden_state)
    end if

  end subroutine reset_state_recurrent