def get_depth_fn(depth_multipler, min_depth):
    """Builds a callable to compute depth (output channels) of conv filters.

    Args:
        depth_multiplier: a multiplier for the nominal depth.
        min_depth: a lower bound on the depth of filters.

    Returns:
        A callable that takes in a nominal depth and returns the depth to use.
    """
    def multiply_depth(depth):
        """Limit minimum of depth."""
        new_depth = int(depth * depth_multipler)
        return max(new_depth, min_depth)
    return multiply_depth