Get the keras layer name from the activation name.

def _get_elementwise_name_from_keras_layer(keras_layer):
    """
    Get the keras layer name from the activation name.
    """
    if isinstance(keras_layer, _keras.layers.Add):
        return 'ADD'
    elif isinstance(keras_layer, _keras.layers.Multiply):
        return 'MULTIPLY'
    elif isinstance(keras_layer, _keras.layers.Concatenate):
        if len(keras_layer.input_shape[0]) == 3 and (keras_layer.axis == 1 or keras_layer.axis == -2):
            return 'SEQUENCE_CONCAT'
        elif len(keras_layer.input_shape[0]) == 4 and (keras_layer.axis == 3 or keras_layer.axis == -1):
            return 'CONCAT'
        elif len(keras_layer.input_shape[0]) == 2 and (keras_layer.axis == 1 or keras_layer.axis == -1):
            return 'CONCAT'
        else:
            raise ValueError('Only channel and sequence concatenation are supported.')
    elif isinstance(keras_layer, _keras.layers.Dot):
        if len(keras_layer.input_shape[0]) == 2:
            if type(keras_layer.axes) is list or type(keras_layer.axes) is tuple:
                if len(keras_layer.axes) > 1:
                    raise ValueError('Only vector dot-product is supported.')
                else:
                    axis = keras_layer.axes[0]
            else:
                axis = keras_layer.axes
            if axis != -1 and axis != 1:
                 raise ValueError('Only vector dot-product is supported.')

            if keras_layer.normalize:
                return 'COS'
            else:
                return 'DOT'
        else:
            raise ValueError('Only vector dot-product is supported.')
    elif isinstance(keras_layer, _keras.layers.Maximum):
        return 'MAX'
    elif isinstance(keras_layer, _keras.layers.Average):
        return 'AVE'
    else:
        _utils.raise_error_unsupported_option(str(type(keras_layer)), 'merge',
                keras_layer.name)