From 340f968f7470ed6161f047eef27572deaad24205 Mon Sep 17 00:00:00 2001 From: Sandeep Dasgupta Date: Sun, 4 Jun 2023 16:57:53 +0000 Subject: [PATCH] added an example of uniform_quantize with quantized operand --- docs/spec.md | 16 ++++++---------- 1 file changed, 6 insertions(+), 10 deletions(-) diff --git a/docs/spec.md b/docs/spec.md index 0a6ef1181fe..d264580702f 100644 --- a/docs/spec.md +++ b/docs/spec.md @@ -5612,12 +5612,8 @@ Formally, `result = (operand - zero_point(operand)) * scale(operand)`. #### Examples ```mlir -// %operand: 10 -%result = "stablehlo.uniform_dequantize"(%operand) : (tensor:f32, 0.5:-20>>) -> tensor -// %result: 15.0 - // %operand: [10, 10] -%result = "stablehlo.uniform_dequantize"(%operand) : (tensor<3x!quant.uniform:f32:0, {0.1:-30, 0.5:-20}>>) -> tensor<3xf32> +%result = "stablehlo.uniform_dequantize"(%operand) : (tensor<2x!quant.uniform:f32:0, {0.1:-30, 0.5:-20}>>) -> tensor<2xf32> // %result: [4.0, 15.0] ``` @@ -5663,12 +5659,12 @@ Formally, #### Examples ```mlir -// %operand: 15.0 -%result = "stablehlo.uniform_quantize"(%operand) : (tensor) -> tensor:f32, 0.5:-20>> -// %result: 10 - // %operand: [4.0, 15.0] -%result = "stablehlo.uniform_quantize"(%operand) : (tensor<3xf32>) -> tensor<3x!quant.uniform:f32:0, {0.1:-30, 0.5:-20}>> +%result = "stablehlo.uniform_quantize"(%operand) : (tensor<2xf32>) -> tensor<2x!quant.uniform:f32:0, {0.1:-30, 0.5:-20}>> +// %result: [10, 10] + +// %operand: [10, 10] +%result = "stablehlo.uniform_quantize"(%operand) : (tensor<2x!quant.uniform:f32:0, {0.1:-30, 0.5:-20}>>) -> tensor<2x!quant.uniform:f32:0, {0.1:-30, 0.5:-20}>> // %result: [10, 10] ```