quantize method

int quantize(
  1. double value
)

Converts a real value to the nearest quantized value, without clamping it to the tensor type's range.

Implementation

int quantize(double value) => (value / scale).round() + zeroPoint;