get_attributes_ono Function

public function get_attributes_ono(this) result(attributes)

Return list of ONO attributes for ONNX export

Type Bound

orthogonal_nop_block_type

Arguments

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

Instance of the ONO block

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

List of attributes for ONNX export


Source Code

  function get_attributes_ono(this) result(attributes)
    !! Return list of ONO attributes for ONNX export
    implicit none

    ! Arguments
    class(orthogonal_nop_block_type), intent(in) :: this
    !! Instance of the ONO block
    type(onnx_attribute_type), allocatable, dimension(:) :: attributes
    !! List of attributes for ONNX export

    ! Local variables
    character(32) :: buffer
    !! Buffer for formatting

    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_basis
    attributes(3) = onnx_attribute_type( &
         name='num_basis', 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_ono