Dequantize#

  • Domain: ai.rt

  • Since version: 1

Decodes a supported EncodedValueProto into the requested floating dtype without changing its logical shape. Rejects malformed layouts, unsupported dtypes, nonfinite reconstructions and output overflow. Supports the portable quantization and ORT MatMulNBits layouts, including model-catalogue type references.

Inputs

  • X (E): Structured quantized value.

Outputs

  • Y (T): Decoded tensor in the requested dtype.

Attributes

  • dtype (int): Required output TensorProto dtype: FLOAT, DOUBLE, FLOAT16 or BFLOAT16.

Type Constraints

  • E: Structured encoded value. Allowed types: struct.

  • T Allowed types: tensor(bfloat16), tensor(double), tensor(float), tensor(float16).

Examples#

test_cc_dequantize_int4

Node:
  ai.rt.Dequantize(Q) -> (Y)
  Attributes:
    dtype = 11
Inputs:

Outputs:
  Y: shape=(3,), dtype=float64
    [-1.,  0.,  1.]

test_cc_dequantize_nf4

Node:
  ai.rt.Dequantize(Q) -> (Y)
  Attributes:
    dtype = 11
Inputs:

Outputs:
  Y: shape=(3,), dtype=float64
    [-1.,  0.,  1.]

test_cc_dequantize_ternary

Node:
  ai.rt.Dequantize(Q) -> (Y)
  Attributes:
    dtype = 11
Inputs:

Outputs:
  Y: shape=(3,), dtype=float64
    [-1.,  0.,  1.]

test_cc_dequantize_tiled_float

Node:
  ai.rt.Dequantize(Q) -> (Y)
  Attributes:
    dtype = 11
Inputs:

Outputs:
  Y: shape=(3,), dtype=float64
    [-1.,  0.,  1.]

test_cc_quantize_int4

Node:
  ai.rt.Dequantize(Q) -> (Y)
  Attributes:
    dtype = 11
Inputs:
  Q: shape=(3,), dtype=float32
    [-1.,  0.,  1.]

Outputs:
  Y: shape=(3,), dtype=float64
    [-1.,  0.,  1.]

test_cc_quantize_nf4

Node:
  ai.rt.Dequantize(Q) -> (Y)
  Attributes:
    dtype = 11
Inputs:
  Q: shape=(3,), dtype=float32
    [-1.,  0.,  1.]

Outputs:
  Y: shape=(3,), dtype=float64
    [-1.,  0.,  1.]

test_cc_quantize_ternary

Node:
  ai.rt.Dequantize(Q) -> (Y)
  Attributes:
    dtype = 11
Inputs:
  Q: shape=(3,), dtype=float32
    [-1.,  0.,  1.]

Outputs:
  Y: shape=(3,), dtype=float64
    [-1.,  0.,  1.]

test_cc_quantize_tiled_float

Node:
  ai.rt.Dequantize(Q) -> (Y)
  Attributes:
    dtype = 11
Inputs:
  Q: shape=(3,), dtype=float32
    [-1.,  0.,  1.]

Outputs:
  Y: shape=(3,), dtype=float64
    [-1.,  0.,  1.]