diff --git a/hexagon/libhexagon_controller.so b/hexagon/libhexagon_controller.so index 0ff470a75cf04a6f489fdc9e2113c7ea09cb35e5..9ee02ba7d5993fec5db466c7675ed8e1e9951d78 100755 Binary files a/hexagon/libhexagon_controller.so and b/hexagon/libhexagon_controller.so differ diff --git a/python/tools/tf_converter.py b/python/tools/tf_converter.py index 8dd4d895d7a465612971fb5af86f8a6b8575a464..2849725d2267d7217e13e0bee295c940dbfecbff 100644 --- a/python/tools/tf_converter.py +++ b/python/tools/tf_converter.py @@ -32,7 +32,7 @@ def main(unused_args): if FLAGS.runtime == 'dsp': output_graph_def = tf_dsp_converter_lib.convert_to_mace_pb( - input_graph_def, FLAGS.input_node, FLAGS.output_node) + input_graph_def, FLAGS.input_node, FLAGS.output_node, FLAGS.dsp_mode) else: output_graph_def = tf_converter_lib.convert_to_mace_pb( input_graph_def, FLAGS.input_node, FLAGS.output_node, FLAGS.data_type, FLAGS.runtime, FLAGS.winograd) @@ -119,6 +119,11 @@ def parse_args(): const=False, default=False, help="open winograd convolution or not") + parser.add_argument( + "--dsp_mode", + type=int, + default=0, + help="dsp run mode, defalut=0") return parser.parse_known_args() diff --git a/python/tools/tf_dsp_converter_lib.py b/python/tools/tf_dsp_converter_lib.py index 8a4cfdad10d8042ec2e2782211db96dd23c0fa1a..f172e1b605051176ad966ae36b833144870bfeeb 100644 --- a/python/tools/tf_dsp_converter_lib.py +++ b/python/tools/tf_dsp_converter_lib.py @@ -359,7 +359,7 @@ def fuse_quantize(net_def, input_node, output_node): new_net_def.op.extend(new_ops) return new_net_def -def convert_to_mace_pb(input_graph_def, input_node, output_node): +def convert_to_mace_pb(input_graph_def, input_node, output_node, dsp_mode): """ nnlib does not have batch norm, so use tensorflow optimizer to fold batch norm with convolution. The fold optimization reorders ops, so @@ -394,5 +394,9 @@ def convert_to_mace_pb(input_graph_def, input_node, output_node): dtype = mace_pb2.DT_FLOAT final_net_def = add_input_output_info(net_def_with_node_id, input_node, output_node, graph, dtype) + arg = final_net_def.arg.add() + arg.name = 'dsp_mode' + arg.i = dsp_mode + return final_net_def