For a given model specification, returns a dictionary with a shape range object for each input feature name.

def get_allowed_shape_ranges(spec):
    """
    For a given model specification, returns a dictionary with a shape range object for each input feature name.
    """

    shaper = NeuralNetworkShaper(spec, False)
    inputs = _get_input_names(spec)
    output = {}

    for input in inputs:
        output[input] = shaper.shape(input)

    return output