module {
  func.func @main(%grad: tensor<2x7xf32>, %residual: tensor<2x7xf32>) -> (tensor<2x7xf32>, tensor<2x7xf32>, tensor<2x7xf32>) {
    %v0 = stablehlo.constant dense<0.00000000000000000e+00> : tensor<2x7xf32>
    %v1 = stablehlo.add %grad, %residual : tensor<2x7xf32>
    %v2 = stablehlo.abs %v1 : tensor<2x7xf32>
    %v3 = stablehlo.constant dense<0.00000000000000000e+00> : tensor<f32>
    %v4 = stablehlo.reduce(%v2 init: %v3) applies stablehlo.add across dimensions = [1] : (tensor<2x7xf32>, tensor<f32>) -> tensor<2xf32>
    %v5 = stablehlo.broadcast_in_dim %v4, dims = [0] : (tensor<2xf32>) -> tensor<2x7xf32>
    %v6 = stablehlo.constant dense<7.0> : tensor<2x7xf32>
    %v7 = stablehlo.divide %v5, %v6 : tensor<2x7xf32>
    %v8 = stablehlo.sign %v1 : tensor<2x7xf32>
    %v9 = stablehlo.multiply %v7, %v8 : tensor<2x7xf32>
    %v10 = stablehlo.subtract %v1, %v9 : tensor<2x7xf32>
    return %v9, %v10, %v7 : tensor<2x7xf32>, tensor<2x7xf32>, tensor<2x7xf32>
  }
}
