Skip to main content

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 226 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 229 of file TensorCore.h.

229 int axis = -1;

scale

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

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

Definition at line 227 of file TensorCore.h.

227 float scale = 1.0f;

scales

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

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

Definition at line 230 of file TensorCore.h.

230 std::vector<float> scales;

zero_point

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

Per-tensor zero point.

Definition at line 228 of file TensorCore.h.

228 int32_t zero_point = 0;

zero_points

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

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

Definition at line 231 of file TensorCore.h.

231 std::vector<int32_t> zero_points;

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


Generated via doxygen2docusaurus 2.0.0 by Doxygen 1.9.8.