#include "Halide.h"

using namespace Halide;

inline void do_cost_model_schedule(Halide::Pipeline pipeline) {
    // Generated by autoscheduler, manually remove unrolls.
    // Also manually replaced all RoundUp and ShiftInwards with GuardWithIf.

    using ::Halide::Func;
    using ::Halide::MemoryType;
    using ::Halide::RVar;
    using ::Halide::TailStrategy;
    using ::Halide::Var;
    Func loss_output = pipeline.get_func(57);
    Func sum_1 = pipeline.get_func(56);
    Func f2 = pipeline.get_func(55);
    Func sum = pipeline.get_func(54);
    Func prediction_output = pipeline.get_func(53);
    Func updated_bias1 = pipeline.get_func(52);
    Func bias1_im_0_d_def__ = pipeline.get_func(51);
    Func conv1_stage1_0_d_def___1 = pipeline.get_func(50);
    Func updated_filter1 = pipeline.get_func(49);
    Func filter1_im_0_d_def__ = pipeline.get_func(48);
    Func updated_head2_bias = pipeline.get_func(47);
    Func head2_bias_im_0_d_def__ = pipeline.get_func(46);
    Func head2_conv_0_d_def___1 = pipeline.get_func(45);
    Func updated_head2_filter = pipeline.get_func(44);
    Func head2_filter_im_0_d_def__ = pipeline.get_func(43);
    Func head2_conv_1_d_def__ = pipeline.get_func(42);
    Func head2_relu_0_d_def__ = pipeline.get_func(41);
    Func updated_head1_bias = pipeline.get_func(40);
    Func head1_bias_im_0_d_def__ = pipeline.get_func(39);
    Func head1_conv_0_d_def___1 = pipeline.get_func(38);
    Func updated_head1_filter = pipeline.get_func(37);
    Func head1_filter_im_0_d_def__ = pipeline.get_func(36);
    Func squashed_head1_filter_0_d_def__ = pipeline.get_func(35);
    Func squashed_head1_filter_broadcast_0_d_def__ = pipeline.get_func(34);
    Func head1_conv_1_d_def__ = pipeline.get_func(33);
    Func conv1_stage1_1_d_def__ = pipeline.get_func(32);
    Func conv1_stage2_0_d_def___1 = pipeline.get_func(31);
    Func conv1_stage2_1_d_def__ = pipeline.get_func(30);
    Func sum_1_d_def__ = pipeline.get_func(29);
    Func relu1_0_d_def__ = pipeline.get_func(28);
    Func f0_0_d_def__ = pipeline.get_func(27);
    Func cost_per_stage_output_0_d_def__ = pipeline.get_func(26);
    Func f1_1_d_def__ = pipeline.get_func(25);
    Func f2_0_d_def__ = pipeline.get_func(23);
    Func sum_1_1_d_def__ = pipeline.get_func(22);
    Func loss_output_0_d_def__ = pipeline.get_func(21);
    Func adjoint = pipeline.get_func(20);
    Func f1 = pipeline.get_func(19);
    Func cost_per_stage_output = pipeline.get_func(18);
    Func f0 = pipeline.get_func(17);
    Func relu1 = pipeline.get_func(16);
    Func conv1_stage2 = pipeline.get_func(15);
    Func head2_relu = pipeline.get_func(14);
    Func head2_conv = pipeline.get_func(13);
    Func normalized_schedule_features = pipeline.get_func(12);
    Func conv1_stage1 = pipeline.get_func(8);
    Func head1_conv = pipeline.get_func(7);
    Func squashed_head1_filter_broadcast = pipeline.get_func(6);
    Func squashed_head1_filter = pipeline.get_func(5);
    Var c(head2_conv_0_d_def___1.get_schedule().dims()[0].var);
    Var ci("ci");
    Var n(sum.get_schedule().dims()[0].var);
    Var ni("ni");
    Var nii("nii");
    Var niii("niii");
    Var r1316_z(filter1_im_0_d_def__.update(0).get_schedule().dims()[2].var);
    Var r1512_y(filter1_im_0_d_def__.update(1).get_schedule().dims()[1].var);
    Var s(squashed_head1_filter_0_d_def__.get_schedule().dims()[1].var);
    Var si("si");
    Var v11(bias1_im_0_d_def__.get_schedule().dims()[0].var);
    Var v11i("v11i");
    Var v12(filter1_im_0_d_def__.get_schedule().dims()[0].var);
    Var v13(filter1_im_0_d_def__.get_schedule().dims()[1].var);
    Var v13i("v13i");
    Var v14(head1_bias_im_0_d_def__.get_schedule().dims()[0].var);
    Var v14i("v14i");
    Var v21(head2_bias_im_0_d_def__.get_schedule().dims()[0].var);
    Var v21i("v21i");
    Var v22(head2_filter_im_0_d_def__.get_schedule().dims()[0].var);
    Var v22i("v22i");
    Var v23(head2_filter_im_0_d_def__.get_schedule().dims()[1].var);
    Var v298(updated_head1_filter.get_schedule().dims()[0].var);
    Var v298i("v298i");
    Var v299(updated_head1_filter.get_schedule().dims()[1].var);
    Var v299i("v299i");
    Var v300(updated_head1_filter.get_schedule().dims()[2].var);
    Var v301(updated_head1_filter.get_schedule().dims()[3].var);
    Var v301i("v301i");
    Var v302(updated_head1_bias.get_schedule().dims()[0].var);
    Var v302i("v302i");
    Var v303(updated_head1_bias.get_schedule().dims()[1].var);
    Var v304(updated_head2_filter.get_schedule().dims()[0].var);
    Var v304i("v304i");
    Var v305(updated_head2_filter.get_schedule().dims()[1].var);
    Var v306(updated_head2_filter.get_schedule().dims()[2].var);
    Var v307(updated_head2_bias.get_schedule().dims()[0].var);
    Var v307i("v307i");
    Var v308(updated_head2_bias.get_schedule().dims()[1].var);
    Var v309(updated_filter1.get_schedule().dims()[0].var);
    Var v309i("v309i");
    Var v310(updated_filter1.get_schedule().dims()[1].var);
    Var v311(updated_filter1.get_schedule().dims()[2].var);
    Var v312(updated_bias1.get_schedule().dims()[0].var);
    Var v312i("v312i");
    Var v313(updated_bias1.get_schedule().dims()[1].var);
    Var w(head2_conv_0_d_def___1.get_schedule().dims()[1].var);
    Var wi("wi");
    RVar r1294_x(head2_relu_0_d_def__.update(0).get_schedule().dims()[0].var);
    RVar r1316_x(filter1_im_0_d_def__.update(0).get_schedule().dims()[0].var);
    RVar r1316_y(filter1_im_0_d_def__.update(0).get_schedule().dims()[1].var);
    RVar r1336_x(conv1_stage1_1_d_def__.update(0).get_schedule().dims()[0].var);
    RVar r1400_x(head2_filter_im_0_d_def__.update(0).get_schedule().dims()[0].var);
    RVar r1400_y(head2_filter_im_0_d_def__.update(0).get_schedule().dims()[1].var);
    RVar r1421_x(head2_bias_im_0_d_def__.update(0).get_schedule().dims()[0].var);
    RVar r1421_y(head2_bias_im_0_d_def__.update(0).get_schedule().dims()[1].var);
    RVar r1491_x(head1_conv_1_d_def__.update(0).get_schedule().dims()[0].var);
    RVar r1512_x(filter1_im_0_d_def__.update(1).get_schedule().dims()[0].var);
    RVar r1532_x(bias1_im_0_d_def__.update(0).get_schedule().dims()[0].var);
    RVar r1594_x(head1_bias_im_0_d_def__.update(0).get_schedule().dims()[0].var);
    RVar r1614_x(squashed_head1_filter_0_d_def__.update(0).get_schedule().dims()[0].var);
    RVar r31_x(head1_conv.update(0).get_schedule().dims()[0].var);
    RVar r31_y(head1_conv.update(0).get_schedule().dims()[1].var);
    RVar r40_x(head2_conv.update(0).get_schedule().dims()[0].var);
    RVar r54_x(conv1_stage1.update(0).get_schedule().dims()[0].var);
    RVar r63_x(conv1_stage2.update(0).get_schedule().dims()[0].var);
    RVar r81_x(f1.update(0).get_schedule().dims()[0].var);
    RVar r89_x(sum_1.update(0).get_schedule().dims()[0].var);
    RVar r94_x(sum.update(0).get_schedule().dims()[0].var);
    RVar r94_y(sum.update(0).get_schedule().dims()[1].var);
    loss_output
        .compute_root();
    sum_1
        .compute_root();
    sum_1.update(0);
    sum
        .split(n, n, ni, 8, TailStrategy::GuardWithIf)
        .vectorize(ni)
        .compute_root()
        .reorder(ni, n)
        .serial(n);
    sum.update(0)
        .split(n, n, ni, 8, TailStrategy::GuardWithIf)
        .vectorize(ni)
        .reorder(ni, r94_x, r94_y, n)
        .serial(n);
    prediction_output
        .split(n, n, ni, 8, TailStrategy::GuardWithIf)
        .vectorize(ni)
        .compute_root()
        .reorder(ni, n)
        .serial(n);
    updated_bias1
        .split(v312, v312, v312i, 8, TailStrategy::GuardWithIf)
        .vectorize(v312i)
        .compute_root()
        .reorder(v312i, v312, v313)
        .fuse(v312, v313, v312)
        .serial(v312);
    updated_bias1.update(0)
        .split(v312, v312, v312i, 8, TailStrategy::GuardWithIf)
        .vectorize(v312i)
        .reorder(v312i, v312)
        .serial(v312);
    updated_bias1.update(1)
        .split(v312, v312, v312i, 8, TailStrategy::GuardWithIf)
        .vectorize(v312i)
        .reorder(v312i, v312)
        .serial(v312);
    updated_bias1.update(2)
        .split(v312, v312, v312i, 8, TailStrategy::GuardWithIf)
        .vectorize(v312i)
        .reorder(v312i, v312)
        .serial(v312);
    updated_bias1.update(3)
        .split(v312, v312, v312i, 8, TailStrategy::GuardWithIf)
        .vectorize(v312i)
        .reorder(v312i, v312)
        .serial(v312);
    bias1_im_0_d_def__
        .split(v11, v11, v11i, 8, TailStrategy::GuardWithIf)
        .vectorize(v11i)
        .compute_at(updated_bias1, v312)
        .reorder(v11i, v11);
    bias1_im_0_d_def__.update(0)
        .split(v11, v11, v11i, 8, TailStrategy::GuardWithIf)
        .vectorize(v11i)
        .reorder(v11i, v11, r1532_x);
    updated_filter1
        .split(v309, v309, v309i, 8, TailStrategy::GuardWithIf)
        .vectorize(v309i)
        .compute_root()
        .reorder(v309i, v311, v309, v310)
        .fuse(v309, v310, v309)
        .serial(v309);
    updated_filter1.update(0)
        .split(v309, v309, v309i, 8, TailStrategy::GuardWithIf)
        .vectorize(v309i)
        .reorder(v309i, v309, v310)
        .fuse(v309, v310, v309)
        .serial(v309);
    updated_filter1.update(1)
        .split(v309, v309, v309i, 8, TailStrategy::GuardWithIf)
        .vectorize(v309i)
        .reorder(v309i, v309, v310)
        .fuse(v309, v310, v309)
        .serial(v309);
    updated_filter1.update(2)
        .split(v309, v309, v309i, 8, TailStrategy::GuardWithIf)
        .vectorize(v309i)
        .reorder(v309i, v309, v310)
        .fuse(v309, v310, v309)
        .serial(v309);
    updated_filter1.update(3)
        .split(v309, v309, v309i, 8, TailStrategy::GuardWithIf)
        .vectorize(v309i)
        .reorder(v309i, v309, v310)
        .fuse(v309, v310, v309)
        .serial(v309);
    filter1_im_0_d_def__
        .split(v13, v13, v13i, 8, TailStrategy::GuardWithIf)
        .vectorize(v13i)
        .compute_root()
        .reorder(v13i, v13, v12)
        .fuse(v13, v12, v13)
        .parallel(v13)
        .reorder_storage(v13, v12);
    filter1_im_0_d_def__.update(0)
        .reorder(r1316_z, r1316_x, r1316_y, v12)
        .vectorize(r1316_z, 8)
        .unroll(r1316_z)
        .parallel(v12);
    filter1_im_0_d_def__.update(1)
        .reorder(r1512_x, r1512_y, v12)
        .vectorize(r1512_y)
        .parallel(v12);
    updated_head2_bias
        .split(v307, v307, v307i, 8, TailStrategy::GuardWithIf)
        .vectorize(v307i)
        .compute_root()
        .reorder(v307i, v307, v308)
        .fuse(v307, v308, v307)
        .serial(v307);
    updated_head2_bias.update(0)
        .split(v307, v307, v307i, 8, TailStrategy::GuardWithIf)
        .vectorize(v307i)
        .reorder(v307i, v307)
        .serial(v307);
    updated_head2_bias.update(1)
        .split(v307, v307, v307i, 8, TailStrategy::GuardWithIf)
        .vectorize(v307i)
        .reorder(v307i, v307)
        .serial(v307);
    updated_head2_bias.update(2)
        .split(v307, v307, v307i, 8, TailStrategy::GuardWithIf)
        .vectorize(v307i)
        .reorder(v307i, v307)
        .serial(v307);
    updated_head2_bias.update(3)
        .split(v307, v307, v307i, 8, TailStrategy::GuardWithIf)
        .vectorize(v307i)
        .reorder(v307i, v307)
        .serial(v307);
    head2_bias_im_0_d_def__
        .split(v21, v21, v21i, 8, TailStrategy::GuardWithIf)
        .vectorize(v21i)
        .compute_at(updated_head2_bias, v307)
        .reorder(v21i, v21);
    head2_bias_im_0_d_def__.update(0)
        .split(v21, v21, v21i, 8, TailStrategy::GuardWithIf)
        .vectorize(v21i)
        .reorder(v21i, v21, r1421_x, r1421_y);
    head2_conv_0_d_def___1
        .store_in(MemoryType::Stack)
        .split(c, c, ci, 8, TailStrategy::GuardWithIf)
        .vectorize(ci)
        .compute_at(head2_bias_im_0_d_def__, v21)
        .reorder(ci, c, w, n);
    updated_head2_filter
        .split(v304, v304, v304i, 8, TailStrategy::GuardWithIf)
        .vectorize(v304i)
        .compute_root()
        .reorder(v304i, v306, v304, v305)
        .fuse(v304, v305, v304)
        .parallel(v304);
    updated_head2_filter.update(0)
        .split(v304, v304, v304i, 8, TailStrategy::GuardWithIf)
        .vectorize(v304i)
        .reorder(v304i, v304, v305)
        .fuse(v304, v305, v304)
        .parallel(v304);
    updated_head2_filter.update(1)
        .split(v304, v304, v304i, 8, TailStrategy::GuardWithIf)
        .vectorize(v304i)
        .reorder(v304i, v304, v305)
        .fuse(v304, v305, v304)
        .serial(v304);
    updated_head2_filter.update(2)
        .split(v304, v304, v304i, 8, TailStrategy::GuardWithIf)
        .vectorize(v304i)
        .reorder(v304i, v304, v305)
        .fuse(v304, v305, v304)
        .serial(v304);
    updated_head2_filter.update(3)
        .split(v304, v304, v304i, 8, TailStrategy::GuardWithIf)
        .vectorize(v304i)
        .reorder(v304i, v304, v305)
        .fuse(v304, v305, v304)
        .parallel(v304);
    head2_filter_im_0_d_def__
        .split(v22, v22, v22i, 8, TailStrategy::GuardWithIf)
        .vectorize(v22i)
        .compute_at(updated_head2_filter, v304)
        .reorder(v22i, v22, v23);
    head2_filter_im_0_d_def__.update(0)
        .split(v22, v22, v22i, 8, TailStrategy::GuardWithIf)
        .vectorize(v22i)
        .reorder(v22i, v22, v23, r1400_x, r1400_y);
    head2_conv_1_d_def__
        .split(w, w, wi, 2, TailStrategy::GuardWithIf)
        .split(n, n, ni, 128, TailStrategy::GuardWithIf)
        .split(c, c, ci, 8, TailStrategy::GuardWithIf)
        .split(ni, ni, nii, 4, TailStrategy::GuardWithIf)
        .unroll(wi)
        .unroll(nii)
        .vectorize(ci)
        .compute_root()
        .reorder(ci, wi, nii, c, ni, w, n)
        .fuse(w, n, w)
        .serial(w);
    head2_relu_0_d_def__
        .store_in(MemoryType::Stack)
        .split(c, c, ci, 8, TailStrategy::GuardWithIf)
        .unroll(w)
        .unroll(n)
        .vectorize(ci)
        .compute_at(head2_conv_1_d_def__, c)
        .reorder(ci, c, w, n);
    head2_relu_0_d_def__.update(0)
        .split(c, c, ci, 8, TailStrategy::GuardWithIf)
        .unroll(w)
        .unroll(n)
        .vectorize(ci)
        .reorder(ci, c, w, n, r1294_x);
    updated_head1_bias
        .split(v302, v302, v302i, 8, TailStrategy::GuardWithIf)
        .vectorize(v302i)
        .compute_root()
        .reorder(v302i, v302, v303)
        .serial(v303);
    updated_head1_bias.update(0)
        .split(v302, v302, v302i, 8, TailStrategy::GuardWithIf)
        .vectorize(v302i)
        .reorder(v302i, v302);
    updated_head1_bias.update(1)
        .split(v302, v302, v302i, 8, TailStrategy::GuardWithIf)
        .vectorize(v302i)
        .reorder(v302i, v302);
    updated_head1_bias.update(2)
        .split(v302, v302, v302i, 8, TailStrategy::GuardWithIf)
        .vectorize(v302i)
        .reorder(v302i, v302);
    updated_head1_bias.update(3)
        .split(v302, v302, v302i, 8, TailStrategy::GuardWithIf)
        .vectorize(v302i)
        .reorder(v302i, v302);
    head1_bias_im_0_d_def__
        .split(v14, v14, v14i, 8, TailStrategy::GuardWithIf)
        .vectorize(v14i)
        .compute_root()
        .reorder(v14i, v14);
    head1_bias_im_0_d_def__.update(0)
        .split(v14, v14, v14i, 8, TailStrategy::GuardWithIf)
        .vectorize(v14i)
        .reorder(v14i, v14, r1594_x);
    updated_head1_filter
        .split(v299, v299, v299i, 5, TailStrategy::GuardWithIf)
        .split(v301, v301, v301i, 2, TailStrategy::GuardWithIf)
        .split(v298, v298, v298i, 8, TailStrategy::GuardWithIf)
        .unroll(v299i)
        .unroll(v301i)
        .vectorize(v298i)
        .compute_root()
        .reorder(v298i, v298, v299i, v301i, v299, v300, v301)
        .fuse(v300, v301, v300)
        .fuse(v299, v300, v299)
        .serial(v299);
    updated_head1_filter.update(0)
        .split(v299, v299, v299i, 5, TailStrategy::GuardWithIf)
        .split(v298, v298, v298i, 8, TailStrategy::GuardWithIf)
        .vectorize(v298i)
        .reorder(v298i, v298, v299i, v299, v300)
        .fuse(v299, v300, v299)
        .serial(v299);
    updated_head1_filter.update(1)
        .split(v299, v299, v299i, 5, TailStrategy::GuardWithIf)
        .split(v298, v298, v298i, 8, TailStrategy::GuardWithIf)
        .vectorize(v298i)
        .reorder(v298i, v298, v299i, v299, v300)
        .fuse(v299, v300, v299)
        .serial(v299);
    updated_head1_filter.update(2)
        .split(v299, v299, v299i, 5, TailStrategy::GuardWithIf)
        .split(v298, v298, v298i, 8, TailStrategy::GuardWithIf)
        .vectorize(v298i)
        .reorder(v298i, v298, v299i, v299, v300)
        .fuse(v299, v300, v299)
        .serial(v299);
    updated_head1_filter.update(3)
        .split(v299, v299, v299i, 5, TailStrategy::GuardWithIf)
        .split(v298, v298, v298i, 8, TailStrategy::GuardWithIf)
        .vectorize(v298i)
        .reorder(v298i, v298, v299i, v299, v300)
        .fuse(v299, v300, v299)
        .serial(v299);
    squashed_head1_filter_0_d_def__
        .store_in(MemoryType::Stack)
        .split(c, c, ci, 8, TailStrategy::GuardWithIf)
        .vectorize(ci)
        .compute_at(updated_head1_filter, v298)
        .reorder(ci, c, s, n);
    squashed_head1_filter_0_d_def__.update(0)
        .split(c, c, ci, 8, TailStrategy::GuardWithIf)
        .vectorize(ci)
        .reorder(ci, c, s, n, r1614_x);
    squashed_head1_filter_broadcast_0_d_def__
        .store_in(MemoryType::Stack)
        .split(c, c, ci, 8, TailStrategy::GuardWithIf)
        .vectorize(ci)
        .compute_at(updated_head1_filter, v299i)
        .store_at(updated_head1_filter, v299)
        .reorder(ci, c, w, s, n);
    head1_conv_1_d_def__
        .split(c, c, ci, 8, TailStrategy::GuardWithIf)
        .vectorize(ci)
        .compute_root()
        .reorder(ci, c, w)
        .serial(w);
    head1_conv_1_d_def__.update(0)
        .split(c, c, ci, 8, TailStrategy::GuardWithIf)
        .vectorize(ci)
        .reorder(ci, c, r1491_x, w)
        .serial(w);
    conv1_stage1_1_d_def__
        .split(w, w, wi, 8, TailStrategy::GuardWithIf)
        .vectorize(wi)
        .compute_root()
        .reorder(wi, w, c)
        .fuse(w, c, w)
        .serial(w)
        .reorder_storage(w, c);
    conv1_stage1_1_d_def__.update(0)
        .split(w, w, wi, 8, TailStrategy::GuardWithIf)
        .vectorize(wi)
        .reorder(wi, r1336_x, w, c)
        .fuse(w, c, w)
        .serial(w);
    conv1_stage2_1_d_def__
        .split(c, c, ci, 14, TailStrategy::GuardWithIf)
        .split(n, n, ni, 32, TailStrategy::GuardWithIf)
        .split(ni, ni, nii, 4)
        .split(nii, nii, niii, 2)
        .split(w, w, wi, 8, TailStrategy::GuardWithIf)
        .vectorize(wi)
        .compute_root()
        .reorder(wi, w, ci, niii, nii, ni, c, n)
        .fuse(c, n, c)
        .parallel(c)
        .reorder_storage(w, c, n);
    sum_1_d_def__
        .split(n, n, ni, 8, TailStrategy::GuardWithIf)
        .unroll(n)
        .vectorize(ni)
        .compute_at(conv1_stage2_1_d_def__, c)
        .reorder(ni, n);

    relu1_0_d_def__.in()
        .store_in(MemoryType::Stack)
        .split(c, c, ci, 8, TailStrategy::GuardWithIf)
        .vectorize(ci)
        .compute_at(conv1_stage2_1_d_def__, nii)
        .reorder(ci, c, w, n);
    relu1_0_d_def__.compute_at(relu1_0_d_def__.in(), w);

    cost_per_stage_output_0_d_def__
        .store_in(MemoryType::Stack)
        .split(w, w, wi, 8, TailStrategy::GuardWithIf)
        .vectorize(wi)
        .compute_at(conv1_stage2_1_d_def__, nii)
        .store_at(conv1_stage2_1_d_def__, ni)
        .reorder(wi, w, n)
        .reorder_storage(w, n);
    f1_1_d_def__
        .split(n, n, ni, 8, TailStrategy::GuardWithIf)
        .unroll(n)
        .vectorize(ni)
        .compute_at(conv1_stage2_1_d_def__, c)
        .reorder(ni, n);
    adjoint
        .compute_root();
    f1
        .split(n, n, ni, 8, TailStrategy::GuardWithIf)
        .vectorize(ni)
        .compute_root()
        .reorder(ni, n)
        .serial(n);
    f1.update(0)
        .split(n, n, ni, 8, TailStrategy::GuardWithIf)
        .vectorize(ni)
        .reorder(ni, r81_x, n)
        .serial(n);
    cost_per_stage_output
        .split(n, n, ni, 128, TailStrategy::GuardWithIf)
        .split(w, w, wi, 2, TailStrategy::GuardWithIf)
        .split(ni, ni, nii, 8, TailStrategy::GuardWithIf)
        .vectorize(nii)
        .compute_root()
        .reorder(nii, ni, wi, n, w)
        .fuse(n, w, n)
        .serial(n);
    conv1_stage2
        .split(n, n, ni, 512, TailStrategy::GuardWithIf)
        .split(c, c, ci, 10, TailStrategy::GuardWithIf)
        .split(w, w, wi, 2, TailStrategy::GuardWithIf)
        .split(ni, ni, nii, 8, TailStrategy::GuardWithIf)
        .vectorize(nii)
        .compute_root()
        .reorder(nii, ni, ci, wi, n, c, w)
        .fuse(c, w, c)
        .fuse(n, c, n)
        .serial(n)
        .reorder_storage(n, c, w);
    conv1_stage2.update(0)
        .split(n, n, ni, 512, TailStrategy::GuardWithIf)
        .split(c, c, ci, 10, TailStrategy::GuardWithIf)
        .split(w, w, wi, 2, TailStrategy::GuardWithIf)
        .split(ni, ni, nii, 8, TailStrategy::GuardWithIf)
        .vectorize(nii)
        .reorder(nii, r63_x, ni, ci, wi, n, c, w)
        .fuse(c, w, c)
        .fuse(n, c, n)
        .serial(n);
    head2_relu
        .split(c, c, ci, 3, TailStrategy::GuardWithIf)
        .split(n, n, ni, 8, TailStrategy::GuardWithIf)
        .vectorize(ni)
        .compute_root()
        .reorder(ni, n, ci, c, w)
        .fuse(c, w, c)
        .serial(c)
        .reorder_storage(n, c, w);
    head2_conv
        .split(n, n, ni, 512, TailStrategy::GuardWithIf)
        .split(c, c, ci, 6, TailStrategy::GuardWithIf)
        .split(ni, ni, nii, 8, TailStrategy::GuardWithIf)
        .vectorize(nii)
        .compute_root()
        .reorder(nii, ni, ci, n, c, w)
        .fuse(c, w, c)
        .fuse(n, c, n)
        .serial(n)
        .reorder_storage(n, c, w);
    head2_conv.update(0)
        .split(n, n, ni, 512, TailStrategy::GuardWithIf)
        .split(c, c, ci, 6, TailStrategy::GuardWithIf)
        .split(ni, ni, nii, 8, TailStrategy::GuardWithIf)
        .vectorize(nii)
        .reorder(nii, r40_x, ni, ci, n, c, w)
        .fuse(c, w, c)
        .fuse(n, c, n)
        .parallel(n);
    normalized_schedule_features
        .split(c, c, ci, 11, TailStrategy::GuardWithIf)
        .split(n, n, ni, 8, TailStrategy::GuardWithIf)
        .vectorize(ni)
        .compute_root()
        .reorder(ni, n, ci, c, s)
        .fuse(c, s, c)
        .serial(c);
    conv1_stage1
        .split(w, w, wi, 8, TailStrategy::GuardWithIf)
        .vectorize(wi)
        .compute_root()
        .reorder(wi, w, c)
        .fuse(w, c, w)
        .serial(w)
        .reorder_storage(w, c);
    conv1_stage1.update(0)
        .split(w, w, wi, 8, TailStrategy::GuardWithIf)
        .vectorize(wi)
        .reorder(wi, r54_x, w, c)
        .fuse(w, c, w)
        .serial(w);
    head1_conv
        .split(w, w, wi, 8, TailStrategy::GuardWithIf)
        .vectorize(wi)
        .compute_root()
        .reorder(wi, w, c)
        .fuse(w, c, w)
        .serial(w)
        .reorder_storage(w, c);
    head1_conv.update(0)
        .split(w, w, wi, 8, TailStrategy::GuardWithIf)
        .vectorize(wi)
        .reorder(wi, r31_x, r31_y, w, c)
        .fuse(w, c, w)
        .serial(w);
    squashed_head1_filter
        .split(s, s, si, 8, TailStrategy::GuardWithIf)
        .vectorize(si)
        .compute_at(head1_conv, w)
        .reorder(si, s, c, n)
        .reorder_storage(s, c, n);
}
