def _get_elementwise_name_from_keras_layer(keras_layer):
    """
    Get the keras layer name from the activation name.
    """
    mode = keras_layer.mode
    if mode == 'sum':
        return 'ADD'
    elif mode == 'mul':
        return 'MULTIPLY'
    elif mode == 'concat':
        if len(keras_layer.input_shape[0]) == 3 and (keras_layer.concat_axis == 1 or keras_layer.concat_axis == -2):
            return 'SEQUENCE_CONCAT'
        elif len(keras_layer.input_shape[0]) == 4 and (keras_layer.concat_axis == 3 or keras_layer.concat_axis == -1):
            return 'CONCAT'
        elif len(keras_layer.input_shape[0]) == 2 and (keras_layer.concat_axis == 1 or keras_layer.concat_axis == -1):
            return 'CONCAT'
        else:
            option = "input_shape = %s concat_axis = %s" % (str(keras_layer.input_shape[0]), str(keras_layer.concat_axis))
            _utils.raise_error_unsupported_option(option, mode, keras_layer.name)
    elif mode == 'cos':
        if len(keras_layer.input_shape[0]) == 2:
            return 'COS'
        else:
            option = "input_shape = %s" % (str(keras_layer.input_shape[0]))
            _utils.raise_error_unsupported_option(option, mode, keras_layer.name)
    elif mode == 'dot':
        if len(keras_layer.input_shape[0]) == 2:
            return 'DOT'
        else:
            option = "input_shape = %s" % (str(keras_layer.input_shape[0]))
            _utils.raise_error_unsupported_option(option, mode, keras_layer.name)
    elif mode == 'max':
        return 'MAX'
    elif mode == 'ave':
        return 'AVE'
    else:
        _utils.raise_error_unsupported_categorical_option('mode', mode, 'Merge',
                keras_layer.name)
Get the keras layer name from the activation name.