(input: Tensor,
scale_factor: Tensor,
dtype: str,
axis: int = -1)
| 753 | |
| 754 | |
| 755 | def quantize(input: Tensor, |
| 756 | scale_factor: Tensor, |
| 757 | dtype: str, |
| 758 | axis: int = -1) -> Tensor: |
| 759 | layer = default_trtnet().add_quantize(input.trt_tensor, |
| 760 | scale_factor.trt_tensor, |
| 761 | str_dtype_to_trt(dtype)) |
| 762 | layer.axis = axis |
| 763 | |
| 764 | output = _create_tensor(layer.get_output(0), layer) |
| 765 | |
| 766 | return output |
| 767 | |
| 768 | |
| 769 | def dequantize(input: Tensor, |