import torch
from torch._inductor.select_algorithm import extern_kernels
import triton
import triton.language as tl
from torch._inductor.runtime.triton_heuristics import grid
from torch._C import _cuda_getCurrentRawStream as get_raw_stream
from torch._inductor.runtime import triton_helpers
from torch._inductor.runtime.triton_helpers import libdevice, math as tl_math
import numpy as np
from torch import nn
assert_size_stride = torch._C._dynamo.guards.assert_size_stride
empty_strided_cuda = torch._C._dynamo.guards._empty_strided_cuda
reinterpret_tensor = torch._C._dynamo.guards._reinterpret_tensor


@triton.jit
def triton_per_fused__softmax_0(in_ptr0, out_ptr0, out_ptr1, xnumel, rnumel,
    XBLOCK: tl.constexpr):
    xnumel = 64
    RBLOCK: tl.constexpr = 64
    xoffset = tl.program_id(0) * XBLOCK
    xindex = xoffset + tl.arange(0, XBLOCK)[:, None]
    xmask = xindex < xnumel
    rindex = tl.arange(0, RBLOCK)[None, :]
    tl.full([XBLOCK, RBLOCK], True, tl.int1)
    r2 = rindex
    x0 = xindex % 16
    x1 = xindex // 16
    x3 = xindex
    tmp0 = tl.load(in_ptr0 + (x0 + 16 * r2 + 1024 * x1), xmask, other=0.0)
    tmp1 = tl.broadcast_to(tmp0, [XBLOCK, RBLOCK])
    tmp3 = tl.where(xmask, tmp1, float('-inf'))
    tmp4 = triton_helpers.max2(tmp3, 1)[:, None]
    tmp5 = tmp0 - tmp4
    tmp6 = tl_math.exp(tmp5)
    tmp7 = tl.broadcast_to(tmp6, [XBLOCK, RBLOCK])
    tmp9 = tl.where(xmask, tmp7, 0)
    tmp10 = tl.sum(tmp9, 1)[:, None]
    tl.store(out_ptr0 + x3, tmp4, xmask)
    tl.store(out_ptr1 + x3, tmp10, xmask)


@triton.jit
def triton_per_fused_mul_sub_sum_1(in_ptr0, in_ptr1, in_ptr2, in_ptr3,
    in_ptr4, out_ptr0, out_ptr1, out_ptr2, out_ptr3, out_ptr4, out_ptr5,
    out_ptr6, out_ptr7, out_ptr8, out_ptr9, out_ptr10, out_ptr11, out_ptr12,
    out_ptr13, out_ptr14, out_ptr15, out_ptr16, out_ptr17, out_ptr18,
    out_ptr19, out_ptr20, out_ptr21, out_ptr22, out_ptr23, out_ptr24,
    out_ptr25, out_ptr26, out_ptr27, out_ptr28, out_ptr29, out_ptr30,
    out_ptr31, out_ptr32, out_ptr33, out_ptr34, out_ptr35, out_ptr36,
    out_ptr37, out_ptr38, out_ptr39, out_ptr40, out_ptr41, out_ptr42,
    out_ptr43, out_ptr44, out_ptr45, out_ptr46, out_ptr47, out_ptr48,
    out_ptr49, out_ptr50, out_ptr51, out_ptr52, out_ptr53, out_ptr54,
    out_ptr55, out_ptr56, xnumel, rnumel, XBLOCK: tl.constexpr):
    xnumel = 16
    RBLOCK: tl.constexpr = 16
    xoffset = tl.program_id(0) * XBLOCK
    xindex = xoffset + tl.arange(0, XBLOCK)[:, None]
    xmask = xindex < xnumel
    rindex = tl.arange(0, RBLOCK)[None, :]
    tl.full([XBLOCK, RBLOCK], True, tl.int1)
    r2 = rindex
    x3 = xindex
    x0 = xindex % 4
    x1 = xindex // 4
    tmp0 = tl.load(in_ptr0 + (r2 + 16 * x3), xmask, other=0.0)
    tmp1 = tl.load(in_ptr1 + (4 + x0), xmask, eviction_policy='evict_last')
    tmp3 = tl.load(in_ptr1 + (8 + x0), xmask, eviction_policy='evict_last')
    tmp5 = tl.load(in_ptr1 + (12 + x0), xmask, eviction_policy='evict_last')
    tmp7 = tl.load(in_ptr1 + (16 + x0), xmask, eviction_policy='evict_last')
    tmp9 = tl.load(in_ptr1 + (20 + x0), xmask, eviction_policy='evict_last')
    tmp11 = tl.load(in_ptr1 + (24 + x0), xmask, eviction_policy='evict_last')
    tmp13 = tl.load(in_ptr1 + (28 + x0), xmask, eviction_policy='evict_last')
    tmp15 = tl.load(in_ptr1 + (32 + x0), xmask, eviction_policy='evict_last')
    tmp17 = tl.load(in_ptr1 + (36 + x0), xmask, eviction_policy='evict_last')
    tmp19 = tl.load(in_ptr1 + (40 + x0), xmask, eviction_policy='evict_last')
    tmp21 = tl.load(in_ptr1 + (44 + x0), xmask, eviction_policy='evict_last')
    tmp23 = tl.load(in_ptr1 + (48 + x0), xmask, eviction_policy='evict_last')
    tmp25 = tl.load(in_ptr1 + (52 + x0), xmask, eviction_policy='evict_last')
    tmp27 = tl.load(in_ptr1 + (56 + x0), xmask, eviction_policy='evict_last')
    tmp29 = tl.load(in_ptr1 + (60 + x0), xmask, eviction_policy='evict_last')
    tmp31 = tl.load(in_ptr1 + (64 + x0), xmask, eviction_policy='evict_last')
    tmp33 = tl.load(in_ptr1 + (68 + x0), xmask, eviction_policy='evict_last')
    tmp35 = tl.load(in_ptr1 + (72 + x0), xmask, eviction_policy='evict_last')
    tmp37 = tl.load(in_ptr1 + (76 + x0), xmask, eviction_policy='evict_last')
    tmp39 = tl.load(in_ptr1 + (80 + x0), xmask, eviction_policy='evict_last')
    tmp41 = tl.load(in_ptr1 + (84 + x0), xmask, eviction_policy='evict_last')
    tmp43 = tl.load(in_ptr1 + (88 + x0), xmask, eviction_policy='evict_last')
    tmp45 = tl.load(in_ptr1 + (92 + x0), xmask, eviction_policy='evict_last')
    tmp47 = tl.load(in_ptr1 + (96 + x0), xmask, eviction_policy='evict_last')
    tmp49 = tl.load(in_ptr1 + (100 + x0), xmask, eviction_policy='evict_last')
    tmp51 = tl.load(in_ptr1 + (104 + x0), xmask, eviction_policy='evict_last')
    tmp53 = tl.load(in_ptr1 + (108 + x0), xmask, eviction_policy='evict_last')
    tmp55 = tl.load(in_ptr1 + (112 + x0), xmask, eviction_policy='evict_last')
    tmp57 = tl.load(in_ptr1 + x0, xmask, eviction_policy='evict_last')
    tmp59 = tl.load(in_ptr2 + (r2 + 1024 * x1), xmask, eviction_policy=
        'evict_last', other=0.0)
    tmp60 = tl.load(in_ptr3 + (r2 + 16 * x1), xmask, eviction_policy=
        'evict_last', other=0.0)
    tmp63 = tl.load(in_ptr4 + (r2 + 16 * x1), xmask, eviction_policy=
        'evict_last', other=0.0)
    tmp70 = tl.load(in_ptr2 + (16 + r2 + 1024 * x1), xmask, eviction_policy
        ='evict_last', other=0.0)
    tmp79 = tl.load(in_ptr2 + (32 + r2 + 1024 * x1), xmask, eviction_policy
        ='evict_last', other=0.0)
    tmp88 = tl.load(in_ptr2 + (48 + r2 + 1024 * x1), xmask, eviction_policy
        ='evict_last', other=0.0)
    tmp97 = tl.load(in_ptr2 + (64 + r2 + 1024 * x1), xmask, eviction_policy
        ='evict_last', other=0.0)
    tmp106 = tl.load(in_ptr2 + (80 + r2 + 1024 * x1), xmask,
        eviction_policy='evict_last', other=0.0)
    tmp115 = tl.load(in_ptr2 + (96 + r2 + 1024 * x1), xmask,
        eviction_policy='evict_last', other=0.0)
    tmp124 = tl.load(in_ptr2 + (112 + r2 + 1024 * x1), xmask,
        eviction_policy='evict_last', other=0.0)
    tmp133 = tl.load(in_ptr2 + (128 + r2 + 1024 * x1), xmask,
        eviction_policy='evict_last', other=0.0)
    tmp142 = tl.load(in_ptr2 + (144 + r2 + 1024 * x1), xmask,
        eviction_policy='evict_last', other=0.0)
    tmp151 = tl.load(in_ptr2 + (160 + r2 + 1024 * x1), xmask,
        eviction_policy='evict_last', other=0.0)
    tmp160 = tl.load(in_ptr2 + (176 + r2 + 1024 * x1), xmask,
        eviction_policy='evict_last', other=0.0)
    tmp169 = tl.load(in_ptr2 + (192 + r2 + 1024 * x1), xmask,
        eviction_policy='evict_last', other=0.0)
    tmp178 = tl.load(in_ptr2 + (208 + r2 + 1024 * x1), xmask,
        eviction_policy='evict_last', other=0.0)
    tmp187 = tl.load(in_ptr2 + (224 + r2 + 1024 * x1), xmask,
        eviction_policy='evict_last', other=0.0)
    tmp196 = tl.load(in_ptr2 + (240 + r2 + 1024 * x1), xmask,
        eviction_policy='evict_last', other=0.0)
    tmp205 = tl.load(in_ptr2 + (256 + r2 + 1024 * x1), xmask,
        eviction_policy='evict_last', other=0.0)
    tmp214 = tl.load(in_ptr2 + (272 + r2 + 1024 * x1), xmask,
        eviction_policy='evict_last', other=0.0)
    tmp223 = tl.load(in_ptr2 + (288 + r2 + 1024 * x1), xmask,
        eviction_policy='evict_last', other=0.0)
    tmp232 = tl.load(in_ptr2 + (304 + r2 + 1024 * x1), xmask,
        eviction_policy='evict_last', other=0.0)
    tmp241 = tl.load(in_ptr2 + (320 + r2 + 1024 * x1), xmask,
        eviction_policy='evict_last', other=0.0)
    tmp250 = tl.load(in_ptr2 + (336 + r2 + 1024 * x1), xmask,
        eviction_policy='evict_last', other=0.0)
    tmp259 = tl.load(in_ptr2 + (352 + r2 + 1024 * x1), xmask,
        eviction_policy='evict_last', other=0.0)
    tmp268 = tl.load(in_ptr2 + (368 + r2 + 1024 * x1), xmask,
        eviction_policy='evict_last', other=0.0)
    tmp277 = tl.load(in_ptr2 + (384 + r2 + 1024 * x1), xmask,
        eviction_policy='evict_last', other=0.0)
    tmp286 = tl.load(in_ptr2 + (400 + r2 + 1024 * x1), xmask,
        eviction_policy='evict_last', other=0.0)
    tmp295 = tl.load(in_ptr2 + (416 + r2 + 1024 * x1), xmask,
        eviction_policy='evict_last', other=0.0)
    tmp304 = tl.load(in_ptr2 + (432 + r2 + 1024 * x1), xmask,
        eviction_policy='evict_last', other=0.0)
    tmp313 = tl.load(in_ptr2 + (448 + r2 + 1024 * x1), xmask,
        eviction_policy='evict_last', other=0.0)
    tmp2 = tmp0 - tmp1
    tmp4 = tmp0 - tmp3
    tmp6 = tmp0 - tmp5
    tmp8 = tmp0 - tmp7
    tmp10 = tmp0 - tmp9
    tmp12 = tmp0 - tmp11
    tmp14 = tmp0 - tmp13
    tmp16 = tmp0 - tmp15
    tmp18 = tmp0 - tmp17
    tmp20 = tmp0 - tmp19
    tmp22 = tmp0 - tmp21
    tmp24 = tmp0 - tmp23
    tmp26 = tmp0 - tmp25
    tmp28 = tmp0 - tmp27
    tmp30 = tmp0 - tmp29
    tmp32 = tmp0 - tmp31
    tmp34 = tmp0 - tmp33
    tmp36 = tmp0 - tmp35
    tmp38 = tmp0 - tmp37
    tmp40 = tmp0 - tmp39
    tmp42 = tmp0 - tmp41
    tmp44 = tmp0 - tmp43
    tmp46 = tmp0 - tmp45
    tmp48 = tmp0 - tmp47
    tmp50 = tmp0 - tmp49
    tmp52 = tmp0 - tmp51
    tmp54 = tmp0 - tmp53
    tmp56 = tmp0 - tmp55
    tmp58 = tmp0 - tmp57
    tmp61 = tmp59 - tmp60
    tmp62 = tl_math.exp(tmp61)
    tmp64 = tmp62 / tmp63
    tmp65 = tmp58 * tmp64
    tmp66 = tl.broadcast_to(tmp65, [XBLOCK, RBLOCK])
    tmp68 = tl.where(xmask, tmp66, 0)
    tmp69 = tl.sum(tmp68, 1)[:, None]
    tmp71 = tmp70 - tmp60
    tmp72 = tl_math.exp(tmp71)
    tmp73 = tmp72 / tmp63
    tmp74 = tmp2 * tmp73
    tmp75 = tl.broadcast_to(tmp74, [XBLOCK, RBLOCK])
    tmp77 = tl.where(xmask, tmp75, 0)
    tmp78 = tl.sum(tmp77, 1)[:, None]
    tmp80 = tmp79 - tmp60
    tmp81 = tl_math.exp(tmp80)
    tmp82 = tmp81 / tmp63
    tmp83 = tmp4 * tmp82
    tmp84 = tl.broadcast_to(tmp83, [XBLOCK, RBLOCK])
    tmp86 = tl.where(xmask, tmp84, 0)
    tmp87 = tl.sum(tmp86, 1)[:, None]
    tmp89 = tmp88 - tmp60
    tmp90 = tl_math.exp(tmp89)
    tmp91 = tmp90 / tmp63
    tmp92 = tmp6 * tmp91
    tmp93 = tl.broadcast_to(tmp92, [XBLOCK, RBLOCK])
    tmp95 = tl.where(xmask, tmp93, 0)
    tmp96 = tl.sum(tmp95, 1)[:, None]
    tmp98 = tmp97 - tmp60
    tmp99 = tl_math.exp(tmp98)
    tmp100 = tmp99 / tmp63
    tmp101 = tmp8 * tmp100
    tmp102 = tl.broadcast_to(tmp101, [XBLOCK, RBLOCK])
    tmp104 = tl.where(xmask, tmp102, 0)
    tmp105 = tl.sum(tmp104, 1)[:, None]
    tmp107 = tmp106 - tmp60
    tmp108 = tl_math.exp(tmp107)
    tmp109 = tmp108 / tmp63
    tmp110 = tmp10 * tmp109
    tmp111 = tl.broadcast_to(tmp110, [XBLOCK, RBLOCK])
    tmp113 = tl.where(xmask, tmp111, 0)
    tmp114 = tl.sum(tmp113, 1)[:, None]
    tmp116 = tmp115 - tmp60
    tmp117 = tl_math.exp(tmp116)
    tmp118 = tmp117 / tmp63
    tmp119 = tmp12 * tmp118
    tmp120 = tl.broadcast_to(tmp119, [XBLOCK, RBLOCK])
    tmp122 = tl.where(xmask, tmp120, 0)
    tmp123 = tl.sum(tmp122, 1)[:, None]
    tmp125 = tmp124 - tmp60
    tmp126 = tl_math.exp(tmp125)
    tmp127 = tmp126 / tmp63
    tmp128 = tmp14 * tmp127
    tmp129 = tl.broadcast_to(tmp128, [XBLOCK, RBLOCK])
    tmp131 = tl.where(xmask, tmp129, 0)
    tmp132 = tl.sum(tmp131, 1)[:, None]
    tmp134 = tmp133 - tmp60
    tmp135 = tl_math.exp(tmp134)
    tmp136 = tmp135 / tmp63
    tmp137 = tmp16 * tmp136
    tmp138 = tl.broadcast_to(tmp137, [XBLOCK, RBLOCK])
    tmp140 = tl.where(xmask, tmp138, 0)
    tmp141 = tl.sum(tmp140, 1)[:, None]
    tmp143 = tmp142 - tmp60
    tmp144 = tl_math.exp(tmp143)
    tmp145 = tmp144 / tmp63
    tmp146 = tmp18 * tmp145
    tmp147 = tl.broadcast_to(tmp146, [XBLOCK, RBLOCK])
    tmp149 = tl.where(xmask, tmp147, 0)
    tmp150 = tl.sum(tmp149, 1)[:, None]
    tmp152 = tmp151 - tmp60
    tmp153 = tl_math.exp(tmp152)
    tmp154 = tmp153 / tmp63
    tmp155 = tmp20 * tmp154
    tmp156 = tl.broadcast_to(tmp155, [XBLOCK, RBLOCK])
    tmp158 = tl.where(xmask, tmp156, 0)
    tmp159 = tl.sum(tmp158, 1)[:, None]
    tmp161 = tmp160 - tmp60
    tmp162 = tl_math.exp(tmp161)
    tmp163 = tmp162 / tmp63
    tmp164 = tmp22 * tmp163
    tmp165 = tl.broadcast_to(tmp164, [XBLOCK, RBLOCK])
    tmp167 = tl.where(xmask, tmp165, 0)
    tmp168 = tl.sum(tmp167, 1)[:, None]
    tmp170 = tmp169 - tmp60
    tmp171 = tl_math.exp(tmp170)
    tmp172 = tmp171 / tmp63
    tmp173 = tmp24 * tmp172
    tmp174 = tl.broadcast_to(tmp173, [XBLOCK, RBLOCK])
    tmp176 = tl.where(xmask, tmp174, 0)
    tmp177 = tl.sum(tmp176, 1)[:, None]
    tmp179 = tmp178 - tmp60
    tmp180 = tl_math.exp(tmp179)
    tmp181 = tmp180 / tmp63
    tmp182 = tmp26 * tmp181
    tmp183 = tl.broadcast_to(tmp182, [XBLOCK, RBLOCK])
    tmp185 = tl.where(xmask, tmp183, 0)
    tmp186 = tl.sum(tmp185, 1)[:, None]
    tmp188 = tmp187 - tmp60
    tmp189 = tl_math.exp(tmp188)
    tmp190 = tmp189 / tmp63
    tmp191 = tmp28 * tmp190
    tmp192 = tl.broadcast_to(tmp191, [XBLOCK, RBLOCK])
    tmp194 = tl.where(xmask, tmp192, 0)
    tmp195 = tl.sum(tmp194, 1)[:, None]
    tmp197 = tmp196 - tmp60
    tmp198 = tl_math.exp(tmp197)
    tmp199 = tmp198 / tmp63
    tmp200 = tmp30 * tmp199
    tmp201 = tl.broadcast_to(tmp200, [XBLOCK, RBLOCK])
    tmp203 = tl.where(xmask, tmp201, 0)
    tmp204 = tl.sum(tmp203, 1)[:, None]
    tmp206 = tmp205 - tmp60
    tmp207 = tl_math.exp(tmp206)
    tmp208 = tmp207 / tmp63
    tmp209 = tmp32 * tmp208
    tmp210 = tl.broadcast_to(tmp209, [XBLOCK, RBLOCK])
    tmp212 = tl.where(xmask, tmp210, 0)
    tmp213 = tl.sum(tmp212, 1)[:, None]
    tmp215 = tmp214 - tmp60
    tmp216 = tl_math.exp(tmp215)
    tmp217 = tmp216 / tmp63
    tmp218 = tmp34 * tmp217
    tmp219 = tl.broadcast_to(tmp218, [XBLOCK, RBLOCK])
    tmp221 = tl.where(xmask, tmp219, 0)
    tmp222 = tl.sum(tmp221, 1)[:, None]
    tmp224 = tmp223 - tmp60
    tmp225 = tl_math.exp(tmp224)
    tmp226 = tmp225 / tmp63
    tmp227 = tmp36 * tmp226
    tmp228 = tl.broadcast_to(tmp227, [XBLOCK, RBLOCK])
    tmp230 = tl.where(xmask, tmp228, 0)
    tmp231 = tl.sum(tmp230, 1)[:, None]
    tmp233 = tmp232 - tmp60
    tmp234 = tl_math.exp(tmp233)
    tmp235 = tmp234 / tmp63
    tmp236 = tmp38 * tmp235
    tmp237 = tl.broadcast_to(tmp236, [XBLOCK, RBLOCK])
    tmp239 = tl.where(xmask, tmp237, 0)
    tmp240 = tl.sum(tmp239, 1)[:, None]
    tmp242 = tmp241 - tmp60
    tmp243 = tl_math.exp(tmp242)
    tmp244 = tmp243 / tmp63
    tmp245 = tmp40 * tmp244
    tmp246 = tl.broadcast_to(tmp245, [XBLOCK, RBLOCK])
    tmp248 = tl.where(xmask, tmp246, 0)
    tmp249 = tl.sum(tmp248, 1)[:, None]
    tmp251 = tmp250 - tmp60
    tmp252 = tl_math.exp(tmp251)
    tmp253 = tmp252 / tmp63
    tmp254 = tmp42 * tmp253
    tmp255 = tl.broadcast_to(tmp254, [XBLOCK, RBLOCK])
    tmp257 = tl.where(xmask, tmp255, 0)
    tmp258 = tl.sum(tmp257, 1)[:, None]
    tmp260 = tmp259 - tmp60
    tmp261 = tl_math.exp(tmp260)
    tmp262 = tmp261 / tmp63
    tmp263 = tmp44 * tmp262
    tmp264 = tl.broadcast_to(tmp263, [XBLOCK, RBLOCK])
    tmp266 = tl.where(xmask, tmp264, 0)
    tmp267 = tl.sum(tmp266, 1)[:, None]
    tmp269 = tmp268 - tmp60
    tmp270 = tl_math.exp(tmp269)
    tmp271 = tmp270 / tmp63
    tmp272 = tmp46 * tmp271
    tmp273 = tl.broadcast_to(tmp272, [XBLOCK, RBLOCK])
    tmp275 = tl.where(xmask, tmp273, 0)
    tmp276 = tl.sum(tmp275, 1)[:, None]
    tmp278 = tmp277 - tmp60
    tmp279 = tl_math.exp(tmp278)
    tmp280 = tmp279 / tmp63
    tmp281 = tmp48 * tmp280
    tmp282 = tl.broadcast_to(tmp281, [XBLOCK, RBLOCK])
    tmp284 = tl.where(xmask, tmp282, 0)
    tmp285 = tl.sum(tmp284, 1)[:, None]
    tmp287 = tmp286 - tmp60
    tmp288 = tl_math.exp(tmp287)
    tmp289 = tmp288 / tmp63
    tmp290 = tmp50 * tmp289
    tmp291 = tl.broadcast_to(tmp290, [XBLOCK, RBLOCK])
    tmp293 = tl.where(xmask, tmp291, 0)
    tmp294 = tl.sum(tmp293, 1)[:, None]
    tmp296 = tmp295 - tmp60
    tmp297 = tl_math.exp(tmp296)
    tmp298 = tmp297 / tmp63
    tmp299 = tmp52 * tmp298
    tmp300 = tl.broadcast_to(tmp299, [XBLOCK, RBLOCK])
    tmp302 = tl.where(xmask, tmp300, 0)
    tmp303 = tl.sum(tmp302, 1)[:, None]
    tmp305 = tmp304 - tmp60
    tmp306 = tl_math.exp(tmp305)
    tmp307 = tmp306 / tmp63
    tmp308 = tmp54 * tmp307
    tmp309 = tl.broadcast_to(tmp308, [XBLOCK, RBLOCK])
    tmp311 = tl.where(xmask, tmp309, 0)
    tmp312 = tl.sum(tmp311, 1)[:, None]
    tmp314 = tmp313 - tmp60
    tmp315 = tl_math.exp(tmp314)
    tmp316 = tmp315 / tmp63
    tmp317 = tmp56 * tmp316
    tmp318 = tl.broadcast_to(tmp317, [XBLOCK, RBLOCK])
    tmp320 = tl.where(xmask, tmp318, 0)
    tmp321 = tl.sum(tmp320, 1)[:, None]
    tl.store(out_ptr0 + (r2 + 16 * x3), tmp2, xmask)
    tl.store(out_ptr1 + (r2 + 16 * x3), tmp4, xmask)
    tl.store(out_ptr2 + (r2 + 16 * x3), tmp6, xmask)
    tl.store(out_ptr3 + (r2 + 16 * x3), tmp8, xmask)
    tl.store(out_ptr4 + (r2 + 16 * x3), tmp10, xmask)
    tl.store(out_ptr5 + (r2 + 16 * x3), tmp12, xmask)
    tl.store(out_ptr6 + (r2 + 16 * x3), tmp14, xmask)
    tl.store(out_ptr7 + (r2 + 16 * x3), tmp16, xmask)
    tl.store(out_ptr8 + (r2 + 16 * x3), tmp18, xmask)
    tl.store(out_ptr9 + (r2 + 16 * x3), tmp20, xmask)
    tl.store(out_ptr10 + (r2 + 16 * x3), tmp22, xmask)
    tl.store(out_ptr11 + (r2 + 16 * x3), tmp24, xmask)
    tl.store(out_ptr12 + (r2 + 16 * x3), tmp26, xmask)
    tl.store(out_ptr13 + (r2 + 16 * x3), tmp28, xmask)
    tl.store(out_ptr14 + (r2 + 16 * x3), tmp30, xmask)
    tl.store(out_ptr15 + (r2 + 16 * x3), tmp32, xmask)
    tl.store(out_ptr16 + (r2 + 16 * x3), tmp34, xmask)
    tl.store(out_ptr17 + (r2 + 16 * x3), tmp36, xmask)
    tl.store(out_ptr18 + (r2 + 16 * x3), tmp38, xmask)
    tl.store(out_ptr19 + (r2 + 16 * x3), tmp40, xmask)
    tl.store(out_ptr20 + (r2 + 16 * x3), tmp42, xmask)
    tl.store(out_ptr21 + (r2 + 16 * x3), tmp44, xmask)
    tl.store(out_ptr22 + (r2 + 16 * x3), tmp46, xmask)
    tl.store(out_ptr23 + (r2 + 16 * x3), tmp48, xmask)
    tl.store(out_ptr24 + (r2 + 16 * x3), tmp50, xmask)
    tl.store(out_ptr25 + (r2 + 16 * x3), tmp52, xmask)
    tl.store(out_ptr26 + (r2 + 16 * x3), tmp54, xmask)
    tl.store(out_ptr27 + (r2 + 16 * x3), tmp56, xmask)
    tl.store(out_ptr28 + x3, tmp69, xmask)
    tl.store(out_ptr29 + x3, tmp78, xmask)
    tl.store(out_ptr30 + x3, tmp87, xmask)
    tl.store(out_ptr31 + x3, tmp96, xmask)
    tl.store(out_ptr32 + x3, tmp105, xmask)
    tl.store(out_ptr33 + x3, tmp114, xmask)
    tl.store(out_ptr34 + x3, tmp123, xmask)
    tl.store(out_ptr35 + x3, tmp132, xmask)
    tl.store(out_ptr36 + x3, tmp141, xmask)
    tl.store(out_ptr37 + x3, tmp150, xmask)
    tl.store(out_ptr38 + x3, tmp159, xmask)
    tl.store(out_ptr39 + x3, tmp168, xmask)
    tl.store(out_ptr40 + x3, tmp177, xmask)
    tl.store(out_ptr41 + x3, tmp186, xmask)
    tl.store(out_ptr42 + x3, tmp195, xmask)
    tl.store(out_ptr43 + x3, tmp204, xmask)
    tl.store(out_ptr44 + x3, tmp213, xmask)
    tl.store(out_ptr45 + x3, tmp222, xmask)
    tl.store(out_ptr46 + x3, tmp231, xmask)
    tl.store(out_ptr47 + x3, tmp240, xmask)
    tl.store(out_ptr48 + x3, tmp249, xmask)
    tl.store(out_ptr49 + x3, tmp258, xmask)
    tl.store(out_ptr50 + x3, tmp267, xmask)
    tl.store(out_ptr51 + x3, tmp276, xmask)
    tl.store(out_ptr52 + x3, tmp285, xmask)
    tl.store(out_ptr53 + x3, tmp294, xmask)
    tl.store(out_ptr54 + x3, tmp303, xmask)
    tl.store(out_ptr55 + x3, tmp312, xmask)
    tl.store(out_ptr56 + x3, tmp321, xmask)


@triton.jit
def triton_per_fused_mul_sub_sum_2(in_ptr0, in_ptr1, in_ptr2, in_ptr3,
    in_ptr4, out_ptr0, out_ptr1, out_ptr2, out_ptr3, out_ptr4, out_ptr5,
    out_ptr6, out_ptr7, out_ptr8, out_ptr9, out_ptr10, out_ptr11, out_ptr12,
    out_ptr13, out_ptr14, out_ptr15, out_ptr16, out_ptr17, out_ptr18,
    out_ptr19, out_ptr20, out_ptr21, out_ptr22, out_ptr23, out_ptr24,
    out_ptr25, out_ptr26, out_ptr27, out_ptr28, out_ptr29, out_ptr30,
    out_ptr31, out_ptr32, out_ptr33, out_ptr34, out_ptr35, out_ptr36,
    out_ptr37, out_ptr38, out_ptr39, out_ptr40, out_ptr41, out_ptr42,
    out_ptr43, out_ptr44, out_ptr45, out_ptr46, out_ptr47, out_ptr48,
    out_ptr49, out_ptr50, out_ptr51, out_ptr52, out_ptr53, out_ptr54,
    out_ptr55, xnumel, rnumel, XBLOCK: tl.constexpr):
    xnumel = 16
    RBLOCK: tl.constexpr = 16
    xoffset = tl.program_id(0) * XBLOCK
    xindex = xoffset + tl.arange(0, XBLOCK)[:, None]
    xmask = xindex < xnumel
    rindex = tl.arange(0, RBLOCK)[None, :]
    tl.full([XBLOCK, RBLOCK], True, tl.int1)
    r2 = rindex
    x3 = xindex
    x0 = xindex % 4
    x1 = xindex // 4
    tmp0 = tl.load(in_ptr0 + (r2 + 16 * x3), xmask, other=0.0)
    tmp1 = tl.load(in_ptr1 + (116 + x0), xmask, eviction_policy='evict_last')
    tmp3 = tl.load(in_ptr1 + (120 + x0), xmask, eviction_policy='evict_last')
    tmp5 = tl.load(in_ptr1 + (124 + x0), xmask, eviction_policy='evict_last')
    tmp7 = tl.load(in_ptr1 + (128 + x0), xmask, eviction_policy='evict_last')
    tmp9 = tl.load(in_ptr1 + (132 + x0), xmask, eviction_policy='evict_last')
    tmp11 = tl.load(in_ptr1 + (136 + x0), xmask, eviction_policy='evict_last')
    tmp13 = tl.load(in_ptr1 + (140 + x0), xmask, eviction_policy='evict_last')
    tmp15 = tl.load(in_ptr1 + (144 + x0), xmask, eviction_policy='evict_last')
    tmp17 = tl.load(in_ptr1 + (148 + x0), xmask, eviction_policy='evict_last')
    tmp19 = tl.load(in_ptr1 + (152 + x0), xmask, eviction_policy='evict_last')
    tmp21 = tl.load(in_ptr1 + (156 + x0), xmask, eviction_policy='evict_last')
    tmp23 = tl.load(in_ptr1 + (160 + x0), xmask, eviction_policy='evict_last')
    tmp25 = tl.load(in_ptr1 + (164 + x0), xmask, eviction_policy='evict_last')
    tmp27 = tl.load(in_ptr1 + (168 + x0), xmask, eviction_policy='evict_last')
    tmp29 = tl.load(in_ptr1 + (172 + x0), xmask, eviction_policy='evict_last')
    tmp31 = tl.load(in_ptr1 + (176 + x0), xmask, eviction_policy='evict_last')
    tmp33 = tl.load(in_ptr1 + (180 + x0), xmask, eviction_policy='evict_last')
    tmp35 = tl.load(in_ptr1 + (184 + x0), xmask, eviction_policy='evict_last')
    tmp37 = tl.load(in_ptr1 + (188 + x0), xmask, eviction_policy='evict_last')
    tmp39 = tl.load(in_ptr1 + (192 + x0), xmask, eviction_policy='evict_last')
    tmp41 = tl.load(in_ptr1 + (196 + x0), xmask, eviction_policy='evict_last')
    tmp43 = tl.load(in_ptr1 + (200 + x0), xmask, eviction_policy='evict_last')
    tmp45 = tl.load(in_ptr1 + (204 + x0), xmask, eviction_policy='evict_last')
    tmp47 = tl.load(in_ptr1 + (208 + x0), xmask, eviction_policy='evict_last')
    tmp49 = tl.load(in_ptr1 + (212 + x0), xmask, eviction_policy='evict_last')
    tmp51 = tl.load(in_ptr1 + (216 + x0), xmask, eviction_policy='evict_last')
    tmp53 = tl.load(in_ptr1 + (220 + x0), xmask, eviction_policy='evict_last')
    tmp55 = tl.load(in_ptr1 + (224 + x0), xmask, eviction_policy='evict_last')
    tmp57 = tl.load(in_ptr2 + (464 + r2 + 1024 * x1), xmask,
        eviction_policy='evict_last', other=0.0)
    tmp58 = tl.load(in_ptr3 + (r2 + 16 * x1), xmask, eviction_policy=
        'evict_last', other=0.0)
    tmp61 = tl.load(in_ptr4 + (r2 + 16 * x1), xmask, eviction_policy=
        'evict_last', other=0.0)
    tmp68 = tl.load(in_ptr2 + (480 + r2 + 1024 * x1), xmask,
        eviction_policy='evict_last', other=0.0)
    tmp77 = tl.load(in_ptr2 + (496 + r2 + 1024 * x1), xmask,
        eviction_policy='evict_last', other=0.0)
    tmp86 = tl.load(in_ptr2 + (512 + r2 + 1024 * x1), xmask,
        eviction_policy='evict_last', other=0.0)
    tmp95 = tl.load(in_ptr2 + (528 + r2 + 1024 * x1), xmask,
        eviction_policy='evict_last', other=0.0)
    tmp104 = tl.load(in_ptr2 + (544 + r2 + 1024 * x1), xmask,
        eviction_policy='evict_last', other=0.0)
    tmp113 = tl.load(in_ptr2 + (560 + r2 + 1024 * x1), xmask,
        eviction_policy='evict_last', other=0.0)
    tmp122 = tl.load(in_ptr2 + (576 + r2 + 1024 * x1), xmask,
        eviction_policy='evict_last', other=0.0)
    tmp131 = tl.load(in_ptr2 + (592 + r2 + 1024 * x1), xmask,
        eviction_policy='evict_last', other=0.0)
    tmp140 = tl.load(in_ptr2 + (608 + r2 + 1024 * x1), xmask,
        eviction_policy='evict_last', other=0.0)
    tmp149 = tl.load(in_ptr2 + (624 + r2 + 1024 * x1), xmask,
        eviction_policy='evict_last', other=0.0)
    tmp158 = tl.load(in_ptr2 + (640 + r2 + 1024 * x1), xmask,
        eviction_policy='evict_last', other=0.0)
    tmp167 = tl.load(in_ptr2 + (656 + r2 + 1024 * x1), xmask,
        eviction_policy='evict_last', other=0.0)
    tmp176 = tl.load(in_ptr2 + (672 + r2 + 1024 * x1), xmask,
        eviction_policy='evict_last', other=0.0)
    tmp185 = tl.load(in_ptr2 + (688 + r2 + 1024 * x1), xmask,
        eviction_policy='evict_last', other=0.0)
    tmp194 = tl.load(in_ptr2 + (704 + r2 + 1024 * x1), xmask,
        eviction_policy='evict_last', other=0.0)
    tmp203 = tl.load(in_ptr2 + (720 + r2 + 1024 * x1), xmask,
        eviction_policy='evict_last', other=0.0)
    tmp212 = tl.load(in_ptr2 + (736 + r2 + 1024 * x1), xmask,
        eviction_policy='evict_last', other=0.0)
    tmp221 = tl.load(in_ptr2 + (752 + r2 + 1024 * x1), xmask,
        eviction_policy='evict_last', other=0.0)
    tmp230 = tl.load(in_ptr2 + (768 + r2 + 1024 * x1), xmask,
        eviction_policy='evict_last', other=0.0)
    tmp239 = tl.load(in_ptr2 + (784 + r2 + 1024 * x1), xmask,
        eviction_policy='evict_last', other=0.0)
    tmp248 = tl.load(in_ptr2 + (800 + r2 + 1024 * x1), xmask,
        eviction_policy='evict_last', other=0.0)
    tmp257 = tl.load(in_ptr2 + (816 + r2 + 1024 * x1), xmask,
        eviction_policy='evict_last', other=0.0)
    tmp266 = tl.load(in_ptr2 + (832 + r2 + 1024 * x1), xmask,
        eviction_policy='evict_last', other=0.0)
    tmp275 = tl.load(in_ptr2 + (848 + r2 + 1024 * x1), xmask,
        eviction_policy='evict_last', other=0.0)
    tmp284 = tl.load(in_ptr2 + (864 + r2 + 1024 * x1), xmask,
        eviction_policy='evict_last', other=0.0)
    tmp293 = tl.load(in_ptr2 + (880 + r2 + 1024 * x1), xmask,
        eviction_policy='evict_last', other=0.0)
    tmp302 = tl.load(in_ptr2 + (896 + r2 + 1024 * x1), xmask,
        eviction_policy='evict_last', other=0.0)
    tmp2 = tmp0 - tmp1
    tmp4 = tmp0 - tmp3
    tmp6 = tmp0 - tmp5
    tmp8 = tmp0 - tmp7
    tmp10 = tmp0 - tmp9
    tmp12 = tmp0 - tmp11
    tmp14 = tmp0 - tmp13
    tmp16 = tmp0 - tmp15
    tmp18 = tmp0 - tmp17
    tmp20 = tmp0 - tmp19
    tmp22 = tmp0 - tmp21
    tmp24 = tmp0 - tmp23
    tmp26 = tmp0 - tmp25
    tmp28 = tmp0 - tmp27
    tmp30 = tmp0 - tmp29
    tmp32 = tmp0 - tmp31
    tmp34 = tmp0 - tmp33
    tmp36 = tmp0 - tmp35
    tmp38 = tmp0 - tmp37
    tmp40 = tmp0 - tmp39
    tmp42 = tmp0 - tmp41
    tmp44 = tmp0 - tmp43
    tmp46 = tmp0 - tmp45
    tmp48 = tmp0 - tmp47
    tmp50 = tmp0 - tmp49
    tmp52 = tmp0 - tmp51
    tmp54 = tmp0 - tmp53
    tmp56 = tmp0 - tmp55
    tmp59 = tmp57 - tmp58
    tmp60 = tl_math.exp(tmp59)
    tmp62 = tmp60 / tmp61
    tmp63 = tmp2 * tmp62
    tmp64 = tl.broadcast_to(tmp63, [XBLOCK, RBLOCK])
    tmp66 = tl.where(xmask, tmp64, 0)
    tmp67 = tl.sum(tmp66, 1)[:, None]
    tmp69 = tmp68 - tmp58
    tmp70 = tl_math.exp(tmp69)
    tmp71 = tmp70 / tmp61
    tmp72 = tmp4 * tmp71
    tmp73 = tl.broadcast_to(tmp72, [XBLOCK, RBLOCK])
    tmp75 = tl.where(xmask, tmp73, 0)
    tmp76 = tl.sum(tmp75, 1)[:, None]
    tmp78 = tmp77 - tmp58
    tmp79 = tl_math.exp(tmp78)
    tmp80 = tmp79 / tmp61
    tmp81 = tmp6 * tmp80
    tmp82 = tl.broadcast_to(tmp81, [XBLOCK, RBLOCK])
    tmp84 = tl.where(xmask, tmp82, 0)
    tmp85 = tl.sum(tmp84, 1)[:, None]
    tmp87 = tmp86 - tmp58
    tmp88 = tl_math.exp(tmp87)
    tmp89 = tmp88 / tmp61
    tmp90 = tmp8 * tmp89
    tmp91 = tl.broadcast_to(tmp90, [XBLOCK, RBLOCK])
    tmp93 = tl.where(xmask, tmp91, 0)
    tmp94 = tl.sum(tmp93, 1)[:, None]
    tmp96 = tmp95 - tmp58
    tmp97 = tl_math.exp(tmp96)
    tmp98 = tmp97 / tmp61
    tmp99 = tmp10 * tmp98
    tmp100 = tl.broadcast_to(tmp99, [XBLOCK, RBLOCK])
    tmp102 = tl.where(xmask, tmp100, 0)
    tmp103 = tl.sum(tmp102, 1)[:, None]
    tmp105 = tmp104 - tmp58
    tmp106 = tl_math.exp(tmp105)
    tmp107 = tmp106 / tmp61
    tmp108 = tmp12 * tmp107
    tmp109 = tl.broadcast_to(tmp108, [XBLOCK, RBLOCK])
    tmp111 = tl.where(xmask, tmp109, 0)
    tmp112 = tl.sum(tmp111, 1)[:, None]
    tmp114 = tmp113 - tmp58
    tmp115 = tl_math.exp(tmp114)
    tmp116 = tmp115 / tmp61
    tmp117 = tmp14 * tmp116
    tmp118 = tl.broadcast_to(tmp117, [XBLOCK, RBLOCK])
    tmp120 = tl.where(xmask, tmp118, 0)
    tmp121 = tl.sum(tmp120, 1)[:, None]
    tmp123 = tmp122 - tmp58
    tmp124 = tl_math.exp(tmp123)
    tmp125 = tmp124 / tmp61
    tmp126 = tmp16 * tmp125
    tmp127 = tl.broadcast_to(tmp126, [XBLOCK, RBLOCK])
    tmp129 = tl.where(xmask, tmp127, 0)
    tmp130 = tl.sum(tmp129, 1)[:, None]
    tmp132 = tmp131 - tmp58
    tmp133 = tl_math.exp(tmp132)
    tmp134 = tmp133 / tmp61
    tmp135 = tmp18 * tmp134
    tmp136 = tl.broadcast_to(tmp135, [XBLOCK, RBLOCK])
    tmp138 = tl.where(xmask, tmp136, 0)
    tmp139 = tl.sum(tmp138, 1)[:, None]
    tmp141 = tmp140 - tmp58
    tmp142 = tl_math.exp(tmp141)
    tmp143 = tmp142 / tmp61
    tmp144 = tmp20 * tmp143
    tmp145 = tl.broadcast_to(tmp144, [XBLOCK, RBLOCK])
    tmp147 = tl.where(xmask, tmp145, 0)
    tmp148 = tl.sum(tmp147, 1)[:, None]
    tmp150 = tmp149 - tmp58
    tmp151 = tl_math.exp(tmp150)
    tmp152 = tmp151 / tmp61
    tmp153 = tmp22 * tmp152
    tmp154 = tl.broadcast_to(tmp153, [XBLOCK, RBLOCK])
    tmp156 = tl.where(xmask, tmp154, 0)
    tmp157 = tl.sum(tmp156, 1)[:, None]
    tmp159 = tmp158 - tmp58
    tmp160 = tl_math.exp(tmp159)
    tmp161 = tmp160 / tmp61
    tmp162 = tmp24 * tmp161
    tmp163 = tl.broadcast_to(tmp162, [XBLOCK, RBLOCK])
    tmp165 = tl.where(xmask, tmp163, 0)
    tmp166 = tl.sum(tmp165, 1)[:, None]
    tmp168 = tmp167 - tmp58
    tmp169 = tl_math.exp(tmp168)
    tmp170 = tmp169 / tmp61
    tmp171 = tmp26 * tmp170
    tmp172 = tl.broadcast_to(tmp171, [XBLOCK, RBLOCK])
    tmp174 = tl.where(xmask, tmp172, 0)
    tmp175 = tl.sum(tmp174, 1)[:, None]
    tmp177 = tmp176 - tmp58
    tmp178 = tl_math.exp(tmp177)
    tmp179 = tmp178 / tmp61
    tmp180 = tmp28 * tmp179
    tmp181 = tl.broadcast_to(tmp180, [XBLOCK, RBLOCK])
    tmp183 = tl.where(xmask, tmp181, 0)
    tmp184 = tl.sum(tmp183, 1)[:, None]
    tmp186 = tmp185 - tmp58
    tmp187 = tl_math.exp(tmp186)
    tmp188 = tmp187 / tmp61
    tmp189 = tmp30 * tmp188
    tmp190 = tl.broadcast_to(tmp189, [XBLOCK, RBLOCK])
    tmp192 = tl.where(xmask, tmp190, 0)
    tmp193 = tl.sum(tmp192, 1)[:, None]
    tmp195 = tmp194 - tmp58
    tmp196 = tl_math.exp(tmp195)
    tmp197 = tmp196 / tmp61
    tmp198 = tmp32 * tmp197
    tmp199 = tl.broadcast_to(tmp198, [XBLOCK, RBLOCK])
    tmp201 = tl.where(xmask, tmp199, 0)
    tmp202 = tl.sum(tmp201, 1)[:, None]
    tmp204 = tmp203 - tmp58
    tmp205 = tl_math.exp(tmp204)
    tmp206 = tmp205 / tmp61
    tmp207 = tmp34 * tmp206
    tmp208 = tl.broadcast_to(tmp207, [XBLOCK, RBLOCK])
    tmp210 = tl.where(xmask, tmp208, 0)
    tmp211 = tl.sum(tmp210, 1)[:, None]
    tmp213 = tmp212 - tmp58
    tmp214 = tl_math.exp(tmp213)
    tmp215 = tmp214 / tmp61
    tmp216 = tmp36 * tmp215
    tmp217 = tl.broadcast_to(tmp216, [XBLOCK, RBLOCK])
    tmp219 = tl.where(xmask, tmp217, 0)
    tmp220 = tl.sum(tmp219, 1)[:, None]
    tmp222 = tmp221 - tmp58
    tmp223 = tl_math.exp(tmp222)
    tmp224 = tmp223 / tmp61
    tmp225 = tmp38 * tmp224
    tmp226 = tl.broadcast_to(tmp225, [XBLOCK, RBLOCK])
    tmp228 = tl.where(xmask, tmp226, 0)
    tmp229 = tl.sum(tmp228, 1)[:, None]
    tmp231 = tmp230 - tmp58
    tmp232 = tl_math.exp(tmp231)
    tmp233 = tmp232 / tmp61
    tmp234 = tmp40 * tmp233
    tmp235 = tl.broadcast_to(tmp234, [XBLOCK, RBLOCK])
    tmp237 = tl.where(xmask, tmp235, 0)
    tmp238 = tl.sum(tmp237, 1)[:, None]
    tmp240 = tmp239 - tmp58
    tmp241 = tl_math.exp(tmp240)
    tmp242 = tmp241 / tmp61
    tmp243 = tmp42 * tmp242
    tmp244 = tl.broadcast_to(tmp243, [XBLOCK, RBLOCK])
    tmp246 = tl.where(xmask, tmp244, 0)
    tmp247 = tl.sum(tmp246, 1)[:, None]
    tmp249 = tmp248 - tmp58
    tmp250 = tl_math.exp(tmp249)
    tmp251 = tmp250 / tmp61
    tmp252 = tmp44 * tmp251
    tmp253 = tl.broadcast_to(tmp252, [XBLOCK, RBLOCK])
    tmp255 = tl.where(xmask, tmp253, 0)
    tmp256 = tl.sum(tmp255, 1)[:, None]
    tmp258 = tmp257 - tmp58
    tmp259 = tl_math.exp(tmp258)
    tmp260 = tmp259 / tmp61
    tmp261 = tmp46 * tmp260
    tmp262 = tl.broadcast_to(tmp261, [XBLOCK, RBLOCK])
    tmp264 = tl.where(xmask, tmp262, 0)
    tmp265 = tl.sum(tmp264, 1)[:, None]
    tmp267 = tmp266 - tmp58
    tmp268 = tl_math.exp(tmp267)
    tmp269 = tmp268 / tmp61
    tmp270 = tmp48 * tmp269
    tmp271 = tl.broadcast_to(tmp270, [XBLOCK, RBLOCK])
    tmp273 = tl.where(xmask, tmp271, 0)
    tmp274 = tl.sum(tmp273, 1)[:, None]
    tmp276 = tmp275 - tmp58
    tmp277 = tl_math.exp(tmp276)
    tmp278 = tmp277 / tmp61
    tmp279 = tmp50 * tmp278
    tmp280 = tl.broadcast_to(tmp279, [XBLOCK, RBLOCK])
    tmp282 = tl.where(xmask, tmp280, 0)
    tmp283 = tl.sum(tmp282, 1)[:, None]
    tmp285 = tmp284 - tmp58
    tmp286 = tl_math.exp(tmp285)
    tmp287 = tmp286 / tmp61
    tmp288 = tmp52 * tmp287
    tmp289 = tl.broadcast_to(tmp288, [XBLOCK, RBLOCK])
    tmp291 = tl.where(xmask, tmp289, 0)
    tmp292 = tl.sum(tmp291, 1)[:, None]
    tmp294 = tmp293 - tmp58
    tmp295 = tl_math.exp(tmp294)
    tmp296 = tmp295 / tmp61
    tmp297 = tmp54 * tmp296
    tmp298 = tl.broadcast_to(tmp297, [XBLOCK, RBLOCK])
    tmp300 = tl.where(xmask, tmp298, 0)
    tmp301 = tl.sum(tmp300, 1)[:, None]
    tmp303 = tmp302 - tmp58
    tmp304 = tl_math.exp(tmp303)
    tmp305 = tmp304 / tmp61
    tmp306 = tmp56 * tmp305
    tmp307 = tl.broadcast_to(tmp306, [XBLOCK, RBLOCK])
    tmp309 = tl.where(xmask, tmp307, 0)
    tmp310 = tl.sum(tmp309, 1)[:, None]
    tl.store(out_ptr0 + (r2 + 16 * x3), tmp2, xmask)
    tl.store(out_ptr1 + (r2 + 16 * x3), tmp4, xmask)
    tl.store(out_ptr2 + (r2 + 16 * x3), tmp6, xmask)
    tl.store(out_ptr3 + (r2 + 16 * x3), tmp8, xmask)
    tl.store(out_ptr4 + (r2 + 16 * x3), tmp10, xmask)
    tl.store(out_ptr5 + (r2 + 16 * x3), tmp12, xmask)
    tl.store(out_ptr6 + (r2 + 16 * x3), tmp14, xmask)
    tl.store(out_ptr7 + (r2 + 16 * x3), tmp16, xmask)
    tl.store(out_ptr8 + (r2 + 16 * x3), tmp18, xmask)
    tl.store(out_ptr9 + (r2 + 16 * x3), tmp20, xmask)
    tl.store(out_ptr10 + (r2 + 16 * x3), tmp22, xmask)
    tl.store(out_ptr11 + (r2 + 16 * x3), tmp24, xmask)
    tl.store(out_ptr12 + (r2 + 16 * x3), tmp26, xmask)
    tl.store(out_ptr13 + (r2 + 16 * x3), tmp28, xmask)
    tl.store(out_ptr14 + (r2 + 16 * x3), tmp30, xmask)
    tl.store(out_ptr15 + (r2 + 16 * x3), tmp32, xmask)
    tl.store(out_ptr16 + (r2 + 16 * x3), tmp34, xmask)
    tl.store(out_ptr17 + (r2 + 16 * x3), tmp36, xmask)
    tl.store(out_ptr18 + (r2 + 16 * x3), tmp38, xmask)
    tl.store(out_ptr19 + (r2 + 16 * x3), tmp40, xmask)
    tl.store(out_ptr20 + (r2 + 16 * x3), tmp42, xmask)
    tl.store(out_ptr21 + (r2 + 16 * x3), tmp44, xmask)
    tl.store(out_ptr22 + (r2 + 16 * x3), tmp46, xmask)
    tl.store(out_ptr23 + (r2 + 16 * x3), tmp48, xmask)
    tl.store(out_ptr24 + (r2 + 16 * x3), tmp50, xmask)
    tl.store(out_ptr25 + (r2 + 16 * x3), tmp52, xmask)
    tl.store(out_ptr26 + (r2 + 16 * x3), tmp54, xmask)
    tl.store(out_ptr27 + (r2 + 16 * x3), tmp56, xmask)
    tl.store(out_ptr28 + x3, tmp67, xmask)
    tl.store(out_ptr29 + x3, tmp76, xmask)
    tl.store(out_ptr30 + x3, tmp85, xmask)
    tl.store(out_ptr31 + x3, tmp94, xmask)
    tl.store(out_ptr32 + x3, tmp103, xmask)
    tl.store(out_ptr33 + x3, tmp112, xmask)
    tl.store(out_ptr34 + x3, tmp121, xmask)
    tl.store(out_ptr35 + x3, tmp130, xmask)
    tl.store(out_ptr36 + x3, tmp139, xmask)
    tl.store(out_ptr37 + x3, tmp148, xmask)
    tl.store(out_ptr38 + x3, tmp157, xmask)
    tl.store(out_ptr39 + x3, tmp166, xmask)
    tl.store(out_ptr40 + x3, tmp175, xmask)
    tl.store(out_ptr41 + x3, tmp184, xmask)
    tl.store(out_ptr42 + x3, tmp193, xmask)
    tl.store(out_ptr43 + x3, tmp202, xmask)
    tl.store(out_ptr44 + x3, tmp211, xmask)
    tl.store(out_ptr45 + x3, tmp220, xmask)
    tl.store(out_ptr46 + x3, tmp229, xmask)
    tl.store(out_ptr47 + x3, tmp238, xmask)
    tl.store(out_ptr48 + x3, tmp247, xmask)
    tl.store(out_ptr49 + x3, tmp256, xmask)
    tl.store(out_ptr50 + x3, tmp265, xmask)
    tl.store(out_ptr51 + x3, tmp274, xmask)
    tl.store(out_ptr52 + x3, tmp283, xmask)
    tl.store(out_ptr53 + x3, tmp292, xmask)
    tl.store(out_ptr54 + x3, tmp301, xmask)
    tl.store(out_ptr55 + x3, tmp310, xmask)


@triton.jit
def triton_per_fused_mul_sub_sum_3(in_ptr0, in_ptr1, in_ptr2, in_ptr3,
    in_ptr4, out_ptr0, out_ptr1, out_ptr2, out_ptr3, out_ptr4, out_ptr5,
    out_ptr6, out_ptr7, out_ptr8, out_ptr9, out_ptr10, out_ptr11, out_ptr12,
    out_ptr13, xnumel, rnumel, XBLOCK: tl.constexpr):
    xnumel = 16
    RBLOCK: tl.constexpr = 16
    xoffset = tl.program_id(0) * XBLOCK
    xindex = xoffset + tl.arange(0, XBLOCK)[:, None]
    xmask = xindex < xnumel
    rindex = tl.arange(0, RBLOCK)[None, :]
    tl.full([XBLOCK, RBLOCK], True, tl.int1)
    r2 = rindex
    x3 = xindex
    x0 = xindex % 4
    x1 = xindex // 4
    tmp0 = tl.load(in_ptr0 + (r2 + 16 * x3), xmask, other=0.0)
    tmp1 = tl.load(in_ptr1 + (228 + x0), xmask, eviction_policy='evict_last')
    tmp3 = tl.load(in_ptr1 + (232 + x0), xmask, eviction_policy='evict_last')
    tmp5 = tl.load(in_ptr1 + (236 + x0), xmask, eviction_policy='evict_last')
    tmp7 = tl.load(in_ptr1 + (240 + x0), xmask, eviction_policy='evict_last')
    tmp9 = tl.load(in_ptr1 + (244 + x0), xmask, eviction_policy='evict_last')
    tmp11 = tl.load(in_ptr1 + (248 + x0), xmask, eviction_policy='evict_last')
    tmp13 = tl.load(in_ptr1 + (252 + x0), xmask, eviction_policy='evict_last')
    tmp15 = tl.load(in_ptr2 + (912 + r2 + 1024 * x1), xmask,
        eviction_policy='evict_last', other=0.0)
    tmp16 = tl.load(in_ptr3 + (r2 + 16 * x1), xmask, eviction_policy=
        'evict_last', other=0.0)
    tmp19 = tl.load(in_ptr4 + (r2 + 16 * x1), xmask, eviction_policy=
        'evict_last', other=0.0)
    tmp26 = tl.load(in_ptr2 + (928 + r2 + 1024 * x1), xmask,
        eviction_policy='evict_last', other=0.0)
    tmp35 = tl.load(in_ptr2 + (944 + r2 + 1024 * x1), xmask,
        eviction_policy='evict_last', other=0.0)
    tmp44 = tl.load(in_ptr2 + (960 + r2 + 1024 * x1), xmask,
        eviction_policy='evict_last', other=0.0)
    tmp53 = tl.load(in_ptr2 + (976 + r2 + 1024 * x1), xmask,
        eviction_policy='evict_last', other=0.0)
    tmp62 = tl.load(in_ptr2 + (992 + r2 + 1024 * x1), xmask,
        eviction_policy='evict_last', other=0.0)
    tmp71 = tl.load(in_ptr2 + (1008 + r2 + 1024 * x1), xmask,
        eviction_policy='evict_last', other=0.0)
    tmp2 = tmp0 - tmp1
    tmp4 = tmp0 - tmp3
    tmp6 = tmp0 - tmp5
    tmp8 = tmp0 - tmp7
    tmp10 = tmp0 - tmp9
    tmp12 = tmp0 - tmp11
    tmp14 = tmp0 - tmp13
    tmp17 = tmp15 - tmp16
    tmp18 = tl_math.exp(tmp17)
    tmp20 = tmp18 / tmp19
    tmp21 = tmp2 * tmp20
    tmp22 = tl.broadcast_to(tmp21, [XBLOCK, RBLOCK])
    tmp24 = tl.where(xmask, tmp22, 0)
    tmp25 = tl.sum(tmp24, 1)[:, None]
    tmp27 = tmp26 - tmp16
    tmp28 = tl_math.exp(tmp27)
    tmp29 = tmp28 / tmp19
    tmp30 = tmp4 * tmp29
    tmp31 = tl.broadcast_to(tmp30, [XBLOCK, RBLOCK])
    tmp33 = tl.where(xmask, tmp31, 0)
    tmp34 = tl.sum(tmp33, 1)[:, None]
    tmp36 = tmp35 - tmp16
    tmp37 = tl_math.exp(tmp36)
    tmp38 = tmp37 / tmp19
    tmp39 = tmp6 * tmp38
    tmp40 = tl.broadcast_to(tmp39, [XBLOCK, RBLOCK])
    tmp42 = tl.where(xmask, tmp40, 0)
    tmp43 = tl.sum(tmp42, 1)[:, None]
    tmp45 = tmp44 - tmp16
    tmp46 = tl_math.exp(tmp45)
    tmp47 = tmp46 / tmp19
    tmp48 = tmp8 * tmp47
    tmp49 = tl.broadcast_to(tmp48, [XBLOCK, RBLOCK])
    tmp51 = tl.where(xmask, tmp49, 0)
    tmp52 = tl.sum(tmp51, 1)[:, None]
    tmp54 = tmp53 - tmp16
    tmp55 = tl_math.exp(tmp54)
    tmp56 = tmp55 / tmp19
    tmp57 = tmp10 * tmp56
    tmp58 = tl.broadcast_to(tmp57, [XBLOCK, RBLOCK])
    tmp60 = tl.where(xmask, tmp58, 0)
    tmp61 = tl.sum(tmp60, 1)[:, None]
    tmp63 = tmp62 - tmp16
    tmp64 = tl_math.exp(tmp63)
    tmp65 = tmp64 / tmp19
    tmp66 = tmp12 * tmp65
    tmp67 = tl.broadcast_to(tmp66, [XBLOCK, RBLOCK])
    tmp69 = tl.where(xmask, tmp67, 0)
    tmp70 = tl.sum(tmp69, 1)[:, None]
    tmp72 = tmp71 - tmp16
    tmp73 = tl_math.exp(tmp72)
    tmp74 = tmp73 / tmp19
    tmp75 = tmp14 * tmp74
    tmp76 = tl.broadcast_to(tmp75, [XBLOCK, RBLOCK])
    tmp78 = tl.where(xmask, tmp76, 0)
    tmp79 = tl.sum(tmp78, 1)[:, None]
    tl.store(out_ptr0 + (r2 + 16 * x3), tmp2, xmask)
    tl.store(out_ptr1 + (r2 + 16 * x3), tmp4, xmask)
    tl.store(out_ptr2 + (r2 + 16 * x3), tmp6, xmask)
    tl.store(out_ptr3 + (r2 + 16 * x3), tmp8, xmask)
    tl.store(out_ptr4 + (r2 + 16 * x3), tmp10, xmask)
    tl.store(out_ptr5 + (r2 + 16 * x3), tmp12, xmask)
    tl.store(out_ptr6 + (r2 + 16 * x3), tmp14, xmask)
    tl.store(out_ptr7 + x3, tmp25, xmask)
    tl.store(out_ptr8 + x3, tmp34, xmask)
    tl.store(out_ptr9 + x3, tmp43, xmask)
    tl.store(out_ptr10 + x3, tmp52, xmask)
    tl.store(out_ptr11 + x3, tmp61, xmask)
    tl.store(out_ptr12 + x3, tmp70, xmask)
    tl.store(out_ptr13 + x3, tmp79, xmask)


@triton.jit
def triton_poi_fused_copy_zeros_4(in_out_ptr0, in_ptr0, in_ptr1, in_ptr2,
    in_ptr3, in_ptr4, in_ptr5, in_ptr6, in_ptr7, in_ptr8, in_ptr9, in_ptr10,
    in_ptr11, in_ptr12, in_ptr13, in_ptr14, in_ptr15, in_ptr16, in_ptr17,
    in_ptr18, in_ptr19, in_ptr20, in_ptr21, in_ptr22, in_ptr23, in_ptr24,
    in_ptr25, in_ptr26, in_ptr27, in_ptr28, in_ptr29, in_ptr30, in_ptr31,
    in_ptr32, in_ptr33, in_ptr34, in_ptr35, in_ptr36, in_ptr37, in_ptr38,
    in_ptr39, in_ptr40, in_ptr41, in_ptr42, in_ptr43, in_ptr44, in_ptr45,
    in_ptr46, in_ptr47, in_ptr48, in_ptr49, in_ptr50, in_ptr51, in_ptr52,
    in_ptr53, in_ptr54, in_ptr55, in_ptr56, in_ptr57, in_ptr58, in_ptr59,
    in_ptr60, in_ptr61, in_ptr62, in_ptr63, xnumel, XBLOCK: tl.constexpr):
    xnumel = 1024
    xoffset = tl.program_id(0) * XBLOCK
    xindex = xoffset + tl.arange(0, XBLOCK)[:]
    xmask = xindex < xnumel
    x1 = xindex // 4 % 64
    x0 = xindex % 4
    x2 = xindex // 256
    x3 = xindex
    tmp0 = x1
    tmp1 = tl.full([1], 4, tl.int64)
    tmp2 = tmp0 >= tmp1
    tmp3 = tl.full([1], 5, tl.int64)
    tmp4 = tmp0 < tmp3
    tmp5 = tmp2 & tmp4
    tmp6 = tl.load(in_ptr0 + (x0 + 4 * x2), tmp5 & xmask, eviction_policy=
        'evict_last', other=0.0)
    tmp7 = tl.full([1], 3, tl.int64)
    tmp8 = tmp0 >= tmp7
    tmp9 = tmp0 < tmp1
    tmp10 = tmp8 & tmp9
    tmp11 = tl.load(in_ptr1 + (x0 + 4 * x2), tmp10 & xmask, eviction_policy
        ='evict_last', other=0.0)
    tmp12 = tl.full([1], 2, tl.int64)
    tmp13 = tmp0 >= tmp12
    tmp14 = tmp0 < tmp7
    tmp15 = tmp13 & tmp14
    tmp16 = tl.load(in_ptr2 + (x0 + 4 * x2), tmp15 & xmask, eviction_policy
        ='evict_last', other=0.0)
    tmp17 = tl.full([1], 1, tl.int64)
    tmp18 = tmp0 >= tmp17
    tmp19 = tmp0 < tmp12
    tmp20 = tmp18 & tmp19
    tmp21 = tl.load(in_ptr3 + (x0 + 4 * x2), tmp20 & xmask, eviction_policy
        ='evict_last', other=0.0)
    tmp22 = tmp0 < tmp17
    tmp23 = tl.load(in_ptr4 + (x0 + 4 * x2), tmp22 & xmask, eviction_policy
        ='evict_last', other=0.0)
    tmp24 = 0.0
    tmp25 = tl.where(tmp22, tmp23, tmp24)
    tmp26 = tl.where(tmp20, tmp21, tmp25)
    tmp27 = tl.where(tmp15, tmp16, tmp26)
    tmp28 = tl.where(tmp10, tmp11, tmp27)
    tmp29 = tl.where(tmp5, tmp6, tmp28)
    tmp30 = tl.full([1], 8, tl.int64)
    tmp31 = tmp0 >= tmp30
    tmp32 = tl.full([1], 9, tl.int64)
    tmp33 = tmp0 < tmp32
    tmp34 = tmp31 & tmp33
    tmp35 = tl.load(in_ptr5 + (x0 + 4 * x2), tmp34 & xmask, eviction_policy
        ='evict_last', other=0.0)
    tmp36 = tl.full([1], 7, tl.int64)
    tmp37 = tmp0 >= tmp36
    tmp38 = tmp0 < tmp30
    tmp39 = tmp37 & tmp38
    tmp40 = tl.load(in_ptr6 + (x0 + 4 * x2), tmp39 & xmask, eviction_policy
        ='evict_last', other=0.0)
    tmp41 = tl.full([1], 6, tl.int64)
    tmp42 = tmp0 >= tmp41
    tmp43 = tmp0 < tmp36
    tmp44 = tmp42 & tmp43
    tmp45 = tl.load(in_ptr7 + (x0 + 4 * x2), tmp44 & xmask, eviction_policy
        ='evict_last', other=0.0)
    tmp46 = tmp0 >= tmp3
    tmp47 = tmp0 < tmp41
    tmp48 = tmp46 & tmp47
    tmp49 = tl.load(in_ptr8 + (x0 + 4 * x2), tmp48 & xmask, eviction_policy
        ='evict_last', other=0.0)
    tmp50 = tl.where(tmp48, tmp49, tmp29)
    tmp51 = tl.where(tmp44, tmp45, tmp50)
    tmp52 = tl.where(tmp39, tmp40, tmp51)
    tmp53 = tl.where(tmp34, tmp35, tmp52)
    tmp54 = tl.full([1], 12, tl.int64)
    tmp55 = tmp0 >= tmp54
    tmp56 = tl.full([1], 13, tl.int64)
    tmp57 = tmp0 < tmp56
    tmp58 = tmp55 & tmp57
    tmp59 = tl.load(in_ptr9 + (x0 + 4 * x2), tmp58 & xmask, eviction_policy
        ='evict_last', other=0.0)
    tmp60 = tl.full([1], 11, tl.int64)
    tmp61 = tmp0 >= tmp60
    tmp62 = tmp0 < tmp54
    tmp63 = tmp61 & tmp62
    tmp64 = tl.load(in_ptr10 + (x0 + 4 * x2), tmp63 & xmask,
        eviction_policy='evict_last', other=0.0)
    tmp65 = tl.full([1], 10, tl.int64)
    tmp66 = tmp0 >= tmp65
    tmp67 = tmp0 < tmp60
    tmp68 = tmp66 & tmp67
    tmp69 = tl.load(in_ptr11 + (x0 + 4 * x2), tmp68 & xmask,
        eviction_policy='evict_last', other=0.0)
    tmp70 = tmp0 >= tmp32
    tmp71 = tmp0 < tmp65
    tmp72 = tmp70 & tmp71
    tmp73 = tl.load(in_ptr12 + (x0 + 4 * x2), tmp72 & xmask,
        eviction_policy='evict_last', other=0.0)
    tmp74 = tl.where(tmp72, tmp73, tmp53)
    tmp75 = tl.where(tmp68, tmp69, tmp74)
    tmp76 = tl.where(tmp63, tmp64, tmp75)
    tmp77 = tl.where(tmp58, tmp59, tmp76)
    tmp78 = tl.full([1], 16, tl.int64)
    tmp79 = tmp0 >= tmp78
    tmp80 = tl.full([1], 17, tl.int64)
    tmp81 = tmp0 < tmp80
    tmp82 = tmp79 & tmp81
    tmp83 = tl.load(in_ptr13 + (x0 + 4 * x2), tmp82 & xmask,
        eviction_policy='evict_last', other=0.0)
    tmp84 = tl.full([1], 15, tl.int64)
    tmp85 = tmp0 >= tmp84
    tmp86 = tmp0 < tmp78
    tmp87 = tmp85 & tmp86
    tmp88 = tl.load(in_ptr14 + (x0 + 4 * x2), tmp87 & xmask,
        eviction_policy='evict_last', other=0.0)
    tmp89 = tl.full([1], 14, tl.int64)
    tmp90 = tmp0 >= tmp89
    tmp91 = tmp0 < tmp84
    tmp92 = tmp90 & tmp91
    tmp93 = tl.load(in_ptr15 + (x0 + 4 * x2), tmp92 & xmask,
        eviction_policy='evict_last', other=0.0)
    tmp94 = tmp0 >= tmp56
    tmp95 = tmp0 < tmp89
    tmp96 = tmp94 & tmp95
    tmp97 = tl.load(in_ptr16 + (x0 + 4 * x2), tmp96 & xmask,
        eviction_policy='evict_last', other=0.0)
    tmp98 = tl.where(tmp96, tmp97, tmp77)
    tmp99 = tl.where(tmp92, tmp93, tmp98)
    tmp100 = tl.where(tmp87, tmp88, tmp99)
    tmp101 = tl.where(tmp82, tmp83, tmp100)
    tmp102 = tl.full([1], 20, tl.int64)
    tmp103 = tmp0 >= tmp102
    tmp104 = tl.full([1], 21, tl.int64)
    tmp105 = tmp0 < tmp104
    tmp106 = tmp103 & tmp105
    tmp107 = tl.load(in_ptr17 + (x0 + 4 * x2), tmp106 & xmask,
        eviction_policy='evict_last', other=0.0)
    tmp108 = tl.full([1], 19, tl.int64)
    tmp109 = tmp0 >= tmp108
    tmp110 = tmp0 < tmp102
    tmp111 = tmp109 & tmp110
    tmp112 = tl.load(in_ptr18 + (x0 + 4 * x2), tmp111 & xmask,
        eviction_policy='evict_last', other=0.0)
    tmp113 = tl.full([1], 18, tl.int64)
    tmp114 = tmp0 >= tmp113
    tmp115 = tmp0 < tmp108
    tmp116 = tmp114 & tmp115
    tmp117 = tl.load(in_ptr19 + (x0 + 4 * x2), tmp116 & xmask,
        eviction_policy='evict_last', other=0.0)
    tmp118 = tmp0 >= tmp80
    tmp119 = tmp0 < tmp113
    tmp120 = tmp118 & tmp119
    tmp121 = tl.load(in_ptr20 + (x0 + 4 * x2), tmp120 & xmask,
        eviction_policy='evict_last', other=0.0)
    tmp122 = tl.where(tmp120, tmp121, tmp101)
    tmp123 = tl.where(tmp116, tmp117, tmp122)
    tmp124 = tl.where(tmp111, tmp112, tmp123)
    tmp125 = tl.where(tmp106, tmp107, tmp124)
    tmp126 = tl.full([1], 24, tl.int64)
    tmp127 = tmp0 >= tmp126
    tmp128 = tl.full([1], 25, tl.int64)
    tmp129 = tmp0 < tmp128
    tmp130 = tmp127 & tmp129
    tmp131 = tl.load(in_ptr21 + (x0 + 4 * x2), tmp130 & xmask,
        eviction_policy='evict_last', other=0.0)
    tmp132 = tl.full([1], 23, tl.int64)
    tmp133 = tmp0 >= tmp132
    tmp134 = tmp0 < tmp126
    tmp135 = tmp133 & tmp134
    tmp136 = tl.load(in_ptr22 + (x0 + 4 * x2), tmp135 & xmask,
        eviction_policy='evict_last', other=0.0)
    tmp137 = tl.full([1], 22, tl.int64)
    tmp138 = tmp0 >= tmp137
    tmp139 = tmp0 < tmp132
    tmp140 = tmp138 & tmp139
    tmp141 = tl.load(in_ptr23 + (x0 + 4 * x2), tmp140 & xmask,
        eviction_policy='evict_last', other=0.0)
    tmp142 = tmp0 >= tmp104
    tmp143 = tmp0 < tmp137
    tmp144 = tmp142 & tmp143
    tmp145 = tl.load(in_ptr24 + (x0 + 4 * x2), tmp144 & xmask,
        eviction_policy='evict_last', other=0.0)
    tmp146 = tl.where(tmp144, tmp145, tmp125)
    tmp147 = tl.where(tmp140, tmp141, tmp146)
    tmp148 = tl.where(tmp135, tmp136, tmp147)
    tmp149 = tl.where(tmp130, tmp131, tmp148)
    tmp150 = tl.full([1], 28, tl.int64)
    tmp151 = tmp0 >= tmp150
    tmp152 = tl.full([1], 29, tl.int64)
    tmp153 = tmp0 < tmp152
    tmp154 = tmp151 & tmp153
    tmp155 = tl.load(in_ptr25 + (x0 + 4 * x2), tmp154 & xmask,
        eviction_policy='evict_last', other=0.0)
    tmp156 = tl.full([1], 27, tl.int64)
    tmp157 = tmp0 >= tmp156
    tmp158 = tmp0 < tmp150
    tmp159 = tmp157 & tmp158
    tmp160 = tl.load(in_ptr26 + (x0 + 4 * x2), tmp159 & xmask,
        eviction_policy='evict_last', other=0.0)
    tmp161 = tl.full([1], 26, tl.int64)
    tmp162 = tmp0 >= tmp161
    tmp163 = tmp0 < tmp156
    tmp164 = tmp162 & tmp163
    tmp165 = tl.load(in_ptr27 + (x0 + 4 * x2), tmp164 & xmask,
        eviction_policy='evict_last', other=0.0)
    tmp166 = tmp0 >= tmp128
    tmp167 = tmp0 < tmp161
    tmp168 = tmp166 & tmp167
    tmp169 = tl.load(in_ptr28 + (x0 + 4 * x2), tmp168 & xmask,
        eviction_policy='evict_last', other=0.0)
    tmp170 = tl.where(tmp168, tmp169, tmp149)
    tmp171 = tl.where(tmp164, tmp165, tmp170)
    tmp172 = tl.where(tmp159, tmp160, tmp171)
    tmp173 = tl.where(tmp154, tmp155, tmp172)
    tmp174 = tl.full([1], 32, tl.int64)
    tmp175 = tmp0 >= tmp174
    tmp176 = tl.full([1], 33, tl.int64)
    tmp177 = tmp0 < tmp176
    tmp178 = tmp175 & tmp177
    tmp179 = tl.load(in_ptr29 + (x0 + 4 * x2), tmp178 & xmask,
        eviction_policy='evict_last', other=0.0)
    tmp180 = tl.full([1], 31, tl.int64)
    tmp181 = tmp0 >= tmp180
    tmp182 = tmp0 < tmp174
    tmp183 = tmp181 & tmp182
    tmp184 = tl.load(in_ptr30 + (x0 + 4 * x2), tmp183 & xmask,
        eviction_policy='evict_last', other=0.0)
    tmp185 = tl.full([1], 30, tl.int64)
    tmp186 = tmp0 >= tmp185
    tmp187 = tmp0 < tmp180
    tmp188 = tmp186 & tmp187
    tmp189 = tl.load(in_ptr31 + (x0 + 4 * x2), tmp188 & xmask,
        eviction_policy='evict_last', other=0.0)
    tmp190 = tmp0 >= tmp152
    tmp191 = tmp0 < tmp185
    tmp192 = tmp190 & tmp191
    tmp193 = tl.load(in_ptr32 + (x0 + 4 * x2), tmp192 & xmask,
        eviction_policy='evict_last', other=0.0)
    tmp194 = tl.where(tmp192, tmp193, tmp173)
    tmp195 = tl.where(tmp188, tmp189, tmp194)
    tmp196 = tl.where(tmp183, tmp184, tmp195)
    tmp197 = tl.where(tmp178, tmp179, tmp196)
    tmp198 = tl.full([1], 36, tl.int64)
    tmp199 = tmp0 >= tmp198
    tmp200 = tl.full([1], 37, tl.int64)
    tmp201 = tmp0 < tmp200
    tmp202 = tmp199 & tmp201
    tmp203 = tl.load(in_ptr33 + (x0 + 4 * x2), tmp202 & xmask,
        eviction_policy='evict_last', other=0.0)
    tmp204 = tl.full([1], 35, tl.int64)
    tmp205 = tmp0 >= tmp204
    tmp206 = tmp0 < tmp198
    tmp207 = tmp205 & tmp206
    tmp208 = tl.load(in_ptr34 + (x0 + 4 * x2), tmp207 & xmask,
        eviction_policy='evict_last', other=0.0)
    tmp209 = tl.full([1], 34, tl.int64)
    tmp210 = tmp0 >= tmp209
    tmp211 = tmp0 < tmp204
    tmp212 = tmp210 & tmp211
    tmp213 = tl.load(in_ptr35 + (x0 + 4 * x2), tmp212 & xmask,
        eviction_policy='evict_last', other=0.0)
    tmp214 = tmp0 >= tmp176
    tmp215 = tmp0 < tmp209
    tmp216 = tmp214 & tmp215
    tmp217 = tl.load(in_ptr36 + (x0 + 4 * x2), tmp216 & xmask,
        eviction_policy='evict_last', other=0.0)
    tmp218 = tl.where(tmp216, tmp217, tmp197)
    tmp219 = tl.where(tmp212, tmp213, tmp218)
    tmp220 = tl.where(tmp207, tmp208, tmp219)
    tmp221 = tl.where(tmp202, tmp203, tmp220)
    tmp222 = tl.full([1], 40, tl.int64)
    tmp223 = tmp0 >= tmp222
    tmp224 = tl.full([1], 41, tl.int64)
    tmp225 = tmp0 < tmp224
    tmp226 = tmp223 & tmp225
    tmp227 = tl.load(in_ptr37 + (x0 + 4 * x2), tmp226 & xmask,
        eviction_policy='evict_last', other=0.0)
    tmp228 = tl.full([1], 39, tl.int64)
    tmp229 = tmp0 >= tmp228
    tmp230 = tmp0 < tmp222
    tmp231 = tmp229 & tmp230
    tmp232 = tl.load(in_ptr38 + (x0 + 4 * x2), tmp231 & xmask,
        eviction_policy='evict_last', other=0.0)
    tmp233 = tl.full([1], 38, tl.int64)
    tmp234 = tmp0 >= tmp233
    tmp235 = tmp0 < tmp228
    tmp236 = tmp234 & tmp235
    tmp237 = tl.load(in_ptr39 + (x0 + 4 * x2), tmp236 & xmask,
        eviction_policy='evict_last', other=0.0)
    tmp238 = tmp0 >= tmp200
    tmp239 = tmp0 < tmp233
    tmp240 = tmp238 & tmp239
    tmp241 = tl.load(in_ptr40 + (x0 + 4 * x2), tmp240 & xmask,
        eviction_policy='evict_last', other=0.0)
    tmp242 = tl.where(tmp240, tmp241, tmp221)
    tmp243 = tl.where(tmp236, tmp237, tmp242)
    tmp244 = tl.where(tmp231, tmp232, tmp243)
    tmp245 = tl.where(tmp226, tmp227, tmp244)
    tmp246 = tl.full([1], 44, tl.int64)
    tmp247 = tmp0 >= tmp246
    tmp248 = tl.full([1], 45, tl.int64)
    tmp249 = tmp0 < tmp248
    tmp250 = tmp247 & tmp249
    tmp251 = tl.load(in_ptr41 + (x0 + 4 * x2), tmp250 & xmask,
        eviction_policy='evict_last', other=0.0)
    tmp252 = tl.full([1], 43, tl.int64)
    tmp253 = tmp0 >= tmp252
    tmp254 = tmp0 < tmp246
    tmp255 = tmp253 & tmp254
    tmp256 = tl.load(in_ptr42 + (x0 + 4 * x2), tmp255 & xmask,
        eviction_policy='evict_last', other=0.0)
    tmp257 = tl.full([1], 42, tl.int64)
    tmp258 = tmp0 >= tmp257
    tmp259 = tmp0 < tmp252
    tmp260 = tmp258 & tmp259
    tmp261 = tl.load(in_ptr43 + (x0 + 4 * x2), tmp260 & xmask,
        eviction_policy='evict_last', other=0.0)
    tmp262 = tmp0 >= tmp224
    tmp263 = tmp0 < tmp257
    tmp264 = tmp262 & tmp263
    tmp265 = tl.load(in_ptr44 + (x0 + 4 * x2), tmp264 & xmask,
        eviction_policy='evict_last', other=0.0)
    tmp266 = tl.where(tmp264, tmp265, tmp245)
    tmp267 = tl.where(tmp260, tmp261, tmp266)
    tmp268 = tl.where(tmp255, tmp256, tmp267)
    tmp269 = tl.where(tmp250, tmp251, tmp268)
    tmp270 = tl.full([1], 48, tl.int64)
    tmp271 = tmp0 >= tmp270
    tmp272 = tl.full([1], 49, tl.int64)
    tmp273 = tmp0 < tmp272
    tmp274 = tmp271 & tmp273
    tmp275 = tl.load(in_ptr45 + (x0 + 4 * x2), tmp274 & xmask,
        eviction_policy='evict_last', other=0.0)
    tmp276 = tl.full([1], 47, tl.int64)
    tmp277 = tmp0 >= tmp276
    tmp278 = tmp0 < tmp270
    tmp279 = tmp277 & tmp278
    tmp280 = tl.load(in_ptr46 + (x0 + 4 * x2), tmp279 & xmask,
        eviction_policy='evict_last', other=0.0)
    tmp281 = tl.full([1], 46, tl.int64)
    tmp282 = tmp0 >= tmp281
    tmp283 = tmp0 < tmp276
    tmp284 = tmp282 & tmp283
    tmp285 = tl.load(in_ptr47 + (x0 + 4 * x2), tmp284 & xmask,
        eviction_policy='evict_last', other=0.0)
    tmp286 = tmp0 >= tmp248
    tmp287 = tmp0 < tmp281
    tmp288 = tmp286 & tmp287
    tmp289 = tl.load(in_ptr48 + (x0 + 4 * x2), tmp288 & xmask,
        eviction_policy='evict_last', other=0.0)
    tmp290 = tl.where(tmp288, tmp289, tmp269)
    tmp291 = tl.where(tmp284, tmp285, tmp290)
    tmp292 = tl.where(tmp279, tmp280, tmp291)
    tmp293 = tl.where(tmp274, tmp275, tmp292)
    tmp294 = tl.full([1], 52, tl.int64)
    tmp295 = tmp0 >= tmp294
    tmp296 = tl.full([1], 53, tl.int64)
    tmp297 = tmp0 < tmp296
    tmp298 = tmp295 & tmp297
    tmp299 = tl.load(in_ptr49 + (x0 + 4 * x2), tmp298 & xmask,
        eviction_policy='evict_last', other=0.0)
    tmp300 = tl.full([1], 51, tl.int64)
    tmp301 = tmp0 >= tmp300
    tmp302 = tmp0 < tmp294
    tmp303 = tmp301 & tmp302
    tmp304 = tl.load(in_ptr50 + (x0 + 4 * x2), tmp303 & xmask,
        eviction_policy='evict_last', other=0.0)
    tmp305 = tl.full([1], 50, tl.int64)
    tmp306 = tmp0 >= tmp305
    tmp307 = tmp0 < tmp300
    tmp308 = tmp306 & tmp307
    tmp309 = tl.load(in_ptr51 + (x0 + 4 * x2), tmp308 & xmask,
        eviction_policy='evict_last', other=0.0)
    tmp310 = tmp0 >= tmp272
    tmp311 = tmp0 < tmp305
    tmp312 = tmp310 & tmp311
    tmp313 = tl.load(in_ptr52 + (x0 + 4 * x2), tmp312 & xmask,
        eviction_policy='evict_last', other=0.0)
    tmp314 = tl.where(tmp312, tmp313, tmp293)
    tmp315 = tl.where(tmp308, tmp309, tmp314)
    tmp316 = tl.where(tmp303, tmp304, tmp315)
    tmp317 = tl.where(tmp298, tmp299, tmp316)
    tmp318 = tl.full([1], 56, tl.int64)
    tmp319 = tmp0 >= tmp318
    tmp320 = tl.full([1], 57, tl.int64)
    tmp321 = tmp0 < tmp320
    tmp322 = tmp319 & tmp321
    tmp323 = tl.load(in_ptr53 + (x0 + 4 * x2), tmp322 & xmask,
        eviction_policy='evict_last', other=0.0)
    tmp324 = tl.full([1], 55, tl.int64)
    tmp325 = tmp0 >= tmp324
    tmp326 = tmp0 < tmp318
    tmp327 = tmp325 & tmp326
    tmp328 = tl.load(in_ptr54 + (x0 + 4 * x2), tmp327 & xmask,
        eviction_policy='evict_last', other=0.0)
    tmp329 = tl.full([1], 54, tl.int64)
    tmp330 = tmp0 >= tmp329
    tmp331 = tmp0 < tmp324
    tmp332 = tmp330 & tmp331
    tmp333 = tl.load(in_ptr55 + (x0 + 4 * x2), tmp332 & xmask,
        eviction_policy='evict_last', other=0.0)
    tmp334 = tmp0 >= tmp296
    tmp335 = tmp0 < tmp329
    tmp336 = tmp334 & tmp335
    tmp337 = tl.load(in_ptr56 + (x0 + 4 * x2), tmp336 & xmask,
        eviction_policy='evict_last', other=0.0)
    tmp338 = tl.where(tmp336, tmp337, tmp317)
    tmp339 = tl.where(tmp332, tmp333, tmp338)
    tmp340 = tl.where(tmp327, tmp328, tmp339)
    tmp341 = tl.where(tmp322, tmp323, tmp340)
    tmp342 = tl.full([1], 60, tl.int64)
    tmp343 = tmp0 >= tmp342
    tmp344 = tl.full([1], 61, tl.int64)
    tmp345 = tmp0 < tmp344
    tmp346 = tmp343 & tmp345
    tmp347 = tl.load(in_ptr57 + (x0 + 4 * x2), tmp346 & xmask,
        eviction_policy='evict_last', other=0.0)
    tmp348 = tl.full([1], 59, tl.int64)
    tmp349 = tmp0 >= tmp348
    tmp350 = tmp0 < tmp342
    tmp351 = tmp349 & tmp350
    tmp352 = tl.load(in_ptr58 + (x0 + 4 * x2), tmp351 & xmask,
        eviction_policy='evict_last', other=0.0)
    tmp353 = tl.full([1], 58, tl.int64)
    tmp354 = tmp0 >= tmp353
    tmp355 = tmp0 < tmp348
    tmp356 = tmp354 & tmp355
    tmp357 = tl.load(in_ptr59 + (x0 + 4 * x2), tmp356 & xmask,
        eviction_policy='evict_last', other=0.0)
    tmp358 = tmp0 >= tmp320
    tmp359 = tmp0 < tmp353
    tmp360 = tmp358 & tmp359
    tmp361 = tl.load(in_ptr60 + (x0 + 4 * x2), tmp360 & xmask,
        eviction_policy='evict_last', other=0.0)
    tmp362 = tl.where(tmp360, tmp361, tmp341)
    tmp363 = tl.where(tmp356, tmp357, tmp362)
    tmp364 = tl.where(tmp351, tmp352, tmp363)
    tmp365 = tl.where(tmp346, tmp347, tmp364)
    tmp366 = tl.full([1], 63, tl.int64)
    tmp367 = tmp0 >= tmp366
    tmp368 = tl.load(in_ptr61 + (x0 + 4 * x2), tmp367 & xmask,
        eviction_policy='evict_last', other=0.0)
    tmp369 = tl.full([1], 62, tl.int64)
    tmp370 = tmp0 >= tmp369
    tmp371 = tmp0 < tmp366
    tmp372 = tmp370 & tmp371
    tmp373 = tl.load(in_ptr62 + (x0 + 4 * x2), tmp372 & xmask,
        eviction_policy='evict_last', other=0.0)
    tmp374 = tmp0 >= tmp344
    tmp375 = tmp0 < tmp369
    tmp376 = tmp374 & tmp375
    tmp377 = tl.load(in_ptr63 + (x0 + 4 * x2), tmp376 & xmask,
        eviction_policy='evict_last', other=0.0)
    tmp378 = tl.where(tmp376, tmp377, tmp365)
    tmp379 = tl.where(tmp372, tmp373, tmp378)
    tmp380 = tl.where(tmp367, tmp368, tmp379)
    tl.store(in_out_ptr0 + x3, tmp380, xmask)


@triton.jit
def triton_red_fused_div_linalg_vector_norm_5(in_out_ptr0, in_ptr0,
    out_ptr0, out_ptr1, xnumel, rnumel, XBLOCK: tl.constexpr, RBLOCK: tl.
    constexpr):
    xnumel = 4
    rnumel = 256
    xoffset = tl.program_id(0) * XBLOCK
    xindex = xoffset + tl.arange(0, XBLOCK)[:, None]
    xmask = xindex < xnumel
    rbase = tl.arange(0, RBLOCK)[None, :]
    x0 = xindex
    _tmp18 = tl.full([XBLOCK, RBLOCK], 0, tl.float32)
    for roffset in range(0, rnumel, RBLOCK):
        rindex = roffset + rbase
        rmask = rindex < rnumel
        r3 = rindex
        r2 = rindex // 4
        tmp0 = tl.load(in_ptr0 + (r3 + 256 * x0), rmask & xmask,
            eviction_policy='evict_first', other=0.0)
        tmp1 = tl.load(in_ptr0 + (4 * r2 + 256 * x0), rmask & xmask,
            eviction_policy='evict_last', other=0.0)
        tmp3 = tl.load(in_ptr0 + (1 + 4 * r2 + 256 * x0), rmask & xmask,
            eviction_policy='evict_last', other=0.0)
        tmp6 = tl.load(in_ptr0 + (2 + 4 * r2 + 256 * x0), rmask & xmask,
            eviction_policy='evict_last', other=0.0)
        tmp9 = tl.load(in_ptr0 + (3 + 4 * r2 + 256 * x0), rmask & xmask,
            eviction_policy='evict_last', other=0.0)
        tmp2 = tmp1 * tmp1
        tmp4 = tmp3 * tmp3
        tmp5 = tmp2 + tmp4
        tmp7 = tmp6 * tmp6
        tmp8 = tmp5 + tmp7
        tmp10 = tmp9 * tmp9
        tmp11 = tmp8 + tmp10
        tmp12 = libdevice.sqrt(tmp11)
        tmp13 = 1e-12
        tmp14 = triton_helpers.maximum(tmp12, tmp13)
        tmp15 = tmp0 / tmp14
        tmp16 = tmp15 * tmp15
        tmp17 = tl.broadcast_to(tmp16, [XBLOCK, RBLOCK])
        tmp19 = _tmp18 + tmp17
        _tmp18 = tl.where(rmask & xmask, tmp19, _tmp18)
        tl.store(out_ptr0 + (r3 + 256 * x0), tmp15, rmask & xmask)
    tmp18 = tl.sum(_tmp18, 1)[:, None]
    tmp20 = libdevice.sqrt(tmp18)
    tl.debug_barrier()
    tl.store(in_out_ptr0 + x0, tmp20, xmask)
    for roffset in range(0, rnumel, RBLOCK):
        rindex = roffset + rbase
        rmask = rindex < rnumel
        r3 = rindex
        tmp21 = tl.load(out_ptr0 + (r3 + 256 * x0), rmask & xmask,
            eviction_policy='evict_first', other=0.0)
        tmp22 = 1e-12
        tmp23 = triton_helpers.maximum(tmp20, tmp22)
        tmp24 = tmp21 / tmp23
        tl.store(out_ptr1 + (r3 + 256 * x0), tmp24, rmask & xmask)


def call(args):
    primals_1, primals_2, primals_3 = args
    args.clear()
    assert_size_stride(primals_1, (4, 4, 4, 4), (64, 16, 4, 1))
    assert_size_stride(primals_2, (64, 4, 1, 1), (4, 1, 1, 1))
    assert_size_stride(primals_3, (64, 4), (4, 1))
    with torch.cuda._DeviceGuard(0):
        torch.cuda.set_device(0)
        buf0 = extern_kernels.convolution(primals_1, primals_2, stride=(1, 
            1), padding=(0, 0), dilation=(1, 1), transposed=False,
            output_padding=(0, 0), groups=1, bias=None)
        assert_size_stride(buf0, (4, 64, 4, 4), (1024, 16, 4, 1))
        buf1 = empty_strided_cuda((4, 1, 16), (16, 16, 1), torch.float32)
        buf2 = empty_strided_cuda((4, 1, 16), (16, 16, 1), torch.float32)
        get_raw_stream(0)
        triton_per_fused__softmax_0[grid(64)](buf0, buf1, buf2, 64, 64,
            XBLOCK=32, num_warps=8, num_stages=1)
        buf4 = empty_strided_cuda((4, 1, 4, 16), (64, 256, 16, 1), torch.
            float32)
        buf6 = empty_strided_cuda((4, 1, 4, 16), (64, 256, 16, 1), torch.
            float32)
        buf8 = empty_strided_cuda((4, 1, 4, 16), (64, 256, 16, 1), torch.
            float32)
        buf10 = empty_strided_cuda((4, 1, 4, 16), (64, 256, 16, 1), torch.
            float32)
        buf13 = empty_strided_cuda((4, 1, 4, 16), (64, 256, 16, 1), torch.
            float32)
        buf15 = empty_strided_cuda((4, 1, 4, 16), (64, 256, 16, 1), torch.
            float32)
        buf17 = empty_strided_cuda((4, 1, 4, 16), (64, 256, 16, 1), torch.
            float32)
        buf19 = empty_strided_cuda((4, 1, 4, 16), (64, 256, 16, 1), torch.
            float32)
        buf22 = empty_strided_cuda((4, 1, 4, 16), (64, 256, 16, 1), torch.
            float32)
        buf24 = empty_strided_cuda((4, 1, 4, 16), (64, 256, 16, 1), torch.
            float32)
        buf26 = empty_strided_cuda((4, 1, 4, 16), (64, 256, 16, 1), torch.
            float32)
        buf28 = empty_strided_cuda((4, 1, 4, 16), (64, 256, 16, 1), torch.
            float32)
        buf31 = empty_strided_cuda((4, 1, 4, 16), (64, 256, 16, 1), torch.
            float32)
        buf33 = empty_strided_cuda((4, 1, 4, 16), (64, 256, 16, 1), torch.
            float32)
        buf35 = empty_strided_cuda((4, 1, 4, 16), (64, 256, 16, 1), torch.
            float32)
        buf37 = empty_strided_cuda((4, 1, 4, 16), (64, 256, 16, 1), torch.
            float32)
        buf40 = empty_strided_cuda((4, 1, 4, 16), (64, 256, 16, 1), torch.
            float32)
        buf42 = empty_strided_cuda((4, 1, 4, 16), (64, 256, 16, 1), torch.
            float32)
        buf44 = empty_strided_cuda((4, 1, 4, 16), (64, 256, 16, 1), torch.
            float32)
        buf46 = empty_strided_cuda((4, 1, 4, 16), (64, 256, 16, 1), torch.
            float32)
        buf49 = empty_strided_cuda((4, 1, 4, 16), (64, 256, 16, 1), torch.
            float32)
        buf51 = empty_strided_cuda((4, 1, 4, 16), (64, 256, 16, 1), torch.
            float32)
        buf53 = empty_strided_cuda((4, 1, 4, 16), (64, 256, 16, 1), torch.
            float32)
        buf55 = empty_strided_cuda((4, 1, 4, 16), (64, 256, 16, 1), torch.
            float32)
        buf58 = empty_strided_cuda((4, 1, 4, 16), (64, 256, 16, 1), torch.
            float32)
        buf60 = empty_strided_cuda((4, 1, 4, 16), (64, 256, 16, 1), torch.
            float32)
        buf62 = empty_strided_cuda((4, 1, 4, 16), (64, 256, 16, 1), torch.
            float32)
        buf64 = empty_strided_cuda((4, 1, 4, 16), (64, 256, 16, 1), torch.
            float32)
        buf3 = empty_strided_cuda((4, 1, 4), (4, 16, 1), torch.float32)
        buf5 = empty_strided_cuda((4, 1, 4), (4, 16, 1), torch.float32)
        buf7 = empty_strided_cuda((4, 1, 4), (4, 16, 1), torch.float32)
        buf9 = empty_strided_cuda((4, 1, 4), (4, 16, 1), torch.float32)
        buf11 = empty_strided_cuda((4, 1, 4), (4, 16, 1), torch.float32)
        buf14 = empty_strided_cuda((4, 1, 4), (4, 16, 1), torch.float32)
        buf16 = empty_strided_cuda((4, 1, 4), (4, 16, 1), torch.float32)
        buf18 = empty_strided_cuda((4, 1, 4), (4, 16, 1), torch.float32)
        buf20 = empty_strided_cuda((4, 1, 4), (4, 16, 1), torch.float32)
        buf23 = empty_strided_cuda((4, 1, 4), (4, 16, 1), torch.float32)
        buf25 = empty_strided_cuda((4, 1, 4), (4, 16, 1), torch.float32)
        buf27 = empty_strided_cuda((4, 1, 4), (4, 16, 1), torch.float32)
        buf29 = empty_strided_cuda((4, 1, 4), (4, 16, 1), torch.float32)
        buf32 = empty_strided_cuda((4, 1, 4), (4, 16, 1), torch.float32)
        buf34 = empty_strided_cuda((4, 1, 4), (4, 16, 1), torch.float32)
        buf36 = empty_strided_cuda((4, 1, 4), (4, 16, 1), torch.float32)
        buf38 = empty_strided_cuda((4, 1, 4), (4, 16, 1), torch.float32)
        buf41 = empty_strided_cuda((4, 1, 4), (4, 16, 1), torch.float32)
        buf43 = empty_strided_cuda((4, 1, 4), (4, 16, 1), torch.float32)
        buf45 = empty_strided_cuda((4, 1, 4), (4, 16, 1), torch.float32)
        buf47 = empty_strided_cuda((4, 1, 4), (4, 16, 1), torch.float32)
        buf50 = empty_strided_cuda((4, 1, 4), (4, 16, 1), torch.float32)
        buf52 = empty_strided_cuda((4, 1, 4), (4, 16, 1), torch.float32)
        buf54 = empty_strided_cuda((4, 1, 4), (4, 16, 1), torch.float32)
        buf56 = empty_strided_cuda((4, 1, 4), (4, 16, 1), torch.float32)
        buf59 = empty_strided_cuda((4, 1, 4), (4, 16, 1), torch.float32)
        buf61 = empty_strided_cuda((4, 1, 4), (4, 16, 1), torch.float32)
        buf63 = empty_strided_cuda((4, 1, 4), (4, 16, 1), torch.float32)
        buf65 = empty_strided_cuda((4, 1, 4), (4, 16, 1), torch.float32)
        triton_per_fused_mul_sub_sum_1[grid(16)](primals_1, primals_3, buf0,
            buf1, buf2, buf4, buf6, buf8, buf10, buf13, buf15, buf17, buf19,
            buf22, buf24, buf26, buf28, buf31, buf33, buf35, buf37, buf40,
            buf42, buf44, buf46, buf49, buf51, buf53, buf55, buf58, buf60,
            buf62, buf64, buf3, buf5, buf7, buf9, buf11, buf14, buf16,
            buf18, buf20, buf23, buf25, buf27, buf29, buf32, buf34, buf36,
            buf38, buf41, buf43, buf45, buf47, buf50, buf52, buf54, buf56,
            buf59, buf61, buf63, buf65, 16, 16, XBLOCK=1, num_warps=2,
            num_stages=1)
        buf67 = empty_strided_cuda((4, 1, 4, 16), (64, 256, 16, 1), torch.
            float32)
        buf69 = empty_strided_cuda((4, 1, 4, 16), (64, 256, 16, 1), torch.
            float32)
        buf71 = empty_strided_cuda((4, 1, 4, 16), (64, 256, 16, 1), torch.
            float32)
        buf73 = empty_strided_cuda((4, 1, 4, 16), (64, 256, 16, 1), torch.
            float32)
        buf76 = empty_strided_cuda((4, 1, 4, 16), (64, 256, 16, 1), torch.
            float32)
        buf78 = empty_strided_cuda((4, 1, 4, 16), (64, 256, 16, 1), torch.
            float32)
        buf80 = empty_strided_cuda((4, 1, 4, 16), (64, 256, 16, 1), torch.
            float32)
        buf82 = empty_strided_cuda((4, 1, 4, 16), (64, 256, 16, 1), torch.
            float32)
        buf85 = empty_strided_cuda((4, 1, 4, 16), (64, 256, 16, 1), torch.
            float32)
        buf87 = empty_strided_cuda((4, 1, 4, 16), (64, 256, 16, 1), torch.
            float32)
        buf89 = empty_strided_cuda((4, 1, 4, 16), (64, 256, 16, 1), torch.
            float32)
        buf91 = empty_strided_cuda((4, 1, 4, 16), (64, 256, 16, 1), torch.
            float32)
        buf94 = empty_strided_cuda((4, 1, 4, 16), (64, 256, 16, 1), torch.
            float32)
        buf96 = empty_strided_cuda((4, 1, 4, 16), (64, 256, 16, 1), torch.
            float32)
        buf98 = empty_strided_cuda((4, 1, 4, 16), (64, 256, 16, 1), torch.
            float32)
        buf100 = empty_strided_cuda((4, 1, 4, 16), (64, 256, 16, 1), torch.
            float32)
        buf103 = empty_strided_cuda((4, 1, 4, 16), (64, 256, 16, 1), torch.
            float32)
        buf105 = empty_strided_cuda((4, 1, 4, 16), (64, 256, 16, 1), torch.
            float32)
        buf107 = empty_strided_cuda((4, 1, 4, 16), (64, 256, 16, 1), torch.
            float32)
        buf109 = empty_strided_cuda((4, 1, 4, 16), (64, 256, 16, 1), torch.
            float32)
        buf112 = empty_strided_cuda((4, 1, 4, 16), (64, 256, 16, 1), torch.
            float32)
        buf114 = empty_strided_cuda((4, 1, 4, 16), (64, 256, 16, 1), torch.
            float32)
        buf116 = empty_strided_cuda((4, 1, 4, 16), (64, 256, 16, 1), torch.
            float32)
        buf118 = empty_strided_cuda((4, 1, 4, 16), (64, 256, 16, 1), torch.
            float32)
        buf121 = empty_strided_cuda((4, 1, 4, 16), (64, 256, 16, 1), torch.
            float32)
        buf123 = empty_strided_cuda((4, 1, 4, 16), (64, 256, 16, 1), torch.
            float32)
        buf125 = empty_strided_cuda((4, 1, 4, 16), (64, 256, 16, 1), torch.
            float32)
        buf127 = empty_strided_cuda((4, 1, 4, 16), (64, 256, 16, 1), torch.
            float32)
        buf68 = empty_strided_cuda((4, 1, 4), (4, 16, 1), torch.float32)
        buf70 = empty_strided_cuda((4, 1, 4), (4, 16, 1), torch.float32)
        buf72 = empty_strided_cuda((4, 1, 4), (4, 16, 1), torch.float32)
        buf74 = empty_strided_cuda((4, 1, 4), (4, 16, 1), torch.float32)
        buf77 = empty_strided_cuda((4, 1, 4), (4, 16, 1), torch.float32)
        buf79 = empty_strided_cuda((4, 1, 4), (4, 16, 1), torch.float32)
        buf81 = empty_strided_cuda((4, 1, 4), (4, 16, 1), torch.float32)
        buf83 = empty_strided_cuda((4, 1, 4), (4, 16, 1), torch.float32)
        buf86 = empty_strided_cuda((4, 1, 4), (4, 16, 1), torch.float32)
        buf88 = empty_strided_cuda((4, 1, 4), (4, 16, 1), torch.float32)
        buf90 = empty_strided_cuda((4, 1, 4), (4, 16, 1), torch.float32)
        buf92 = empty_strided_cuda((4, 1, 4), (4, 16, 1), torch.float32)
        buf95 = empty_strided_cuda((4, 1, 4), (4, 16, 1), torch.float32)
        buf97 = empty_strided_cuda((4, 1, 4), (4, 16, 1), torch.float32)
        buf99 = empty_strided_cuda((4, 1, 4), (4, 16, 1), torch.float32)
        buf101 = empty_strided_cuda((4, 1, 4), (4, 16, 1), torch.float32)
        buf104 = empty_strided_cuda((4, 1, 4), (4, 16, 1), torch.float32)
        buf106 = empty_strided_cuda((4, 1, 4), (4, 16, 1), torch.float32)
        buf108 = empty_strided_cuda((4, 1, 4), (4, 16, 1), torch.float32)
        buf110 = empty_strided_cuda((4, 1, 4), (4, 16, 1), torch.float32)
        buf113 = empty_strided_cuda((4, 1, 4), (4, 16, 1), torch.float32)
        buf115 = empty_strided_cuda((4, 1, 4), (4, 16, 1), torch.float32)
        buf117 = empty_strided_cuda((4, 1, 4), (4, 16, 1), torch.float32)
        buf119 = empty_strided_cuda((4, 1, 4), (4, 16, 1), torch.float32)
        buf122 = empty_strided_cuda((4, 1, 4), (4, 16, 1), torch.float32)
        buf124 = empty_strided_cuda((4, 1, 4), (4, 16, 1), torch.float32)
        buf126 = empty_strided_cuda((4, 1, 4), (4, 16, 1), torch.float32)
        buf128 = empty_strided_cuda((4, 1, 4), (4, 16, 1), torch.float32)
        triton_per_fused_mul_sub_sum_2[grid(16)](primals_1, primals_3, buf0,
            buf1, buf2, buf67, buf69, buf71, buf73, buf76, buf78, buf80,
            buf82, buf85, buf87, buf89, buf91, buf94, buf96, buf98, buf100,
            buf103, buf105, buf107, buf109, buf112, buf114, buf116, buf118,
            buf121, buf123, buf125, buf127, buf68, buf70, buf72, buf74,
            buf77, buf79, buf81, buf83, buf86, buf88, buf90, buf92, buf95,
            buf97, buf99, buf101, buf104, buf106, buf108, buf110, buf113,
            buf115, buf117, buf119, buf122, buf124, buf126, buf128, 16, 16,
            XBLOCK=1, num_warps=2, num_stages=1)
        buf130 = empty_strided_cuda((4, 1, 4, 16), (64, 256, 16, 1), torch.
            float32)
        buf132 = empty_strided_cuda((4, 1, 4, 16), (64, 256, 16, 1), torch.
            float32)
        buf134 = empty_strided_cuda((4, 1, 4, 16), (64, 256, 16, 1), torch.
            float32)
        buf136 = empty_strided_cuda((4, 1, 4, 16), (64, 256, 16, 1), torch.
            float32)
        buf139 = empty_strided_cuda((4, 1, 4, 16), (64, 256, 16, 1), torch.
            float32)
        buf141 = empty_strided_cuda((4, 1, 4, 16), (64, 256, 16, 1), torch.
            float32)
        buf143 = empty_strided_cuda((4, 1, 4, 16), (64, 256, 16, 1), torch.
            float32)
        buf131 = empty_strided_cuda((4, 1, 4), (4, 16, 1), torch.float32)
        buf133 = empty_strided_cuda((4, 1, 4), (4, 16, 1), torch.float32)
        buf135 = empty_strided_cuda((4, 1, 4), (4, 16, 1), torch.float32)
        buf137 = empty_strided_cuda((4, 1, 4), (4, 16, 1), torch.float32)
        buf140 = empty_strided_cuda((4, 1, 4), (4, 16, 1), torch.float32)
        buf142 = empty_strided_cuda((4, 1, 4), (4, 16, 1), torch.float32)
        buf144 = empty_strided_cuda((4, 1, 4), (4, 16, 1), torch.float32)
        triton_per_fused_mul_sub_sum_3[grid(16)](primals_1, primals_3, buf0,
            buf1, buf2, buf130, buf132, buf134, buf136, buf139, buf141,
            buf143, buf131, buf133, buf135, buf137, buf140, buf142, buf144,
            16, 16, XBLOCK=1, num_warps=2, num_stages=1)
        buf12 = empty_strided_cuda((4, 64, 4), (256, 4, 1), torch.float32)
        buf21 = buf12
        del buf12
        buf30 = buf21
        del buf21
        buf39 = buf30
        del buf30
        buf48 = buf39
        del buf39
        buf57 = buf48
        del buf48
        buf66 = buf57
        del buf57
        buf75 = buf66
        del buf66
        buf84 = buf75
        del buf75
        buf93 = buf84
        del buf84
        buf102 = buf93
        del buf93
        buf111 = buf102
        del buf102
        buf120 = buf111
        del buf111
        buf129 = buf120
        del buf120
        buf138 = buf129
        del buf129
        buf145 = buf138
        del buf138
        triton_poi_fused_copy_zeros_4[grid(1024)](buf145, buf11, buf9, buf7,
            buf5, buf3, buf20, buf18, buf16, buf14, buf29, buf27, buf25,
            buf23, buf38, buf36, buf34, buf32, buf47, buf45, buf43, buf41,
            buf56, buf54, buf52, buf50, buf65, buf63, buf61, buf59, buf74,
            buf72, buf70, buf68, buf83, buf81, buf79, buf77, buf92, buf90,
            buf88, buf86, buf101, buf99, buf97, buf95, buf110, buf108,
            buf106, buf104, buf119, buf117, buf115, buf113, buf128, buf126,
            buf124, buf122, buf137, buf135, buf133, buf131, buf144, buf142,
            buf140, 1024, XBLOCK=128, num_warps=4, num_stages=1)
        del buf101
        del buf104
        del buf106
        del buf108
        del buf11
        del buf110
        del buf113
        del buf115
        del buf117
        del buf119
        del buf122
        del buf124
        del buf126
        del buf128
        del buf131
        del buf133
        del buf135
        del buf137
        del buf14
        del buf140
        del buf142
        del buf144
        del buf16
        del buf18
        del buf20
        del buf23
        del buf25
        del buf27
        del buf29
        del buf3
        del buf32
        del buf34
        del buf36
        del buf38
        del buf41
        del buf43
        del buf45
        del buf47
        del buf5
        del buf50
        del buf52
        del buf54
        del buf56
        del buf59
        del buf61
        del buf63
        del buf65
        del buf68
        del buf7
        del buf70
        del buf72
        del buf74
        del buf77
        del buf79
        del buf81
        del buf83
        del buf86
        del buf88
        del buf9
        del buf90
        del buf92
        del buf95
        del buf97
        del buf99
        buf146 = empty_strided_cuda((4, 64, 4), (256, 4, 1), torch.float32)
        buf147 = empty_strided_cuda((4, 1), (1, 4), torch.float32)
        buf148 = reinterpret_tensor(buf147, (4, 1), (1, 1), 0)
        del buf147
        buf149 = empty_strided_cuda((4, 256), (256, 1), torch.float32)
        triton_red_fused_div_linalg_vector_norm_5[grid(4)](buf148, buf145,
            buf146, buf149, 4, 256, XBLOCK=1, RBLOCK=256, num_warps=2,
            num_stages=1)
        del buf146
    return (buf149, primals_1, primals_2, buf0, buf1, buf2,
        reinterpret_tensor(primals_3, (1, 4), (4, 1), 0), buf4, buf6, buf8,
        buf10, buf13, buf15, buf17, buf19, buf22, buf24, buf26, buf28,
        buf31, buf33, buf35, buf37, buf40, buf42, buf44, buf46, buf49,
        buf51, buf53, buf55, buf58, buf60, buf62, buf64, buf67, buf69,
        buf71, buf73, buf76, buf78, buf80, buf82, buf85, buf87, buf89,
        buf91, buf94, buf96, buf98, buf100, buf103, buf105, buf107, buf109,
        buf112, buf114, buf116, buf118, buf121, buf123, buf125, buf127,
        buf130, buf132, buf134, buf136, buf139, buf141, buf143, buf145, buf148)


class NetVLADNew(nn.Module):
    """NetVLAD layer implementation"""

    def __init__(self, dim, num_clusters=64):
        """
        Args:
            dim : int
                Dimension of descriptors
            num_clusters : int
                The number of clusters
        """
        super(NetVLADNew, self).__init__()
        self.num_clusters = num_clusters
        self.conv = nn.Conv2d(dim, num_clusters, kernel_size=(1, 1), bias=False
            )
        self.centroids = nn.Parameter(torch.rand(num_clusters, dim))

    def init_params(self, clsts, traindescs):
        clsts_assign = clsts / np.linalg.norm(clsts, axis=1, keepdims=True)
        dots = np.dot(clsts_assign, traindescs.T)
        dots.sort(0)
        dots = dots[::-1, :]
        alpha = (-np.log(0.01) / np.mean(dots[0, :] - dots[1, :])).item()
        self.centroids = nn.Parameter(torch.from_numpy(clsts))
        self.conv.weight = nn.Parameter(torch.from_numpy(alpha *
            clsts_assign).unsqueeze(2).unsqueeze(3))
        self.conv.bias = None

    def forward(self, input_0):
        primals_3 = self.centroids
        primals_2 = self.conv.weight
        primals_1 = input_0
        output = call([primals_1, primals_2, primals_3])
        return output[0]


Measured latency_ms: 0.016215