(observer_or_fake_quant_ctr)
| 23 | |
| 24 | |
| 25 | def get_uint8_tensor_spec(observer_or_fake_quant_ctr): |
| 26 | return QuantizationSpec( |
| 27 | dtype=torch.uint8, |
| 28 | quant_min=0, |
| 29 | quant_max=255, |
| 30 | qscheme=torch.per_tensor_affine, |
| 31 | is_dynamic=False, |
| 32 | observer_or_fake_quant_ctr=observer_or_fake_quant_ctr, |
| 33 | ) |
| 34 | |
| 35 | |
| 36 | @dataclass |