| 198 | } |
| 199 | |
| 200 | void dump_output_data(node_t test_node) |
| 201 | { |
| 202 | tensor_t output_tensor = get_node_output_tensor(test_node, 0); |
| 203 | int dims[4]; |
| 204 | |
| 205 | get_tensor_shape(output_tensor, dims, 4); |
| 206 | |
| 207 | void* o_buf = get_tensor_buffer(output_tensor); |
| 208 | int data_type = get_tensor_data_type(output_tensor); |
| 209 | float scale = 0.1f; |
| 210 | int zero = 0; |
| 211 | if(data_type == TENGINE_DT_INT8 || data_type == TENGINE_DT_UINT8) |
| 212 | { |
| 213 | get_tensor_quant_param(output_tensor, &scale, &zero, 1); |
| 214 | printf("output scale: %f ,zero: %d\n", scale, zero); |
| 215 | } |
| 216 | |
| 217 | for(int i = 0; i < dims[1] * dims[0] * dims[2] * dims[3]; i++) |
| 218 | { |
| 219 | if(data_type == TENGINE_DT_FP32) |
| 220 | { |
| 221 | float* p = ( float* )o_buf; |
| 222 | std::cout << i << " " << p[i] << "\n"; |
| 223 | } |
| 224 | } |
| 225 | |
| 226 | release_graph_tensor(output_tensor); |
| 227 | } |
| 228 | |
| 229 | int main(int argc, char* argv[]) |
| 230 | { |
no test coverage detected