get_sample_graph2d Module Function

module function get_sample_graph2d(input, start_index, end_index, batch_size) result(sample)

Get samples of batch size from a graph

Arguments

Type IntentOptional Attributes Name
class(graph_type), intent(in), dimension(:,:) :: input

Input array

integer, intent(in) :: start_index

Start and end indices

integer, intent(in) :: end_index

Start and end indices

integer, intent(in) :: batch_size

Batch size

Return Value type(graph_type), dimension(size(input,1), batch_size)

Sample array


Source Code

  module function get_sample_graph2d( &
       input, start_index, end_index, batch_size &
  ) result(sample)
    !! Get samples of batch size from a graph
    implicit none

    ! Arguments
    integer, intent(in) :: start_index, end_index
    !! Start and end indices
    integer, intent(in) :: batch_size
    !! Batch size
    class(graph_type), dimension(:,:), intent(in) :: input
    !! Input array

    type(graph_type), dimension(size(input,1), batch_size) :: sample
    !! Sample array

    sample(1:size(input,1),1:batch_size) = input(:,start_index:end_index)

  end function get_sample_graph2d