forward_flatten Subroutine

private subroutine forward_flatten(this, input)

Forward propagation

Type Bound

flatten_layer_type

Arguments

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

Instance of the fully connected layer

class(array_type), intent(in), dimension(:,:) :: input

Input values


Source Code

  subroutine forward_flatten(this, input)
    !! Forward propagation
    implicit none

    ! Arguments
    class(flatten_layer_type), intent(inout) :: this
    !! Instance of the fully connected layer
    class(array_type), dimension(:,:), intent(in) :: input
    !! Input values

    type(array_type), pointer :: ptr => null()


    ! Flatten input
    !---------------------------------------------------------------------------
    call this%output(1,1)%zero_grad()
    ptr => pack(input(1,1), dim = 1)
    call this%output(1,1)%assign_and_deallocate_source(ptr)
    this%output(1,1)%is_temporary = .false.
    this%output(1,1)%fix_pointer = .true.

  end subroutine forward_flatten