Перейти до основного вмісту

QuantSpec Struct

Quantization metadata for INT8/INT16 tensors. More...

Declaration​

struct simaai::neat::QuantSpec { ... }

Included Headers​

#include <TensorCore.h>

Public Member Attributes Index​

floatscale = 1.0f

Per-tensor scale (x_real = (x_int - zero_point) * scale). More...

int32_tzero_point = 0

Per-tensor zero point. More...

intaxis = -1

Channel axis for per-channel quantization (-1 = per-tensor). More...

std::vector< float >scales

Per-channel scales (used when axis >= 0). More...

std::vector< int32_t >zero_points

Per-channel zero points (used when axis >= 0). More...

Description​

Quantization metadata for INT8/INT16 tensors.

For per-tensor quantization, set scale and zero_point directly. For per-channel (typical for quantized weights), populate scales and zero_points and set axis to the channel dimension index.

Definition at line 232 of file TensorCore.h.

Public Member Attributes​

axis​

int simaai::neat::QuantSpec::axis = -1

Channel axis for per-channel quantization (-1 = per-tensor).

Definition at line 235 of file TensorCore.h.

scale​

float simaai::neat::QuantSpec::scale = 1.0f

Per-tensor scale (x_real = (x_int - zero_point) * scale).

Definition at line 233 of file TensorCore.h.

scales​

std::vector<float> simaai::neat::QuantSpec::scales

Per-channel scales (used when axis >= 0).

Definition at line 236 of file TensorCore.h.

zero_point​

int32_t simaai::neat::QuantSpec::zero_point = 0

Per-tensor zero point.

Definition at line 234 of file TensorCore.h.

zero_points​

std::vector<int32_t> simaai::neat::QuantSpec::zero_points

Per-channel zero points (used when axis >= 0).

Definition at line 237 of file TensorCore.h.


The documentation for this struct was generated from the following file:


Generated via doxygen2docusaurus 2.0.0 by Doxygen 1.9.8.