(self, tensor: torch.Tensor, config: TensorQuantizationConfig)
| 16 | register your delegator with executor.register_quantize_delegate |
| 17 | """ |
| 18 | def __call__(self, tensor: torch.Tensor, config: TensorQuantizationConfig) -> torch.Tensor: |
| 19 | if config.policy.has_property(QuantizationProperty.ASYMMETRICAL): |
| 20 | raise ValueError('Sorry, this delegator handles only Symmetrical Quantizations.') |
| 21 | print('You are invoking cusitmized quant function now.') |
| 22 | return torch.round(tensor / config.scale) * config.scale |
| 23 | |
| 24 | BATCHSIZE = 32 |
| 25 | INPUT_SHAPE = [3, 224, 224] |
nothing calls this directly
no test coverage detected