onnx_to_athena_activation Function

public function onnx_to_athena_activation(optype) result(name)

Convert an ONNX activation op_type string to the Athena activation name

Arguments

Type IntentOptional Attributes Name
character(len=*), intent(in) :: optype

Return Value character(len=64)


Source Code

  function onnx_to_athena_activation(optype) result(name)
    !! Convert an ONNX activation op_type string to the Athena activation name
    implicit none
    character(*), intent(in) :: optype
    character(64) :: name

    select case(trim(optype))
    case('LeakyRelu')
       name = 'leaky_relu'
    case('Relu')
       name = 'relu'
    case('Sigmoid')
       name = 'sigmoid'
    case('Softmax')
       name = 'softmax'
    case('Tanh')
       name = 'tanh'
    case('Selu')
       name = 'selu'
    case('Swish')
       name = 'swish'
    case default
       name = to_lower(trim(optype))
    end select

  end function onnx_to_athena_activation