get_attributes_fixed_lno Function

private function get_attributes_fixed_lno(this) result(attributes)

Return list of fixed LNO attributes for ONNX export

Type Bound

fixed_lno_layer_type

Arguments

Type IntentOptional Attributes Name
class(fixed_lno_layer_type), intent(in) :: this

Instance of the fixed LNO layer

Return Value type(onnx_attribute_type), allocatable, dimension(:)

List of attributes for ONNX export


Source Code

  function get_attributes_fixed_lno(this) result(attributes)
    !! Return list of fixed LNO attributes for ONNX export
    implicit none

    ! Arguments
    class(fixed_lno_layer_type), intent(in) :: this
    !! Instance of the fixed LNO layer
    type(onnx_attribute_type), allocatable, dimension(:) :: attributes
    !! List of attributes for ONNX export

    ! Local variables
    character(32) :: buffer
    !! Buffer for integer-to-string conversion

    allocate(attributes(5))

    write(buffer, '(I0)') this%num_inputs
    attributes(1) = onnx_attribute_type( &
         name='num_inputs', type='int', val=trim(buffer))
    write(buffer, '(I0)') this%num_outputs
    attributes(2) = onnx_attribute_type( &
         name='num_outputs', type='int', val=trim(buffer))
    write(buffer, '(I0)') this%num_modes
    attributes(3) = onnx_attribute_type( &
         name='num_modes', type='int', val=trim(buffer))
    if(this%use_bias)then
       buffer = '1'
    else
       buffer = '0'
    end if
    attributes(4) = onnx_attribute_type( &
         name='use_bias', type='int', val=trim(buffer))
    attributes(5) = onnx_attribute_type( &
         name='activation', type='string', val=trim(this%activation%name))

  end function get_attributes_fixed_lno