from typing import List
import json


def str_to_list_of_ints(val) -> List[int]:
    """Accepts a str or list, returns list of ints. Specifically useful when 
    num_hidden_units of a set of layers is specified as a list of ints"""
    if type(val) == list:
        return val
    else:

        return [int(v) for v in json.loads(val)]