提交 1770a45b 编写于 作者: 刘琦

Merge branch 'generate-header' into 'master'

Add bazel build opt to support multiple model for mace_run.

See merge request !166
......@@ -21,7 +21,7 @@ using namespace std;
using namespace mace;
namespace mace {
extern NetDef CreateGCN512();
extern NetDef MACE_MODEL_FUNCTION();
}
void ParseShape(const string &str, vector<index_t> *shape) {
string tmp = str;
......@@ -95,7 +95,7 @@ int main(int argc, char **argv) {
// NetDef net_def;
// net_def.ParseFromIstream(&file_stream);
// file_stream.close();
NetDef net_def = mace::CreateGCN512();
NetDef net_def = mace::MACE_MODEL_FUNCTION();
DeviceType device_type = ParseDeviceType(device);
VLOG(0) << device_type;
......
......@@ -46,10 +46,12 @@ bazel-bin/mace/python/tools/tf_converter --input=${TF_MODEL_FILE_PATH} \
# Step 3: Run model on the phone
echo "Step 3: Run model on the phone"
echo Create${MODEL_TAG}
bazel build -c opt --strip always mace/examples:mace_run \
--crosstool_top=//external:android/crosstool \
--host_crosstool_top=@bazel_tools//tools/cpp:toolchain \
--cpu=arm64-v8a
--cpu=arm64-v8a \
--copt=-DMACE_MODEL_FUNCTION=Create${MODEL_TAG}
adb shell "mkdir -p ${PHONE_DATA_DIR}"
adb shell "mkdir -p ${KERNEL_DIR}"
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册