export_attributes_selu Function

private pure function export_attributes_selu(this) result(attributes)

Export SELU activation function attributes as ONNX attributes

Type Bound

selu_actv_type

Arguments

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

SELU activation type

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

Array of ONNX attributes


Source Code

  pure function export_attributes_selu(this) result(attributes)
    !! Export SELU activation function attributes as ONNX attributes
    implicit none

    ! Arguments
    class(selu_actv_type), intent(in) :: this
    !! SELU activation type
    type(onnx_attribute_type), allocatable, dimension(:) :: attributes
    !! Array of ONNX attributes

    ! Local variables
    character(50) :: buffer
    !! Temporary string buffer

    allocate(attributes(4))

    write(buffer, '(A)') this%name
    attributes(1) = onnx_attribute_type( &
         "name", "string", trim(adjustl(buffer)) )

    write(buffer, '(F10.6)') this%scale
    attributes(2) = onnx_attribute_type( &
         "scale", "float", trim(adjustl(buffer)) )

    write(buffer, '(F10.6)') this%alpha
    attributes(3) = onnx_attribute_type( &
         "alpha", "float", trim(adjustl(buffer)) )

    write(buffer, '(F10.6)') this%lambda
    attributes(4) = onnx_attribute_type( &
         "lambda", "float", trim(adjustl(buffer)) )

  end function export_attributes_selu