Skip to content

Commit

Permalink
Add a test to the importer to make sure we can add an axis
Browse files Browse the repository at this point in the history
  • Loading branch information
josel-amd committed Jun 13, 2024
1 parent d1b9bda commit 3f74dd0
Showing 1 changed file with 18 additions and 0 deletions.
18 changes: 18 additions & 0 deletions test/mlir/onnx/parse/test_pad_axes.onnxtext
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
// RUN: onnx-mlir --EmitONNXBasic --printIR %s | FileCheck %s

<
ir_version: 9,
opset_import: ["" : 19]
>
identity (float[1,2,3,4] x, int64[4] pads) => (float[1,2,3,4] y) {
axes = Constant <value = int64[2] axes {0,0}> ()
value = Constant <value = float[1] value {1}> ()
y = Pad <mode = "constant"> (x, pads, value, axes)
}

// CHECK-LABEL: func.func @main_graph
// CHECK-SAME: ([[PARAM_0_:%.+]]: tensor<1x2x3x4xf32> {onnx.name = "x"}, [[PARAM_1_:%.+]]: tensor<4xi64> {onnx.name = "pads"}) -> (tensor<1x2x3x4xf32> {onnx.name = "y"}) {
// CHECK: [[VAR_0_:%.+]] = onnx.Constant dense<0> : tensor<2xi64>
// CHECK: [[VAR_1_:%.+]] = onnx.Constant dense<1.000000e+00> : tensor<1xf32>
// CHECK: [[VAR_2_:%.+]] = "onnx.Pad"([[PARAM_0_]], [[PARAM_1_]], [[VAR_1_]], [[VAR_0_]]) {mode = "constant"} : (tensor<1x2x3x4xf32>, tensor<4xi64>, tensor<1xf32>, tensor<2xi64>) -> tensor<1x2x3x4xf32>
// CHECK: onnx.Return [[VAR_2_]] : tensor<1x2x3x4xf32>

0 comments on commit 3f74dd0

Please sign in to comment.