Skip to content

Scale

class Scale

Struct for scale values.

Attributes

Name Description
scale_list
scale
is_uniform
zero_points Per-channel zero points for asymmetric quantization.
zero_point Uniform zero point for asymmetric quantization.
is_asymmetric Indicates whether asymmetric quantization is used.

scale_list

property scale_list: List[float]

scale

property scale: float

is_uniform

property is_uniform: bool

zero_points

property zero_points: List[int]

Per-channel zero points for asymmetric quantization.

zero_point

property zero_point: int

Uniform zero point for asymmetric quantization.

is_asymmetric

property is_asymmetric: bool

Indicates whether asymmetric quantization is used.

Methods

Name Description
__init__
from_cpp
__getitem__ Returns the scale value at the specified index.
__repr__

__init__

def __init__(
    self,
    scale: float,
    is_uniform: bool,
    scale_list: List[float],
    zero_point: int = 0,
    is_asymmetric: bool = False,
    zero_points: Optional[List[int]] = None,
)

from_cpp

def from_cpp(cls, _scale: _cQbRuntime.Scale)

__getitem__

def __getitem__(self, i: int) -> float

Returns the scale value at the specified index.

Parameters

  • i [in] — Index.

Returns

Scale value.

__repr__

def __repr__(self)