Data Structures

struct QuantInfo

struct QuantInfo {
  std::vector<float> zero_points;
  std::vector<float> scales;
  std::vector<int64_t> block_shape;
  bool operator==(const QuantInfo& other) const noexcept;
};
struct QuantInfo

Struct containing quantization information for a tensor.

Note

You can manipulate fixed-point data through this information.

Public Functions

bool operator==(const QuantInfo &other) const noexcept

Checks if the current QuantInfo object is equal to another QuantInfo object.

This function is used to to verify consistency when models are executed sequentially. If the QuantInfo objects are not equal, the Tensor::CastTo function must be called to convert the data to a consistent format. Ensuring consistent QuantInfo is crucial for correct data conversion and maintaining inference accuracy.

Parameters:

other -- [in] The QuantInfo object to compare with.

Returns:

Returns true if the two QuantInfo objects are equal. Otherwise, returns false.

Public Members

std::vector<int64_t> block_shape

The block_shape for quantization.

std::vector<float> scales

The scales for quantization.

std::vector<float> zero_points

The zero points for quantization.