def channels_axis(inputs, params):
    """Return the axis index which houses the channels."""
    if params.data_format == 'channels_first':
        axis = 1
    else:
        axis = len(inputs.get_shape()) - 1
    return axis