def METHOD_NAME(nn_define):
    nn_define_dict = nn_define
    nn_dict = dict(inspect.getmembers(nn))
    op_dict = dict(inspect.getmembers(operation))
    nn_dict.update(op_dict)
    class_name_list = []
    try:
        # submitted model have int prefixes, they make sure that layers are in
        # order
        add_dict = OrderedDict()
        keys = list(nn_define_dict.keys())
        keys = sorted(keys, key=lambda x: int(x.split('-')[0]))
        for k in keys:
            layer, class_name = recover_layer_from_dict(nn_define_dict[k], nn_dict)
            add_dict[k] = layer
            class_name_list.append(class_name)
    except BaseException:
        add_dict = OrderedDict()
        for k, v in nn_define_dict.items():
            layer, class_name = recover_layer_from_dict(v, nn_dict)
            add_dict[k] = layer
            class_name_list.append(class_name)
    if len(class_name_list) == 1 and class_name_list[0] == CustModel.__name__:
        # If there are only a CustModel, return the model only
        return list(add_dict.values())[0]
    else:
        return tSeq(add_dict)