module {
  func.func @main(%x: tensor<2x7xf32>, %gain: tensor<2x7xf32>, %upstream: tensor<2x7xf32>) -> (tensor<2x7xf32>, tensor<2x7xf32>, tensor<2x7xf32>) {
    %v0 = stablehlo.constant dense<0.00000000000000000e+00> : tensor<2x7xf32>
    %v1 = stablehlo.constant dense<1.00000000000000000e+00> : tensor<2x7xf32>
    %v2 = stablehlo.multiply %x, %x : 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.constant dense<1.00000000000000008e-05> : tensor<2x7xf32>
    %v9 = stablehlo.add %v7, %v8 : tensor<2x7xf32>
    %v10 = stablehlo.sqrt %v9 : tensor<2x7xf32>
    %v11 = stablehlo.divide %v1, %v10 : tensor<2x7xf32>
    %v12 = stablehlo.multiply %x, %v11 : tensor<2x7xf32>
    %v13 = stablehlo.multiply %gain, %v12 : tensor<2x7xf32>
    %v14 = stablehlo.multiply %upstream, %gain : tensor<2x7xf32>
    %v15 = stablehlo.multiply %v14, %v12 : tensor<2x7xf32>
    %v16 = stablehlo.reduce(%v15 init: %v3) applies stablehlo.add across dimensions = [1] : (tensor<2x7xf32>, tensor<f32>) -> tensor<2xf32>
    %v17 = stablehlo.broadcast_in_dim %v16, dims = [0] : (tensor<2xf32>) -> tensor<2x7xf32>
    %v18 = stablehlo.divide %v17, %v6 : tensor<2x7xf32>
    %v19 = stablehlo.multiply %v12, %v18 : tensor<2x7xf32>
    %v20 = stablehlo.subtract %v14, %v19 : tensor<2x7xf32>
    %v21 = stablehlo.multiply %v11, %v20 : tensor<2x7xf32>
    %v22 = stablehlo.multiply %upstream, %v12 : tensor<2x7xf32>
    return %v13, %v21, %v22 : tensor<2x7xf32>, tensor<2x7xf32>, tensor<2x7xf32>
  }
}
