create_from_onnx_reshape_layer Function

public function create_from_onnx_reshape_layer(node, initialisers, value_info, verbose) result(layer)

Build reshape layer from ONNX node and initialiser

Arguments

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

ONNX node

type(onnx_initialiser_type), intent(in), dimension(:) :: initialisers

ONNX initialisers

type(onnx_tensor_type), intent(in), dimension(:) :: value_info

ONNX value infos

integer, intent(in), optional :: verbose

Verbosity level

Return Value class(base_layer_type), allocatable

Instance of the reshape layer


Source Code

  function create_from_onnx_reshape_layer( &
       node, initialisers, value_info, verbose &
  ) result(layer)
    !! Build reshape layer from ONNX node and initialiser
    implicit none

    ! Arguments
    type(onnx_node_type), intent(in) :: node
    !! ONNX node
    type(onnx_initialiser_type), dimension(:), intent(in) :: initialisers
    !! ONNX initialisers
    type(onnx_tensor_type), dimension(:), intent(in) :: value_info
    !! ONNX value infos
    integer, intent(in), optional :: verbose
    !! Verbosity level
    class(base_layer_type), allocatable :: layer
    !! Instance of the reshape layer

    ! Local variables
    integer :: verbose_ = 0
    !! Verbosity level

    if(present(verbose)) verbose_ = verbose
    allocate(layer, source=reshape_layer_type(output_shape=[0]))
    call layer%build_from_onnx(node, initialisers, value_info, verbose=verbose_)

  end function create_from_onnx_reshape_layer