find_gnn_node Function

private function find_gnn_node(nodes, num_nodes, name) result(idx)

Return the index of a node with exact name match, or zero.

Arguments

Type IntentOptional Attributes Name
type(onnx_node_type), intent(in) :: nodes(:)

Parsed ONNX nodes

integer, intent(in) :: num_nodes

Number of valid node entries

character(len=*), intent(in) :: name

Exact node name to search for

Return Value integer

Return value: index of the matching node, or zero if not found


Source Code

  function find_gnn_node(nodes, num_nodes, name) result(idx)
    !! Return the index of a node with exact name match, or zero.
    implicit none

    ! Arguments
    type(onnx_node_type), intent(in) :: nodes(:)
    !! Parsed ONNX nodes
    integer, intent(in) :: num_nodes
    !! Number of valid node entries
    character(*), intent(in) :: name
    !! Exact node name to search for

    integer :: idx
    !! Return value: index of the matching node, or zero if not found

    ! Local variables
    integer :: i

    idx = 0
    do i = 1, num_nodes
       if(trim(nodes(i)%name) .eq. trim(name))then
          idx = i
          return
       end if
    end do

  end function find_gnn_node