Exemplo n.º 1
0
def model_zoo_table(model_family):
    """Make MODEL_ZOO.md table for a given model family."""
    filename = _PYCLS_DIR + "/dev/model_{}.json"
    with open(filename.format("timing"), "r") as f:
        timings = json.load(f)
    with open(filename.format("error"), "r") as f:
        errors = json.load(f)
    names = [n for n in model_zoo.get_model_list() if model_family in n]
    table_rows = "\n".join(model_zoo_table_row(n, timings, errors) for n in names)
    table_template = "\n".join(_TABLE_TEMPLATE)
    return table_template.format(model_family=model_family, table_rows=table_rows)
Exemplo n.º 2
0
def generate_error_tests():
    """Generate error tests for every model in the model zoo."""
    keys = model_zoo.get_model_list()
    generate_tests("error", test_error, keys)
Exemplo n.º 3
0
def generate_timing_tests():
    """Generate timing tests for every model in the model zoo."""
    keys = model_zoo.get_model_list()
    generate_tests("timing", test_timing, keys)