// Autogenerated by Kumi Codegen for schema KUMI_9a37856ac6ad5b4760bc2a1153db17b783c7519ab8eb01a2d993361a72bf68df
export class KumiCompiledModule {
  _global_offset_plus(input) {
    let t1 = input["global_offset"];
    const t2 = 1.0;
    let t3 = t1 + t2;
    return t3;
  }

  _batch_bias(input) {
    let out = [];
    let t4 = input["batch"];
    let t54 = input["global_offset"];
    const t55 = 1.0;
    let t56 = t54 + t55;
    t4.forEach((batch_el_5, batch_i_6) => {
      let t7 = batch_el_5.mean;
      let t9 = t7 + t56;
      out.push(t9);
    });
    return out;
  }

  _row_scale2(input) {
    let out = [];
    let t10 = input["batch"];
    const t17 = 2.0;
    t10.forEach((batch_el_11, batch_i_12) => {
      let out_1 = [];
      let t13 = batch_el_11.row;
      t13.forEach((row_el_14, row_i_15) => {
        let t16 = row_el_14.scale;
        let t18 = t16 * t17;
        out_1.push(t18);
      });
      out.push(out_1);
    });
    return out;
  }

  _elem_affine(input) {
    let out = [];
    let t19 = input["batch"];
    let t81 = input["global_offset"];
    const t82 = 1.0;
    const t60 = 2.0;
    let t83 = t81 + t82;
    t19.forEach((batch_el_20, batch_i_21) => {
      let out_1 = [];
      let t22 = batch_el_20.row;
      let t64 = batch_el_20.mean;
      let t65 = t64 + t83;
      t22.forEach((row_el_23, row_i_24) => {
        let out_2 = [];
        let t25 = row_el_23.col;
        let t59 = row_el_23.scale;
        let t61 = t59 * t60;
        t25.forEach((col_el_26, col_i_27) => {
          let t28 = col_el_26.val;
          let t30 = t28 * t61;
          let t32 = t30 + t65;
          out_2.push(t32);
        });
        out_1.push(out_2);
      });
      out.push(out_1);
    });
    return out;
  }

  _row_sum_affine(input) {
    let out = [];
    let t33 = input["batch"];
    const t87 = 2.0;
    let t90 = input["global_offset"];
    const t91 = 1.0;
    let t92 = t90 + t91;
    t33.forEach((batch_el_34, batch_i_35) => {
      let out_1 = [];
      let t36 = batch_el_34.row;
      let t93 = batch_el_34.mean;
      let t94 = t93 + t92;
      t36.forEach((row_el_37, row_i_38) => {
        let acc_39 = 0.0;
        let t40 = row_el_37.col;
        let t86 = row_el_37.scale;
        let t88 = t86 * t87;
        t40.forEach((col_el_41, col_i_42) => {
          let t69 = col_el_41.val;
          let t71 = t69 * t88;
          let t73 = t71 + t94;
          acc_39 += t73;
        });
        out_1.push(acc_39);
      });
      out.push(out_1);
    });
    return out;
  }

  _batch_total_affine(input) {
    let out = [];
    let t45 = input["batch"];
    let t110 = input["global_offset"];
    const t111 = 1.0;
    const t101 = 2.0;
    let t112 = t110 + t111;
    t45.forEach((batch_el_46, batch_i_47) => {
      let acc_48 = 0.0;
      let t49 = batch_el_46.row;
      let t105 = batch_el_46.mean;
      let t106 = t105 + t112;
      t49.forEach((row_el_50, row_i_51) => {
        let acc77 = 0.0;
        let t78 = row_el_50.col;
        let t100 = row_el_50.scale;
        let t102 = t100 * t101;
        t78.forEach((col_el_41, col_i_42) => {
          let t107 = col_el_41.val;
          let t108 = t107 * t102;
          let t109 = t108 + t106;
          acc77 += t109;
        });
        acc_48 += acc77;
      });
      out.push(acc_48);
    });
    return out;
  }

}
