(self, inputs)
| 113 | return output |
| 114 | |
| 115 | def quantize_binary(self, inputs): |
| 116 | input_flat = inputs.reshape(self.q_groups, -1) |
| 117 | n = input_flat.shape[1] |
| 118 | m = input_flat.norm(p=1, dim=1, keepdim=True).div(n) |
| 119 | output = input_flat.sign().mul(m) |
| 120 | output = output.reshape(inputs.shape).contiguous() |
| 121 | return output |
| 122 | |
| 123 | def mixed_fp16_quantize(self, input, input_q, index): |
| 124 | if self.q_mixed_fp16 and self.q_start_bits[index] >= (self.q_target_bits - 1): |
no test coverage detected