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