include_quantization_kernels.h#

namespace ONNX_LIGHT_NAMESPACE
namespace onnx_backend_test
namespace kernel
class QuantizeLinear#
#include <include_quantization_kernels.h>

Per-tensor linear quantization of a FLOAT input x to an 8-bit integer output. The output element type is taken from y_zero_point (UINT8 or INT8); if y_zero_point is omitted the output is UINT8 with a zero point of 0.

Public Functions

inline explicit QuantizeLinear(const KernelContext &ctx)#
Tensor operator()(const Tensor &x, const Tensor &y_scale) const#

Omitted y_zero_point: output is UINT8 with zero point 0.

void operator()(const Tensor &x, const Tensor &y_scale, Tensor &output) const#
Tensor operator()(const Tensor &x, const Tensor &y_scale, const Tensor &y_zero_point) const#

Explicit y_zero_point: its data_type drives the output element type.

void operator()(const Tensor &x, const Tensor &y_scale, const Tensor &y_zero_point, Tensor &output) const#

Public Static Functions

static inline constexpr bool CanRunInPlace() noexcept#

Output element type (UINT8/INT8) differs from the FLOAT input element type, so storage can never be shared with an input.

Private Members

KernelContext ctx_#