Created
August 7, 2022 04:56
-
-
Save jackalcooper/768be942112d39ce6672ae8bb4aecbc2 to your computer and use it in GitHub Desktop.
mlir generated for Nx.all_close
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
module { | |
func.func @"Elixir.Manx.Assert.-all_close_jit/3-fun-0-.126722613"(%arg0: tensor<3xf32>, %arg1: tensor<3xf32>) -> tensor<i8> { | |
%0 = "tosa.const"() {value = dense<9.99999974E-5> : tensor<f32>} : () -> tensor<f32> | |
%1 = "tosa.const"() {value = dense<0x7F800000> : tensor<3xf32>} : () -> tensor<3xf32> | |
%2 = "tosa.abs"(%arg0) : (tensor<3xf32>) -> tensor<3xf32> | |
%3 = "tosa.equal"(%2, %1) : (tensor<3xf32>, tensor<3xf32>) -> tensor<3xi1> | |
%4 = "tosa.cast"(%3) : (tensor<3xi1>) -> tensor<3xi8> | |
%5 = "tosa.abs"(%arg1) : (tensor<3xf32>) -> tensor<3xf32> | |
%6 = "tosa.equal"(%5, %1) : (tensor<3xf32>, tensor<3xf32>) -> tensor<3xi1> | |
%7 = "tosa.cast"(%6) : (tensor<3xi1>) -> tensor<3xi8> | |
%8 = "tosa.cast"(%4) : (tensor<3xi8>) -> tensor<3xi1> | |
%9 = "tosa.cast"(%7) : (tensor<3xi8>) -> tensor<3xi1> | |
%10 = "tosa.logical_or"(%8, %9) : (tensor<3xi1>, tensor<3xi1>) -> tensor<3xi1> | |
%11 = "tosa.cast"(%10) : (tensor<3xi1>) -> tensor<3xi8> | |
%12 = "tosa.cast"(%11) : (tensor<3xi8>) -> tensor<3xi1> | |
%13 = "tosa.equal"(%arg1, %arg0) : (tensor<3xf32>, tensor<3xf32>) -> tensor<3xi1> | |
%14 = "tosa.cast"(%13) : (tensor<3xi1>) -> tensor<3xi8> | |
%15 = "tosa.sub"(%arg0, %arg1) : (tensor<3xf32>, tensor<3xf32>) -> tensor<3xf32> | |
%16 = "tosa.abs"(%15) : (tensor<3xf32>) -> tensor<3xf32> | |
%17 = "tosa.abs"(%arg1) : (tensor<3xf32>) -> tensor<3xf32> | |
%18 = "tosa.mul"(%17, %0) {shift = 0 : i32} : (tensor<3xf32>, tensor<f32>) -> tensor<3xf32> | |
%19 = "tosa.add"(%18, %0) : (tensor<3xf32>, tensor<f32>) -> tensor<3xf32> | |
%20 = "tosa.cast"(%16) : (tensor<3xf32>) -> tensor<3xi8> | |
%21 = "tosa.cast"(%19) : (tensor<3xf32>) -> tensor<3xi8> | |
%22 = "tosa.greater_equal"(%21, %20) : (tensor<3xi8>, tensor<3xi8>) -> tensor<3xi1> | |
%23 = "tosa.cast"(%22) : (tensor<3xi1>) -> tensor<3xi8> | |
%24 = "tosa.select"(%12, %14, %23) : (tensor<3xi1>, tensor<3xi8>, tensor<3xi8>) -> tensor<3xi8> | |
%25 = "tosa.cast"(%24) : (tensor<3xi8>) -> tensor<3xi1> | |
%26 = "tosa.reduce_all"(%25) {axis = 0 : i64} : (tensor<3xi1>) -> tensor<1xi1> | |
%27 = "tosa.cast"(%26) : (tensor<1xi1>) -> tensor<1xi8> | |
%28 = tensor.collapse_shape %27 [] : tensor<1xi8> into tensor<i8> | |
return %28 : tensor<i8> | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
generated one by one