MCPcopy Create free account
hub / github.com/XiaoMi/mace / build_engine

Function build_engine

tools/python/run_micro.py:43–57  ·  view source on GitHub ↗
(model_name, data_type, debug_mode=False)

Source from the content-addressed store, hash-verified

41
42
43def build_engine(model_name, data_type, debug_mode=False):
44 mace_check(flags.model_name is not None and len(model_name) > 0,
45 "you should specify model name for build.")
46 debug_option = "Debug" if debug_mode else "Release"
47 command = ("micro/tools/cmake/cmake-build-host.sh"
48 " -DMICRO_MODEL_NAME=%s -DMACE_MICRO_ENABLE_CMSIS=ON"
49 " -DMACE_MICRO_ENABLE_TOOLS=ON"
50 " -DCMAKE_BUILD_TYPE=%s" % (model_name, debug_option))
51 if data_type == mace_pb2.DT_BFLOAT16:
52 command += " -DMACE_MICRO_ENABLE_BFLOAT16=ON"
53 print("The current engine's data type is bfloat16.")
54 else:
55 command += " -DMACE_MICRO_ENABLE_BFLOAT16=OFF"
56
57 device.execute(command)
58
59
60def get_model_conf_by_name(flags, conf):

Callers 2

run_layers_validateFunction · 0.70
run_micro.pyFile · 0.70

Calls 1

mace_checkFunction · 0.90

Tested by

no test coverage detected