set_rank_actv Subroutine

private subroutine set_rank_actv(this, input_rank, output_rank)

Set the input and output ranks of the activation layer

Type Bound

actv_layer_type

Arguments

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

Instance of the activation layer

integer, intent(in) :: input_rank

Input rank

integer, intent(in) :: output_rank

Output rank


Source Code

  subroutine set_rank_actv(this, input_rank, output_rank)
    !! Set the input and output ranks of the activation layer
    implicit none

    ! Arguments
    class(actv_layer_type), intent(inout) :: this
    !! Instance of the activation layer
    integer, intent(in) :: input_rank
    !! Input rank
    integer, intent(in) :: output_rank
    !! Output rank

    this%input_rank = input_rank
    this%output_rank = output_rank
    if(this%input_rank.ne.this%output_rank)then
       call stop_program("Warning: Activation layer input and output ranks differ")
       return
    end if
    if(this%input_rank.lt.1)then
       write(*,*) "Error: Activation layer input rank must be at least 1"
       call stop_program("Invalid activation layer input rank")
       return
    end if
    if(this%output_rank.lt.1)then
       write(*,*) "Error: Activation layer output rank must be at least 1"
       call stop_program("Invalid activation layer output rank")
       return
    end if

  end subroutine set_rank_actv