Skip to content

Commit a8fbda3

Browse files
liufengdbtensorflower-gardener
authored andcommitted
Merge the tf.FakeQuant* unwrapping logic and inserting QDQ logic into the same step
By this change, the QDQ can be inserted immediately after the tf.FakeQuant* ops being unwrapped. This makes the QDQ inserting more flexible because all the min/max operands of the tf.FakeQuant* ops have been folded already. This patch also moves the related rewrites from the prepare_tf file to the fake_quant_utils. PiperOrigin-RevId: 366826396 Change-Id: Ic1ed93913fcf88032b4df405d5aa4068bfdfcb04
1 parent 8a3ef14 commit a8fbda3

4 files changed

Lines changed: 253 additions & 224 deletions

File tree

‎tensorflow/compiler/mlir/lite/tests/prepare-tf.mlir‎

Lines changed: 80 additions & 47 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
// RUN: tf-opt -tfl-prepare-tf %s | FileCheck %s
22
// RUN: tf-opt %s -tf-layout-optimization=force-data-format=NHWC -tfl-prepare-tf | FileCheck --check-prefix=LAYOUT --dump-input=always %s
3+
// RUN: tf-opt %s -tfl-raise-custom-ops -tfl-prepare-tf -tfl-test-raise-tf-targets="tf.FakeQuantWithMinMaxVarsPerChannel,tf.FakeQuantWithMinMaxVars" | FileCheck --check-prefix=FAKEQUANT %s
34

45
module attributes {tf.versions = {bad_consumers = [], min_consumer = 0 : i32, producer = 268 : i32}} {
56

@@ -192,7 +193,7 @@ func @WrappedFakeQuantFolded() -> tensor<8xf32> {
192193
// CHECK: return %[[DEQUANTIZE]] : tensor<8xf32>
193194
}
194195

195-
// CHECK-LABEL: fakeQuantFolded
196+
// FAKEQUANT-LABEL: fakeQuantFolded
196197
func @fakeQuantFolded() -> (tensor<8xf32>) {
197198
%in = constant dense<0.0> : tensor<8xf32>
198199
%min = constant dense<0.0> : tensor<f32>
@@ -202,10 +203,42 @@ func @fakeQuantFolded() -> (tensor<8xf32>) {
202203
%rst = "tf.FakeQuantWithMinMaxVars"(%in, %mini, %maxi) {num_bits = 3, narrow_range = false} : (tensor<8xf32>, tensor<f32>, tensor<f32>) -> tensor<8xf32>
203204
return %rst : tensor<8xf32>
204205

205-
// CHECK: %[[CONSTANT:.*]] = constant dense<0.000000e+00> : tensor<8xf32>
206-
// CHECK: %[[QUANTIZE:.*]] = "tfl.quantize"(%[[CONSTANT]]) {qtype = tensor<8x!quant.uniform<u8:f32, 1.000000e+00>>}
207-
// CHECK: %[[DEQUANTIZE:.*]] = "tfl.dequantize"(%[[QUANTIZE]])
208-
// CHECK: return %[[DEQUANTIZE]] : tensor<8xf32>
206+
// FAKEQUANT: %[[CONSTANT:.*]] = constant dense<0.000000e+00> : tensor<8xf32>
207+
// FAKEQUANT: %[[QUANTIZE:.*]] = "tfl.quantize"(%[[CONSTANT]]) {qtype = tensor<8x!quant.uniform<u8:f32, 1.000000e+00>>}
208+
// FAKEQUANT: %[[DEQUANTIZE:.*]] = "tfl.dequantize"(%[[QUANTIZE]])
209+
// FAKEQUANT: return %[[DEQUANTIZE]] : tensor<8xf32>
210+
}
211+
212+
// FAKEQUANT-LABEL: fakeQuantFoldedWithoutIdentity
213+
func @fakeQuantFoldedWithoutIdentity() -> (tensor<8xf32>) {
214+
%in = constant dense<0.0> : tensor<8xf32>
215+
%min = constant dense<0.0> : tensor<f32>
216+
%max = constant dense<255.0> : tensor<f32>
217+
%rst = "tf.FakeQuantWithMinMaxVars"(%in, %min, %max) {num_bits = 3, narrow_range = false} : (tensor<8xf32>, tensor<f32>, tensor<f32>) -> tensor<8xf32>
218+
return %rst : tensor<8xf32>
219+
220+
// FAKEQUANT: %[[CONSTANT:.*]] = constant dense<0.000000e+00> : tensor<8xf32>
221+
// FAKEQUANT: %[[QUANTIZE:.*]] = "tfl.quantize"(%[[CONSTANT]]) {qtype = tensor<8x!quant.uniform<u8:f32, 1.000000e+00>>}
222+
// FAKEQUANT: %[[DEQUANTIZE:.*]] = "tfl.dequantize"(%[[QUANTIZE]])
223+
// FAKEQUANT: return %[[DEQUANTIZE]] : tensor<8xf32>
224+
}
225+
226+
// FAKEQUANT-LABEL: fakeQuantFoldedWithCast
227+
func @fakeQuantFoldedWithCast() -> (tensor<8xf32>) {
228+
%in = constant dense<0.0> : tensor<8xf32>
229+
%min = constant dense<0.0> : tensor<f32>
230+
%max = constant dense<255.0> : tensor<f32>
231+
%mini = "tf.Identity"(%min) : (tensor<f32>) -> tensor<f32>
232+
%maxi = "tf.Identity"(%max) : (tensor<f32>) -> tensor<f32>
233+
%minc = "tf.Cast"(%mini) : (tensor<f32>) -> tensor<f32>
234+
%maxc = "tf.Cast"(%maxi) : (tensor<f32>) -> tensor<f32>
235+
%rst = "tf.FakeQuantWithMinMaxVars"(%in, %minc, %maxc) {num_bits = 3, narrow_range = false} : (tensor<8xf32>, tensor<f32>, tensor<f32>) -> tensor<8xf32>
236+
return %rst : tensor<8xf32>
237+
238+
// FAKEQUANT: %[[CONSTANT:.*]] = constant dense<0.000000e+00> : tensor<8xf32>
239+
// FAKEQUANT: %[[QUANTIZE:.*]] = "tfl.quantize"(%[[CONSTANT]]) {qtype = tensor<8x!quant.uniform<u8:f32, 1.000000e+00>>}
240+
// FAKEQUANT: %[[DEQUANTIZE:.*]] = "tfl.dequantize"(%[[QUANTIZE]])
241+
// FAKEQUANT: return %[[DEQUANTIZE]] : tensor<8xf32>
209242
}
210243

211244
// CHECK-LABEL: fakeQuantNotFolded
@@ -296,7 +329,7 @@ func @QDQFollowedByRank(%arg0: tensor<1x2xf32>) -> (tensor<i32>) {
296329
// CHECK: return %cst : tensor<i32>
297330
}
298331

299-
// CHECK-LABEL: fakeQuantWithConv2D
332+
// FAKEQUANT-LABEL: fakeQuantWithConv2D
300333
func @fakeQuantWithConv2D(tensor<256x32x32x3xf32>) -> (tensor<256x8x7x16xf32>) {
301334
^bb0(%arg: tensor<256x32x32x3xf32>) :
302335
%in = constant dense<0.0> : tensor<3x3x3x16xf32>
@@ -308,15 +341,15 @@ func @fakeQuantWithConv2D(tensor<256x32x32x3xf32>) -> (tensor<256x8x7x16xf32>) {
308341
%rst = "tf.Conv2D"(%arg, %fq) {T = "tfdtype$DT_FLOAT", data_format = "NHWC", dilations = [1, 2, 3, 1], padding = "SAME", strides = [1, 4, 5, 1]} : (tensor<256x32x32x3xf32>, tensor<3x3x3x16xf32>) -> tensor<256x8x7x16xf32>
309342
return %rst : tensor<256x8x7x16xf32>
310343

311-
// CHECK: %[[CONSTANT:.*]] = constant dense<0.000000e+00> : tensor<16xf32>
312-
// CHECK: %[[CONSTANT0:.*]] = constant dense<0.000000e+00> : tensor<16x3x3x3xf32>
313-
// CHECK: %[[QUANTIZE:.*]] = "tfl.quantize"(%[[CONSTANT0]]) {qtype = tensor<16x3x3x3x!quant.uniform<u8:f32, 1.000000e+00>>}
314-
// CHECK: %[[DEQUANTIZE:.*]] = "tfl.dequantize"(%[[QUANTIZE]])
315-
// CHECK: %[[CONV:.*]] = "tfl.conv_2d"(%arg0, %[[DEQUANTIZE]], %[[CONSTANT]])
316-
// CHECK: return %[[CONV]]
344+
// FAKEQUANT: %[[CONSTANT:.*]] = constant dense<0.000000e+00> : tensor<16xf32>
345+
// FAKEQUANT: %[[CONSTANT0:.*]] = constant dense<0.000000e+00> : tensor<16x3x3x3xf32>
346+
// FAKEQUANT: %[[QUANTIZE:.*]] = "tfl.quantize"(%[[CONSTANT0]]) {qtype = tensor<16x3x3x3x!quant.uniform<u8:f32, 1.000000e+00>>}
347+
// FAKEQUANT: %[[DEQUANTIZE:.*]] = "tfl.dequantize"(%[[QUANTIZE]])
348+
// FAKEQUANT: %[[CONV:.*]] = "tfl.conv_2d"(%arg0, %[[DEQUANTIZE]], %[[CONSTANT]])
349+
// FAKEQUANT: return %[[CONV]]
317350
}
318351

319-
// CHECK-LABEL: perChannelFakeQuantWithConv2D
352+
// FAKEQUANT-LABEL: perChannelFakeQuantWithConv2D
320353
func @perChannelFakeQuantWithConv2D(tensor<256x32x32x3xf32>) -> (tensor<256x8x7x16xf32>) {
321354
^bb0(%arg: tensor<256x32x32x3xf32>) :
322355
%in = constant dense<0.0> : tensor<3x3x3x16xf32>
@@ -328,16 +361,16 @@ func @perChannelFakeQuantWithConv2D(tensor<256x32x32x3xf32>) -> (tensor<256x8x7x
328361
%rst = "tf.Conv2D"(%arg, %fq) {T = "tfdtype$DT_FLOAT", data_format = "NHWC", dilations = [1, 2, 3, 1], padding = "SAME", strides = [1, 4, 5, 1]} : (tensor<256x32x32x3xf32>, tensor<3x3x3x16xf32>) -> tensor<256x8x7x16xf32>
329362
return %rst : tensor<256x8x7x16xf32>
330363

331-
// CHECK: %[[CONSTANT:.*]] = constant dense<0.000000e+00> : tensor<16xf32>
332-
// CHECK: %[[CONSTANT0:.*]] = constant dense<0.000000e+00> : tensor<16x3x3x3xf32>
333-
// CHECK: %[[QUANTIZE:.*]] = "tfl.quantize"(%[[CONSTANT0]]) {qtype = tensor<16x3x3x3x!quant.uniform<u8:f32:0,
334-
// CHECK-SAME: {1.000000e+00,1.000000e+00,1.000000e+00,1.000000e+00,1.000000e+00,1.000000e+00,1.000000e+00,1.000000e+00,1.000000e+00,1.000000e+00,1.000000e+00,1.000000e+00,1.000000e+00,1.000000e+00,1.000000e+00,1.000000e+00}>>
335-
// CHECK: %[[DEQUANTIZE:.*]] = "tfl.dequantize"(%[[QUANTIZE]])
336-
// CHECK: %[[CONV:.*]] = "tfl.conv_2d"(%arg0, %[[DEQUANTIZE]], %[[CONSTANT]])
337-
// CHECK: return %[[CONV]] : tensor<256x8x7x16xf32>
364+
// FAKEQUANT: %[[CONSTANT0:.*]] = constant dense<0.000000e+00> : tensor<16x3x3x3xf32>
365+
// FAKEQUANT: %[[CONSTANT:.*]] = constant dense<0.000000e+00> : tensor<16xf32>
366+
// FAKEQUANT: %[[QUANTIZE:.*]] = "tfl.quantize"(%[[CONSTANT0]]) {qtype = tensor<16x3x3x3x!quant.uniform<u8:f32:0,
367+
// FAKEQUANT-SAME: {1.000000e+00,1.000000e+00,1.000000e+00,1.000000e+00,1.000000e+00,1.000000e+00,1.000000e+00,1.000000e+00,1.000000e+00,1.000000e+00,1.000000e+00,1.000000e+00,1.000000e+00,1.000000e+00,1.000000e+00,1.000000e+00}>>
368+
// FAKEQUANT: %[[DEQUANTIZE:.*]] = "tfl.dequantize"(%[[QUANTIZE]])
369+
// FAKEQUANT: %[[CONV:.*]] = "tfl.conv_2d"(%arg0, %[[DEQUANTIZE]], %[[CONSTANT]])
370+
// FAKEQUANT: return %[[CONV]] : tensor<256x8x7x16xf32>
338371
}
339372

340-
// CHECK-LABEL: fakeQuantWithDepthwiseConv2D
373+
// FAKEQUANT-LABEL: fakeQuantWithDepthwiseConv2D
341374
func @fakeQuantWithDepthwiseConv2D(tensor<256x32x32x3xf32>) -> (tensor<256x30x30x16xf32>) {
342375
^bb0(%arg: tensor<256x32x32x3xf32>) :
343376
%in = constant dense<0.0> : tensor<3x3x3x16xf32>
@@ -349,15 +382,15 @@ func @fakeQuantWithDepthwiseConv2D(tensor<256x32x32x3xf32>) -> (tensor<256x30x30
349382
%rst = "tf.DepthwiseConv2dNative"(%arg, %fq) {T = "tfdtype$DT_FLOAT", data_format = "NHWC", dilations = [1, 2, 3, 1], padding = "SAME", strides = [1, 4, 5, 1]} : (tensor<256x32x32x3xf32>, tensor<3x3x3x16xf32>) -> tensor<256x30x30x16xf32>
350383
return %rst : tensor<256x30x30x16xf32>
351384

352-
// CHECK: %[[CONSTANT:.*]] = constant dense<0.000000e+00> : tensor<48xf32>
353-
// CHECK: %[[CONSTANT0:.*]] = constant dense<0.000000e+00> : tensor<1x3x3x48xf32>
354-
// CHECK: %[[QUANTIZE:.*]] = "tfl.quantize"(%[[CONSTANT0]]) {qtype = tensor<1x3x3x48x!quant.uniform<u8:f32, 1.000000e+00>>}
355-
// CHECK: %[[DEQUANTIZE:.*]] = "tfl.dequantize"(%[[QUANTIZE]])
356-
// CHECK: %[[CONV:.*]] = "tfl.depthwise_conv_2d"(%arg0, %[[DEQUANTIZE]], %[[CONSTANT]])
357-
// CHECK: return %[[CONV]]
385+
// FAKEQUANT: %[[CONSTANT:.*]] = constant dense<0.000000e+00> : tensor<48xf32>
386+
// FAKEQUANT: %[[CONSTANT0:.*]] = constant dense<0.000000e+00> : tensor<1x3x3x48xf32>
387+
// FAKEQUANT: %[[QUANTIZE:.*]] = "tfl.quantize"(%[[CONSTANT0]]) {qtype = tensor<1x3x3x48x!quant.uniform<u8:f32, 1.000000e+00>>}
388+
// FAKEQUANT: %[[DEQUANTIZE:.*]] = "tfl.dequantize"(%[[QUANTIZE]])
389+
// FAKEQUANT: %[[CONV:.*]] = "tfl.depthwise_conv_2d"(%arg0, %[[DEQUANTIZE]], %[[CONSTANT]])
390+
// FAKEQUANT: return %[[CONV]]
358391
}
359392

360-
// CHECK-LABEL: perChannelFakeQuantWithDepthwiseConv2D
393+
// FAKEQUANT-LABEL: perChannelFakeQuantWithDepthwiseConv2D
361394
func @perChannelFakeQuantWithDepthwiseConv2D(tensor<256x32x32x3xf32>) -> (tensor<256x30x30x16xf32>) {
362395
^bb0(%arg: tensor<256x32x32x3xf32>) :
363396
%in = constant dense<0.0> : tensor<3x3x3x16xf32>
@@ -369,18 +402,18 @@ func @perChannelFakeQuantWithDepthwiseConv2D(tensor<256x32x32x3xf32>) -> (tensor
369402
%rst = "tf.DepthwiseConv2dNative"(%arg, %fq) {T = "tfdtype$DT_FLOAT", data_format = "NHWC", dilations = [1, 2, 3, 1], padding = "SAME", strides = [1, 4, 5, 1]} : (tensor<256x32x32x3xf32>, tensor<3x3x3x16xf32>) -> tensor<256x30x30x16xf32>
370403
return %rst : tensor<256x30x30x16xf32>
371404

372-
// CHECK: %[[CONSTANT:.*]] = constant dense<0.000000e+00> : tensor<48xf32>
373-
// CHECK: %[[CONSTANT0:.*]] = constant dense<0.000000e+00> : tensor<1x3x3x48xf32>
374-
// CHECK: %[[QUANTIZE:.*]] = "tfl.quantize"(%[[CONSTANT0]]) {qtype = tensor<1x3x3x48x!quant.uniform<u8:f32:3,
375-
// CHECK-SAME: {1.000000e+00,1.000000e+00,1.000000e+00,1.000000e+00,1.000000e+00,1.000000e+00,1.000000e+00,1.000000e+00,1.000000e+00,1.000000e+00,1.000000e+00,1.000000e+00,1.000000e+00,1.000000e+00,1.000000e+00,1.000000e+00,
376-
// CHECK-SAME: 1.000000e+00,1.000000e+00,1.000000e+00,1.000000e+00,1.000000e+00,1.000000e+00,1.000000e+00,1.000000e+00,1.000000e+00,1.000000e+00,1.000000e+00,1.000000e+00,1.000000e+00,1.000000e+00,1.000000e+00,1.000000e+00,
377-
// CHECK-SAME: 1.000000e+00,1.000000e+00,1.000000e+00,1.000000e+00,1.000000e+00,1.000000e+00,1.000000e+00,1.000000e+00,1.000000e+00,1.000000e+00,1.000000e+00,1.000000e+00,1.000000e+00,1.000000e+00,1.000000e+00,1.000000e+00}>>}
378-
// CHECK: %[[DEQUANTIZE:.*]] = "tfl.dequantize"(%[[QUANTIZE]])
379-
// CHECK: %[[CONV:.*]] = "tfl.depthwise_conv_2d"(%arg0, %[[DEQUANTIZE]], %[[CONSTANT]])
380-
// CHECK: return %[[CONV]]
405+
// FAKEQUANT: %[[CONSTANT0:.*]] = constant dense<0.000000e+00> : tensor<1x3x3x48xf32>
406+
// FAKEQUANT: %[[CONSTANT:.*]] = constant dense<0.000000e+00> : tensor<48xf32>
407+
// FAKEQUANT: %[[QUANTIZE:.*]] = "tfl.quantize"(%[[CONSTANT0]]) {qtype = tensor<1x3x3x48x!quant.uniform<u8:f32:3,
408+
// FAKEQUANT-SAME: {1.000000e+00,1.000000e+00,1.000000e+00,1.000000e+00,1.000000e+00,1.000000e+00,1.000000e+00,1.000000e+00,1.000000e+00,1.000000e+00,1.000000e+00,1.000000e+00,1.000000e+00,1.000000e+00,1.000000e+00,1.000000e+00,
409+
// FAKEQUANT-SAME: 1.000000e+00,1.000000e+00,1.000000e+00,1.000000e+00,1.000000e+00,1.000000e+00,1.000000e+00,1.000000e+00,1.000000e+00,1.000000e+00,1.000000e+00,1.000000e+00,1.000000e+00,1.000000e+00,1.000000e+00,1.000000e+00,
410+
// FAKEQUANT-SAME: 1.000000e+00,1.000000e+00,1.000000e+00,1.000000e+00,1.000000e+00,1.000000e+00,1.000000e+00,1.000000e+00,1.000000e+00,1.000000e+00,1.000000e+00,1.000000e+00,1.000000e+00,1.000000e+00,1.000000e+00,1.000000e+00}>>}
411+
// FAKEQUANT: %[[DEQUANTIZE:.*]] = "tfl.dequantize"(%[[QUANTIZE]])
412+
// FAKEQUANT: %[[CONV:.*]] = "tfl.depthwise_conv_2d"(%arg0, %[[DEQUANTIZE]], %[[CONSTANT]])
413+
// FAKEQUANT: return %[[CONV]]
381414
}
382415

383-
// CHECK-LABEL: perChannelFakeQuantWithDepthwiseConv2DWithReshape
416+
// FAKEQUANT-LABEL: perChannelFakeQuantWithDepthwiseConv2DWithReshape
384417
func @perChannelFakeQuantWithDepthwiseConv2DWithReshape(%arg: tensor<1x160x160x48xf32>) -> (tensor<1x160x160x48xf32>) {
385418
%in = constant dense<0.0> : tensor<3x3x48x1xf32>
386419
%min = constant dense<0.0> : tensor<48xf32>
@@ -395,15 +428,15 @@ func @perChannelFakeQuantWithDepthwiseConv2DWithReshape(%arg: tensor<1x160x160x4
395428
%rst = "tf.DepthwiseConv2dNative"(%arg, %r2) {T = f32, data_format = "NHWC", dilations = [1, 1, 1, 1], padding = "SAME", strides = [1, 1, 1, 1]} : (tensor<1x160x160x48xf32>, tensor<3x3x48x1xf32>) -> tensor<1x160x160x48xf32>
396429
return %rst : tensor<1x160x160x48xf32>
397430

398-
// CHECK: %[[CONSTANT:.*]] = constant dense<0.000000e+00> : tensor<48xf32>
399-
// CHECK: %[[CONSTANT0:.*]] = constant dense<0.000000e+00> : tensor<1x3x3x48xf32>
400-
// CHECK: %[[QUANTIZE:.*]] = "tfl.quantize"(%[[CONSTANT0]]) {qtype = tensor<1x3x3x48x!quant.uniform<u8:f32:3,
401-
// CHECK-SAME: {1.000000e+00,1.000000e+00,1.000000e+00,1.000000e+00,1.000000e+00,1.000000e+00,1.000000e+00,1.000000e+00,1.000000e+00,1.000000e+00,1.000000e+00,1.000000e+00,1.000000e+00,1.000000e+00,1.000000e+00,1.000000e+00,
402-
// CHECK-SAME: 1.000000e+00,1.000000e+00,1.000000e+00,1.000000e+00,1.000000e+00,1.000000e+00,1.000000e+00,1.000000e+00,1.000000e+00,1.000000e+00,1.000000e+00,1.000000e+00,1.000000e+00,1.000000e+00,1.000000e+00,1.000000e+00,
403-
// CHECK-SAME: 1.000000e+00,1.000000e+00,1.000000e+00,1.000000e+00,1.000000e+00,1.000000e+00,1.000000e+00,1.000000e+00,1.000000e+00,1.000000e+00,1.000000e+00,1.000000e+00,1.000000e+00,1.000000e+00,1.000000e+00,1.000000e+00}>>}
404-
// CHECK: %[[DEQUANTIZE:.*]] = "tfl.dequantize"(%[[QUANTIZE]])
405-
// CHECK: %[[CONV:.*]] = "tfl.depthwise_conv_2d"(%arg0, %[[DEQUANTIZE]], %[[CONSTANT]])
406-
// CHECK: return %[[CONV]]
431+
// FAKEQUANT: %[[CONSTANT0:.*]] = constant dense<0.000000e+00> : tensor<1x3x3x48xf32>
432+
// FAKEQUANT: %[[CONSTANT:.*]] = constant dense<0.000000e+00> : tensor<48xf32>
433+
// FAKEQUANT: %[[QUANTIZE:.*]] = "tfl.quantize"(%[[CONSTANT0]]) {qtype = tensor<1x3x3x48x!quant.uniform<u8:f32:3,
434+
// FAKEQUANT-SAME: {1.000000e+00,1.000000e+00,1.000000e+00,1.000000e+00,1.000000e+00,1.000000e+00,1.000000e+00,1.000000e+00,1.000000e+00,1.000000e+00,1.000000e+00,1.000000e+00,1.000000e+00,1.000000e+00,1.000000e+00,1.000000e+00,
435+
// FAKEQUANT-SAME: 1.000000e+00,1.000000e+00,1.000000e+00,1.000000e+00,1.000000e+00,1.000000e+00,1.000000e+00,1.000000e+00,1.000000e+00,1.000000e+00,1.000000e+00,1.000000e+00,1.000000e+00,1.000000e+00,1.000000e+00,1.000000e+00,
436+
// FAKEQUANT-SAME: 1.000000e+00,1.000000e+00,1.000000e+00,1.000000e+00,1.000000e+00,1.000000e+00,1.000000e+00,1.000000e+00,1.000000e+00,1.000000e+00,1.000000e+00,1.000000e+00,1.000000e+00,1.000000e+00,1.000000e+00,1.000000e+00}>>}
437+
// FAKEQUANT: %[[DEQUANTIZE:.*]] = "tfl.dequantize"(%[[QUANTIZE]])
438+
// FAKEQUANT: %[[CONV:.*]] = "tfl.depthwise_conv_2d"(%arg0, %[[DEQUANTIZE]], %[[CONSTANT]])
439+
// FAKEQUANT: return %[[CONV]]
407440
}
408441

409442
func @identity(%arg0: tensor<10xi32>, %arg1: tensor<20xi32>, %arg2: tensor<30xi32>) -> (tensor<10xi32>, tensor<20xi32>, tensor<30xi32>) {

0 commit comments

Comments
 (0)