module { func.func @main(%new_logp: tensor<2x7xf32>, %old_logp: tensor<2x7xf32>, %advantage: tensor<2x7xf32>, %radius: tensor<2x7xf32>) -> (tensor<2x7xf32>, tensor<2x7xf32>) { %v0 = stablehlo.constant dense<0.00000000000000000e+00> : tensor<2x7xf32> %v1 = stablehlo.subtract %new_logp, %old_logp : tensor<2x7xf32> %v2 = stablehlo.exponential %v1 : tensor<2x7xf32> %v3 = stablehlo.constant dense<1.00000000000000000e+00> : tensor<2x7xf32> %v4 = stablehlo.subtract %v3, %radius : tensor<2x7xf32> %v5 = stablehlo.add %v3, %radius : tensor<2x7xf32> %v6 = stablehlo.maximum %v2, %v4 : tensor<2x7xf32> %v7 = stablehlo.minimum %v6, %v5 : tensor<2x7xf32> %v8 = stablehlo.multiply %v2, %advantage : tensor<2x7xf32> %v9 = stablehlo.multiply %v7, %advantage : tensor<2x7xf32> %v10 = stablehlo.minimum %v8, %v9 : tensor<2x7xf32> %v11 = stablehlo.constant dense<0.00000000000000000e+00> : tensor %v12 = stablehlo.reduce(%v10 init: %v11) applies stablehlo.add across dimensions = [1] : (tensor<2x7xf32>, tensor) -> tensor<2xf32> %v13 = stablehlo.broadcast_in_dim %v12, dims = [0] : (tensor<2xf32>) -> tensor<2x7xf32> %v14 = stablehlo.constant dense<7.0> : tensor<2x7xf32> %v15 = stablehlo.divide %v13, %v14 : tensor<2x7xf32> %v16 = stablehlo.negate %v15 : tensor<2x7xf32> %v17 = stablehlo.subtract %v2, %v3 : tensor<2x7xf32> %v18 = stablehlo.abs %v17 : tensor<2x7xf32> %v19 = stablehlo.compare GT, %v18, %radius, FLOAT : (tensor<2x7xf32>, tensor<2x7xf32>) -> tensor<2x7xi1> %v20 = stablehlo.select %v19, %v3, %v0 : tensor<2x7xi1>, tensor<2x7xf32> %v21 = stablehlo.reduce(%v20 init: %v11) applies stablehlo.add across dimensions = [1] : (tensor<2x7xf32>, tensor) -> tensor<2xf32> %v22 = stablehlo.broadcast_in_dim %v21, dims = [0] : (tensor<2xf32>) -> tensor<2x7xf32> %v23 = stablehlo.divide %v22, %v14 : tensor<2x7xf32> return %v16, %v23 : tensor<2x7xf32>, tensor<2x7xf32> } }