(self, act_range_momentum=0.95, quant_mode='symmetric')
| 26 | """ |
| 27 | |
| 28 | def __init__(self, act_range_momentum=0.95, quant_mode='symmetric'): |
| 29 | super(QuantAct, self).__init__() |
| 30 | |
| 31 | self.act_range_momentum = act_range_momentum |
| 32 | self.quant_mode = quant_mode |
| 33 | if quant_mode == 'symmetric': |
| 34 | self.act_function = SymQuantizer.apply |
| 35 | else: |
| 36 | self.act_function = AsymQuantizer.apply |
| 37 | |
| 38 | self.register_buffer('x_min_max', torch.zeros(2)) |
| 39 | |
| 40 | def forward(self, x, num_bits, *args): |
| 41 | """ |