Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions tools/convert_tool/caffe/caffe2tengine.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -307,6 +307,7 @@ int caffe_serializer::set_graph_input(ir_graph_t* graph, const te_caffe::NetPara
set_ir_tensor_shape(tensor, dims, dim_num);
}

tensor->tensor_type = TENSOR_TYPE_INPUT;
ir_node_t* node = create_ir_node(graph, val.c_str(), OP_INPUT, OP_VERSION);

int tensor_id = get_ir_tensor_index_from_name(graph, val.c_str());
Expand Down
2 changes: 1 addition & 1 deletion tools/quantize/quant_tool_int8.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -462,7 +462,7 @@ int main(int argc, char* argv[])
}
else
{
fprintf(stderr,"[Quant Tools Info]: algorithm not specified, using default type MIN MAX\n");
fprintf(stderr, "[Quant Tools Info]: algorithm not specified, using default type MIN MAX\n");
quant_tool.scale_file = "table_minmax.scale";
}

Expand Down
16 changes: 8 additions & 8 deletions tools/quantize/quant_tool_uint8.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -362,8 +362,8 @@ int QuantTool::activation_quant_tool()
absmax = std::max(abs(max_activation[i]), abs(min_activation[i]));
float threshold = compute_aciq_gaussian_clip(absmax, emlement_num, 8);

act_scale = 2*threshold / 255.f;
act_zero_point = int(threshold / act_scale);
act_scale = 2 * threshold / 255.f;
act_zero_point = int(threshold / act_scale);

if (act_scale == 0)
act_zero_point = 0;
Expand Down Expand Up @@ -395,7 +395,7 @@ int QuantTool::activation_quant_tool()
fclose(fp_aciq);
fprintf(stderr, "\r\n[Quant Tools Info]: Step 2, find original calibration table done, output ./table_aciq.scale\n");
}
else
else
{
/* save the calibration file with min-max algorithm */
FILE* fp_minmax = fopen("table_minmax.scale", "wb");
Expand Down Expand Up @@ -599,19 +599,19 @@ int main(int argc, char* argv[])
/* select algorithm */
if (quant_tool.algorithm_type == ALGORITHM_MIN_MAX)
{
quant_tool.scale_file = "table_minmax.scale";
}
else if(quant_tool.algorithm_type == ALGORITHM_KL)
quant_tool.scale_file = "table_minmax.scale";
}
else if (quant_tool.algorithm_type == ALGORITHM_KL)
{
quant_tool.scale_file = "table_kl.scale";
}
else if(quant_tool.algorithm_type == ALGORITHM_ACIQ)
else if (quant_tool.algorithm_type == ALGORITHM_ACIQ)
{
quant_tool.scale_file = "table_aciq.scale";
}
else
{
fprintf(stderr,"[Quant Tools Info]: algorithm not specified, using default type MIN MAX\n");
fprintf(stderr, "[Quant Tools Info]: algorithm not specified, using default type MIN MAX\n");
quant_tool.scale_file = "table_minmax.scale";
}

Expand Down