convert c config to lite::config
| 99 | |
| 100 | //! convert c config to lite::config |
| 101 | lite::Config convert_to_lite_config(const LiteConfig c_config) { |
| 102 | lite::Config lite_config; |
| 103 | lite_config.device_type = c_config.device_type; |
| 104 | if (c_config.bare_model_cryption_name) { |
| 105 | lite_config.bare_model_cryption_name = c_config.bare_model_cryption_name; |
| 106 | } |
| 107 | lite_config.backend = c_config.backend; |
| 108 | lite_config.has_compression = c_config.has_compression; |
| 109 | lite_config.device_id = c_config.device_id; |
| 110 | |
| 111 | lite_config.options.weight_preprocess = c_config.options.weight_preprocess; |
| 112 | lite_config.options.fuse_preprocess = c_config.options.fuse_preprocess; |
| 113 | lite_config.options.fake_next_exec = c_config.options.fake_next_exec; |
| 114 | lite_config.options.var_sanity_check_first_run = |
| 115 | c_config.options.var_sanity_check_first_run; |
| 116 | lite_config.options.const_shape = c_config.options.const_shape; |
| 117 | lite_config.options.force_dynamic_alloc = c_config.options.force_dynamic_alloc; |
| 118 | lite_config.options.force_output_use_user_specified_memory = |
| 119 | c_config.options.force_output_use_user_specified_memory; |
| 120 | lite_config.options.force_output_dynamic_alloc = |
| 121 | c_config.options.force_output_dynamic_alloc; |
| 122 | lite_config.options.no_profiling_on_shape_change = |
| 123 | c_config.options.no_profiling_on_shape_change; |
| 124 | lite_config.options.jit_level = c_config.options.jit_level; |
| 125 | lite_config.options.comp_node_seq_record_level = |
| 126 | c_config.options.comp_node_seq_record_level; |
| 127 | lite_config.options.graph_opt_level = c_config.options.graph_opt_level; |
| 128 | lite_config.options.async_exec_level = c_config.options.async_exec_level; |
| 129 | |
| 130 | lite_config.options.enable_nchw44 = c_config.options.enable_nchw44; |
| 131 | lite_config.options.enable_nchw44_dot = c_config.options.enable_nchw44_dot; |
| 132 | lite_config.options.enable_nchw88 = c_config.options.enable_nchw88; |
| 133 | lite_config.options.enable_nchw4 = c_config.options.enable_nchw4; |
| 134 | lite_config.options.enable_nhwcd4 = c_config.options.enable_nhwcd4; |
| 135 | lite_config.options.enable_nchw32 = c_config.options.enable_nchw32; |
| 136 | lite_config.options.enable_nchw64 = c_config.options.enable_nchw64; |
| 137 | |
| 138 | lite_config.auto_optimize_inference = c_config.auto_optimize_inference; |
| 139 | if (c_config.discrete_input_name) { |
| 140 | lite_config.discrete_input_name = c_config.discrete_input_name; |
| 141 | } |
| 142 | |
| 143 | return lite_config; |
| 144 | } |
| 145 | |
| 146 | //! convert C NetworkIO io to lite::NetworkIO |
| 147 | lite::NetworkIO convert_to_lite_io(const LiteNetworkIO c_network_io) { |
no outgoing calls
no test coverage detected