1// RUN: flatbuffer_translate -mlir-to-tflite-flatbuffer %s -o - | flatbuffer_to_string - | FileCheck %s 2 3func @main(tensor<4 x f32>, tensor<4 x f32>, tensor<4 x f32>, tensor<4 x f32>) -> tensor<4 x f32> { 4// CHECK: { 5// CHECK-NEXT: version: 3, 6// CHECK-NEXT: operator_codes: [ { 7// CHECK-NEXT: deprecated_builtin_code: 27, 8// CHECK-NEXT: version: 1, 9// CHECK-NEXT: builtin_code: SVDF 10// CHECK-NEXT: } ], 11// CHECK-NEXT: subgraphs: [ { 12// CHECK-NEXT: tensors: [ { 13// CHECK-NEXT: shape: [ 4 ], 14// CHECK-NEXT: buffer: 1, 15// CHECK-NEXT: name: "arg0", 16// CHECK-NEXT: quantization: { 17// CHECK-EMPTY: 18// CHECK-NEXT: } 19// CHECK-NEXT: }, { 20// CHECK-NEXT: shape: [ 4 ], 21// CHECK-NEXT: buffer: 2, 22// CHECK-NEXT: name: "arg1", 23// CHECK-NEXT: quantization: { 24// CHECK-EMPTY: 25// CHECK-NEXT: } 26// CHECK-NEXT: }, { 27// CHECK-NEXT: shape: [ 4 ], 28// CHECK-NEXT: buffer: 3, 29// CHECK-NEXT: name: "arg2", 30// CHECK-NEXT: quantization: { 31// CHECK-EMPTY: 32// CHECK-NEXT: } 33// CHECK-NEXT: }, { 34// CHECK-NEXT: shape: [ 4 ], 35// CHECK-NEXT: buffer: 4, 36// CHECK-NEXT: name: "arg3", 37// CHECK-NEXT: quantization: { 38// CHECK-EMPTY: 39// CHECK-NEXT: } 40// CHECK-NEXT: }, { 41// CHECK-NEXT: shape: [ 4 ], 42// CHECK-NEXT: name: "Const", 43// CHECK-NEXT: quantization: { 44// CHECK-EMPTY: 45// CHECK-NEXT: }, 46// CHECK-NEXT: is_variable: true 47// CHECK-NEXT: }, { 48// CHECK-NEXT: shape: [ 4 ], 49// CHECK-NEXT: buffer: 6, 50// CHECK-NEXT: name: "tfl.svdf", 51// CHECK-NEXT: quantization: { 52// CHECK-EMPTY: 53// CHECK-NEXT: } 54// CHECK-NEXT: } ], 55// CHECK-NEXT: inputs: [ 0, 1, 2, 3 ], 56// CHECK-NEXT: outputs: [ 5 ], 57// CHECK-NEXT: operators: [ { 58// CHECK-NEXT: inputs: [ 0, 1, 2, 3, 4 ], 59// CHECK-NEXT: outputs: [ 5 ], 60// CHECK-NEXT: builtin_options_type: SVDFOptions, 61// CHECK-NEXT: builtin_options: { 62// CHECK-NEXT: rank: 2, 63// CHECK-NEXT: fused_activation_function: RELU 64// CHECK-NEXT: } 65// CHECK-NEXT: } ], 66// CHECK-NEXT: name: "main" 67// CHECK-NEXT: } ], 68// CHECK-NEXT: description: "MLIR Converted.", 69// CHECK-NEXT: buffers: [ { 70// CHECK-EMPTY: 71// CHECK-NEXT: }, { 72// CHECK-EMPTY: 73// CHECK-NEXT: }, { 74// CHECK-EMPTY: 75// CHECK-NEXT: }, { 76// CHECK-EMPTY: 77// CHECK-NEXT: }, { 78// CHECK-EMPTY: 79// CHECK-NEXT: }, { 80// CHECK-NEXT: data: [ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 ] 81// CHECK-NEXT: }, { 82// CHECK-EMPTY: 83// CHECK-NEXT: }, { 84// CHECK-NEXT: data: [ 49, 46, 53, 46, 48, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 ] 85// CHECK-NEXT: } ], 86// CHECK-NEXT: metadata: [ { 87// CHECK-NEXT: name: "min_runtime_version", 88// CHECK-NEXT: buffer: 7 89// CHECK-NEXT: } ] 90// CHECK-NEXT: signature_defs: [ ] 91// CHECK-NEXT: } 92// CHECK-EMPTY: 93 94^bb0(%arg0: tensor<4 x f32>, %arg1: tensor<4 x f32>, %arg2: tensor<4 x f32>, %arg3: tensor<4 x f32>): 95 %0 = "tfl.pseudo_const" () {value = dense<0.0> : tensor<4xf32>} : () -> tensor<4xf32> loc("Const") 96 %1 = "tfl.svdf"(%arg0, %arg1, %arg2, %arg3, %0) {fused_activation_function = "RELU", rank = 2 : i32} : (tensor<4xf32>, tensor<4xf32>, tensor<4xf32>, tensor<4xf32>, tensor<4xf32>) -> tensor<4xf32> 97 return %1 : tensor<4xf32> 98} 99