Created by: baiyfbupt
新增自动设置pact clip超参的功能,只需要在训练前调用get_distribution
得到激活值分布,然后用pact_thres
计算pact参数初始值即可
var_dist = get_distribution(train_prog, act_names, exe, train_loader)
# calculate appropriate pact clip threshold
pact_alphas = pact_thres(var_dist)