
Dynamic quantization: static per-tensor weights, dynamic per-batch activations (hmdqnt)
Source:R/geron_w4a_native.R
morie_geron_dynamic_quantization_alt.RdDynamic quantization: static per-tensor weights, dynamic per-batch activations (hmdqnt)
Examples
V <- c(1, 2, 3, 4, 5, 6, 7, 8)
morie_geron_dynamic_quantization_alt(V)
#> $quantized
#> $quantized$weight
#> [1] 16 32 48 64 79 95 111 127
#>
#>
#> $scales
#> $scales$weight
#> [1] 0.06299213
#>
#>
#> $zero_points
#> $zero_points$weight
#> [1] 0
#>
#>
#> $dequantized
#> $dequantized$weight
#> [1] 1.007874 2.015748 3.023622 4.031496 4.976378 5.984252 6.992126 8.000000
#>
#>
#> $max_abs_error
#> $max_abs_error$weight
#> [1] 0.03149606
#>
#>
#> $compression
#> [1] 4
#>
#> $bits
#> [1] 8
#>
#> $dtype
#> [1] "int8"
#>
#> $symmetric
#> [1] TRUE
#>
#> $activation
#> NULL
#>
#> $estimate
#> [1] 0.03149606
#>
#> $n
#> [1] 8
#>
#> $method
#> [1] "per-tensor affine weight quantization with per-batch dynamic activation scaling"
#>