Exemplo n.º 1
0
def main():
    config_dict = create_config("tnn")
    tnn = Engine(config_dict)
    model_dict = tnn.prepare_models()
    device_dict = tnn.prepare_devices()
    tnn.set_config("model_dict", model_dict)
    tnn.set_config("device_dict", device_dict)

    tnn.prepare_models_for_devices()
    tnn.prepare_benchmark_assets_for_devices()
    bench_dict = tnn.run_bench()
    bench_str_list = tnn.generate_benchmark_summary(bench_dict)
    tnn.write_list_to_file(bench_str_list)
Exemplo n.º 2
0
def bench(name):
    if name is None:
        return
    config_dict = create_config(name)
    engine = Engine(config_dict)

    model_dict = engine.prepare_models()
    device_dict = engine.prepare_devices()
    engine.set_config("model_dict", model_dict)
    engine.set_config("device_dict", device_dict)

    engine.prepare_models_for_devices()
    engine.prepare_benchmark_assets_for_devices()

    bench_dict = engine.run_bench()

    bench_str_list = engine.generate_benchmark_summary(bench_dict)
    engine.write_list_to_file(bench_str_list)