[go: nahoru, domu]

Skip to content

Commit

Permalink
Integrate GitHub PR: openxla/stablehlo#1496 to MHLO.
Browse files Browse the repository at this point in the history
PiperOrigin-RevId: 543457854
  • Loading branch information
sdasgup3 authored and tensorflower-gardener committed Jun 26, 2023
1 parent 7655ec1 commit 581ca8a
Showing 1 changed file with 2 additions and 10 deletions.
12 changes: 2 additions & 10 deletions tensorflow/compiler/xla/mlir_hlo/tests/Dialect/mhlo/ops.mlir
Original file line number Diff line number Diff line change
Expand Up @@ -5678,7 +5678,7 @@ func.func @add_dependency(%data: tensor<4x16xf32>) -> tensor<4x16xf32> {

// -----

// CHECK: func @uniform_quantize
// CHECK-LABEL: func @uniform_quantize
func.func @uniform_quantize(%arg: tensor<16x16xf32>) -> tensor<16x16x!quant.uniform<ui8:f32, 34.0:16>> {
%0 = mhlo.uniform_quantize %arg : (tensor<16x16xf32>) -> tensor<16x16x!quant.uniform<ui8:f32, 34.0:16>>
func.return %0 : tensor<16x16x!quant.uniform<ui8:f32, 34.0:16>>
Expand All @@ -5694,7 +5694,7 @@ func.func @uniform_requantize(%arg: tensor<16x16x!quant.uniform<i8:f32, 5.0:20>>

// -----

// CHECK: func @uniform_dequantize
// CHECK-LABEL: func @uniform_dequantize
func.func @uniform_dequantize(%arg: tensor<16x16x!quant.uniform<i8:f32, 34.0:16>>) -> tensor<16x16xf32> {
%0 = mhlo.uniform_dequantize %arg : (tensor<16x16x!quant.uniform<i8:f32, 34.0:16>>) -> tensor<16x16xf32>
func.return %0 : tensor<16x16xf32>
Expand All @@ -5710,14 +5710,6 @@ func.func @uniform_dequantize_unranked(%arg: tensor<*x!quant.uniform<i8:f32, 34.

// -----

func.func @uniform_dequantize_not_quantize(%arg: tensor<16x16xf32>) -> tensor<16x16xf32> {
// expected-error@+1 {{operand #0 must be tensor of 4/8/16/32-bit uniform quantized signed integer or 4/8/16/32-bit uniform quantized unsigned integer values, but got 'tensor<16x16xf32>'}}
%0 = mhlo.uniform_dequantize %arg : (tensor<16x16xf32>) -> tensor<16x16xf32>
func.return %0 : tensor<16x16xf32>
}

// -----

// CHECK-LABEL: func @quantized_constants
func.func @quantized_constants() -> (tensor<2x!quant.uniform<i8:f32, 2.0:15>>, tensor<2x!quant.uniform<ui8:f32, 34.0:16>>, tensor<2x!quant.uniform<i8:f32, 2.0:15>>) {
%0 = mhlo.constant() {value = dense<[1, 2]> : tensor<2xi8>} : () -> tensor<2x!quant.uniform<i8:f32, 2.000000e+00:15>>
Expand Down

0 comments on commit 581ca8a

Please sign in to comment.