DAY9(Debug 了解代码)

在这里插入图片描述

Find concat OP

ConcatOp (OpNeedsQuantize,OpHasAxis)

Find the bottom layer of concat OP

parameter path

  • argv->dataset_param, quant_param, calibration_param
  • argv(model_name, quantize method, input_scale, ts_max_file, ts_min_file,…param)->aqt
  • aqt build with ir(dictionary, contains net_property, op_list, weights_dict) ->build function
  • aqt.quantize(statistic max and min files, calibrate, crop to relu6)
    if stats_status
    do something to self.op_dict_[op_id].top_max(.top_min)
    self.op_dict_[op_id] is the instance of op class
    self.op_dict_ is a map mapping op_id to op class
    op_id=self.top_op_map_[key_flow_node_]
  • op_id_list=sorted(self.op_dict_)
  • cur_op.quantize(input_scale_zp,quantize_param)
    input_scale_zp and out_scale_zp are dictionary
  • OpNeedsQuantilize(Op).quantilize:
    initialize accum_q_min,accum_q_max, by quantize_param
  • then goes to cur_op.quantize
  • update self.net_property_[qprec]

In concat quantization

  • quantize(self, input_scale_zp, quantize_param)
    input_scale_zp[self.bottom_[i]] is a dictionary, key:[‘scale’],[‘quantize_param’]
    self.out_scale_zp_={self.top_[0]:{‘scale’:out_scale,‘zp’:0}}
using debug!

ir (dictionary) saved op_list
aqt 中有top_op_map, mapping str to int
concat中的input_scale_zp中含有以名字为key的dictionary,内含scale和zp

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值