import torch
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
from torch.autograd import Function
import torch.nn as 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_poi_fused_add_clamp_div_max_mul_pow_sub_sum_where_0(in_out_ptr13,
    in_ptr0, out_ptr0, out_ptr25, out_ptr31, xnumel, XBLOCK: tl.constexpr):
    xnumel = 64
    xoffset = tl.program_id(0) * XBLOCK
    xindex = xoffset + tl.arange(0, XBLOCK)[:]
    xmask = xindex < xnumel
    x0 = xindex
    tmp0 = tl.load(in_ptr0 + 4 * x0, xmask, eviction_policy='evict_last')
    tmp3 = tl.load(in_ptr0 + (1 + 4 * x0), xmask, eviction_policy='evict_last')
    tmp5 = tl.load(in_ptr0 + (2 + 4 * x0), xmask, eviction_policy='evict_last')
    tmp7 = tl.load(in_ptr0 + (3 + 4 * x0), xmask, eviction_policy='evict_last')
    tmp1 = 0.5
    tmp2 = tmp0 * tmp1
    tmp4 = triton_helpers.maximum(tmp0, tmp3)
    tmp6 = triton_helpers.maximum(tmp4, tmp5)
    tmp8 = triton_helpers.maximum(tmp6, tmp7)
    tmp9 = tmp8 * tmp1
    tmp10 = 1.0
    tmp11 = tmp9 - tmp10
    tmp12 = tmp9 - tmp1
    tmp13 = tmp12 - tmp11
    tmp14 = tmp13 * tmp1
    tmp15 = tmp11 + tmp14
    tmp16 = tmp2 - tmp15
    tmp17 = 0.0
    tmp18 = triton_helpers.maximum(tmp16, tmp17)
    tmp19 = 2.0
    tmp20 = libdevice.pow(tmp18, tmp19)
    tmp21 = tmp3 * tmp1
    tmp22 = tmp21 - tmp15
    tmp23 = triton_helpers.maximum(tmp22, tmp17)
    tmp24 = libdevice.pow(tmp23, tmp19)
    tmp25 = tmp20 + tmp24
    tmp26 = tmp5 * tmp1
    tmp27 = tmp26 - tmp15
    tmp28 = triton_helpers.maximum(tmp27, tmp17)
    tmp29 = libdevice.pow(tmp28, tmp19)
    tmp30 = tmp25 + tmp29
    tmp31 = tmp7 * tmp1
    tmp32 = tmp31 - tmp15
    tmp33 = triton_helpers.maximum(tmp32, tmp17)
    tmp34 = libdevice.pow(tmp33, tmp19)
    tmp35 = tmp30 + tmp34
    tmp36 = tmp2 - tmp11
    tmp37 = triton_helpers.maximum(tmp36, tmp17)
    tmp38 = libdevice.pow(tmp37, tmp19)
    tmp39 = tmp21 - tmp11
    tmp40 = triton_helpers.maximum(tmp39, tmp17)
    tmp41 = libdevice.pow(tmp40, tmp19)
    tmp42 = tmp38 + tmp41
    tmp43 = tmp26 - tmp11
    tmp44 = triton_helpers.maximum(tmp43, tmp17)
    tmp45 = libdevice.pow(tmp44, tmp19)
    tmp46 = tmp42 + tmp45
    tmp47 = tmp31 - tmp11
    tmp48 = triton_helpers.maximum(tmp47, tmp17)
    tmp49 = libdevice.pow(tmp48, tmp19)
    tmp50 = tmp46 + tmp49
    tmp51 = tmp35 - tmp10
    tmp52 = tmp50 - tmp10
    tmp53 = tmp51 * tmp52
    tmp54 = tmp53 >= tmp17
    tmp55 = tl.where(tmp54, tmp15, tmp11)
    tmp56 = tmp14 * tmp1
    tmp57 = tmp55 + tmp56
    tmp58 = tmp2 - tmp57
    tmp59 = triton_helpers.maximum(tmp58, tmp17)
    tmp60 = libdevice.pow(tmp59, tmp19)
    tmp61 = tmp21 - tmp57
    tmp62 = triton_helpers.maximum(tmp61, tmp17)
    tmp63 = libdevice.pow(tmp62, tmp19)
    tmp64 = tmp60 + tmp63
    tmp65 = tmp26 - tmp57
    tmp66 = triton_helpers.maximum(tmp65, tmp17)
    tmp67 = libdevice.pow(tmp66, tmp19)
    tmp68 = tmp64 + tmp67
    tmp69 = tmp31 - tmp57
    tmp70 = triton_helpers.maximum(tmp69, tmp17)
    tmp71 = libdevice.pow(tmp70, tmp19)
    tmp72 = tmp68 + tmp71
    tmp73 = tmp72 - tmp10
    tmp74 = tmp73 * tmp52
    tmp75 = tmp74 >= tmp17
    tmp76 = tl.where(tmp75, tmp57, tmp55)
    tmp77 = tmp56 * tmp1
    tmp78 = tmp76 + tmp77
    tmp79 = tmp2 - tmp78
    tmp80 = triton_helpers.maximum(tmp79, tmp17)
    tmp81 = libdevice.pow(tmp80, tmp19)
    tmp82 = tmp21 - tmp78
    tmp83 = triton_helpers.maximum(tmp82, tmp17)
    tmp84 = libdevice.pow(tmp83, tmp19)
    tmp85 = tmp81 + tmp84
    tmp86 = tmp26 - tmp78
    tmp87 = triton_helpers.maximum(tmp86, tmp17)
    tmp88 = libdevice.pow(tmp87, tmp19)
    tmp89 = tmp85 + tmp88
    tmp90 = tmp31 - tmp78
    tmp91 = triton_helpers.maximum(tmp90, tmp17)
    tmp92 = libdevice.pow(tmp91, tmp19)
    tmp93 = tmp89 + tmp92
    tmp94 = tmp93 - tmp10
    tmp95 = tmp94 * tmp52
    tmp96 = tmp95 >= tmp17
    tmp97 = tl.where(tmp96, tmp78, tmp76)
    tmp98 = tmp77 * tmp1
    tmp99 = tmp97 + tmp98
    tmp100 = tmp2 - tmp99
    tmp101 = triton_helpers.maximum(tmp100, tmp17)
    tmp102 = libdevice.pow(tmp101, tmp19)
    tmp103 = tmp21 - tmp99
    tmp104 = triton_helpers.maximum(tmp103, tmp17)
    tmp105 = libdevice.pow(tmp104, tmp19)
    tmp106 = tmp102 + tmp105
    tmp107 = tmp26 - tmp99
    tmp108 = triton_helpers.maximum(tmp107, tmp17)
    tmp109 = libdevice.pow(tmp108, tmp19)
    tmp110 = tmp106 + tmp109
    tmp111 = tmp31 - tmp99
    tmp112 = triton_helpers.maximum(tmp111, tmp17)
    tmp113 = libdevice.pow(tmp112, tmp19)
    tmp114 = tmp110 + tmp113
    tmp115 = tmp114 - tmp10
    tmp116 = tmp115 * tmp52
    tmp117 = tmp116 >= tmp17
    tmp118 = tl.where(tmp117, tmp99, tmp97)
    tmp119 = tmp98 * tmp1
    tmp120 = tmp118 + tmp119
    tmp121 = tmp2 - tmp120
    tmp122 = triton_helpers.maximum(tmp121, tmp17)
    tmp123 = libdevice.pow(tmp122, tmp19)
    tmp124 = tmp21 - tmp120
    tmp125 = triton_helpers.maximum(tmp124, tmp17)
    tmp126 = libdevice.pow(tmp125, tmp19)
    tmp127 = tmp123 + tmp126
    tmp128 = tmp26 - tmp120
    tmp129 = triton_helpers.maximum(tmp128, tmp17)
    tmp130 = libdevice.pow(tmp129, tmp19)
    tmp131 = tmp127 + tmp130
    tmp132 = tmp31 - tmp120
    tmp133 = triton_helpers.maximum(tmp132, tmp17)
    tmp134 = libdevice.pow(tmp133, tmp19)
    tmp135 = tmp131 + tmp134
    tmp136 = tmp135 - tmp10
    tmp137 = tmp136 * tmp52
    tmp138 = tmp137 >= tmp17
    tmp139 = tl.where(tmp138, tmp120, tmp118)
    tmp140 = tmp119 * tmp1
    tmp141 = tmp139 + tmp140
    tmp142 = tmp2 - tmp141
    tmp143 = triton_helpers.maximum(tmp142, tmp17)
    tmp144 = libdevice.pow(tmp143, tmp19)
    tmp145 = tmp21 - tmp141
    tmp146 = triton_helpers.maximum(tmp145, tmp17)
    tmp147 = libdevice.pow(tmp146, tmp19)
    tmp148 = tmp144 + tmp147
    tmp149 = tmp26 - tmp141
    tmp150 = triton_helpers.maximum(tmp149, tmp17)
    tmp151 = libdevice.pow(tmp150, tmp19)
    tmp152 = tmp148 + tmp151
    tmp153 = tmp31 - tmp141
    tmp154 = triton_helpers.maximum(tmp153, tmp17)
    tmp155 = libdevice.pow(tmp154, tmp19)
    tmp156 = tmp152 + tmp155
    tmp157 = tmp156 - tmp10
    tmp158 = tmp157 * tmp52
    tmp159 = tmp158 >= tmp17
    tmp160 = tl.where(tmp159, tmp141, tmp139)
    tmp161 = tmp140 * tmp1
    tmp162 = tmp160 + tmp161
    tmp163 = tmp2 - tmp162
    tmp164 = triton_helpers.maximum(tmp163, tmp17)
    tmp165 = libdevice.pow(tmp164, tmp19)
    tmp166 = tmp21 - tmp162
    tmp167 = triton_helpers.maximum(tmp166, tmp17)
    tmp168 = libdevice.pow(tmp167, tmp19)
    tmp169 = tmp165 + tmp168
    tmp170 = tmp26 - tmp162
    tmp171 = triton_helpers.maximum(tmp170, tmp17)
    tmp172 = libdevice.pow(tmp171, tmp19)
    tmp173 = tmp169 + tmp172
    tmp174 = tmp31 - tmp162
    tmp175 = triton_helpers.maximum(tmp174, tmp17)
    tmp176 = libdevice.pow(tmp175, tmp19)
    tmp177 = tmp173 + tmp176
    tmp178 = tmp177 - tmp10
    tmp179 = tmp178 * tmp52
    tmp180 = tmp179 >= tmp17
    tmp181 = tl.where(tmp180, tmp162, tmp160)
    tmp182 = tmp161 * tmp1
    tmp183 = tmp181 + tmp182
    tmp184 = tmp2 - tmp183
    tmp185 = triton_helpers.maximum(tmp184, tmp17)
    tmp186 = libdevice.pow(tmp185, tmp19)
    tmp187 = tmp21 - tmp183
    tmp188 = triton_helpers.maximum(tmp187, tmp17)
    tmp189 = libdevice.pow(tmp188, tmp19)
    tmp190 = tmp186 + tmp189
    tmp191 = tmp26 - tmp183
    tmp192 = triton_helpers.maximum(tmp191, tmp17)
    tmp193 = libdevice.pow(tmp192, tmp19)
    tmp194 = tmp190 + tmp193
    tmp195 = tmp31 - tmp183
    tmp196 = triton_helpers.maximum(tmp195, tmp17)
    tmp197 = libdevice.pow(tmp196, tmp19)
    tmp198 = tmp194 + tmp197
    tmp199 = tmp198 - tmp10
    tmp200 = tmp199 * tmp52
    tmp201 = tmp200 >= tmp17
    tmp202 = tl.where(tmp201, tmp183, tmp181)
    tmp203 = tmp182 * tmp1
    tmp204 = tmp202 + tmp203
    tmp205 = tmp2 - tmp204
    tmp206 = triton_helpers.maximum(tmp205, tmp17)
    tmp207 = libdevice.pow(tmp206, tmp19)
    tmp208 = tmp21 - tmp204
    tmp209 = triton_helpers.maximum(tmp208, tmp17)
    tmp210 = libdevice.pow(tmp209, tmp19)
    tmp211 = tmp207 + tmp210
    tmp212 = tmp26 - tmp204
    tmp213 = triton_helpers.maximum(tmp212, tmp17)
    tmp214 = libdevice.pow(tmp213, tmp19)
    tmp215 = tmp211 + tmp214
    tmp216 = tmp31 - tmp204
    tmp217 = triton_helpers.maximum(tmp216, tmp17)
    tmp218 = libdevice.pow(tmp217, tmp19)
    tmp219 = tmp215 + tmp218
    tmp220 = tmp219 - tmp10
    tmp221 = tmp220 * tmp52
    tmp222 = tmp221 >= tmp17
    tmp223 = tl.where(tmp222, tmp204, tmp202)
    tmp224 = tmp203 * tmp1
    tmp225 = tmp223 + tmp224
    tmp226 = tmp2 - tmp225
    tmp227 = triton_helpers.maximum(tmp226, tmp17)
    tmp228 = libdevice.pow(tmp227, tmp19)
    tmp229 = tmp21 - tmp225
    tmp230 = triton_helpers.maximum(tmp229, tmp17)
    tmp231 = libdevice.pow(tmp230, tmp19)
    tmp232 = tmp228 + tmp231
    tmp233 = tmp26 - tmp225
    tmp234 = triton_helpers.maximum(tmp233, tmp17)
    tmp235 = libdevice.pow(tmp234, tmp19)
    tmp236 = tmp232 + tmp235
    tmp237 = tmp31 - tmp225
    tmp238 = triton_helpers.maximum(tmp237, tmp17)
    tmp239 = libdevice.pow(tmp238, tmp19)
    tmp240 = tmp236 + tmp239
    tmp241 = tmp240 - tmp10
    tmp242 = tmp241 * tmp52
    tmp243 = tmp242 >= tmp17
    tmp244 = tl.where(tmp243, tmp225, tmp223)
    tmp245 = tmp224 * tmp1
    tmp246 = tmp244 + tmp245
    tmp247 = tmp2 - tmp246
    tmp248 = triton_helpers.maximum(tmp247, tmp17)
    tmp249 = libdevice.pow(tmp248, tmp19)
    tmp250 = tmp21 - tmp246
    tmp251 = triton_helpers.maximum(tmp250, tmp17)
    tmp252 = libdevice.pow(tmp251, tmp19)
    tmp253 = tmp249 + tmp252
    tmp254 = tmp26 - tmp246
    tmp255 = triton_helpers.maximum(tmp254, tmp17)
    tmp256 = libdevice.pow(tmp255, tmp19)
    tmp257 = tmp253 + tmp256
    tmp258 = tmp31 - tmp246
    tmp259 = triton_helpers.maximum(tmp258, tmp17)
    tmp260 = libdevice.pow(tmp259, tmp19)
    tmp261 = tmp257 + tmp260
    tmp262 = tmp261 - tmp10
    tmp263 = tmp262 * tmp52
    tmp264 = tmp263 >= tmp17
    tmp265 = tl.where(tmp264, tmp246, tmp244)
    tmp266 = tmp245 * tmp1
    tmp267 = tmp265 + tmp266
    tmp268 = tmp2 - tmp267
    tmp269 = triton_helpers.maximum(tmp268, tmp17)
    tmp270 = libdevice.pow(tmp269, tmp19)
    tmp271 = tmp21 - tmp267
    tmp272 = triton_helpers.maximum(tmp271, tmp17)
    tmp273 = libdevice.pow(tmp272, tmp19)
    tmp274 = tmp270 + tmp273
    tmp275 = tmp26 - tmp267
    tmp276 = triton_helpers.maximum(tmp275, tmp17)
    tmp277 = libdevice.pow(tmp276, tmp19)
    tmp278 = tmp274 + tmp277
    tmp279 = tmp31 - tmp267
    tmp280 = triton_helpers.maximum(tmp279, tmp17)
    tmp281 = libdevice.pow(tmp280, tmp19)
    tmp282 = tmp278 + tmp281
    tmp283 = tmp282 - tmp10
    tmp284 = tmp283 * tmp52
    tmp285 = tmp284 >= tmp17
    tmp286 = tl.where(tmp285, tmp267, tmp265)
    tmp287 = tmp266 * tmp1
    tmp288 = tmp286 + tmp287
    tmp289 = tmp2 - tmp288
    tmp290 = triton_helpers.maximum(tmp289, tmp17)
    tmp291 = libdevice.pow(tmp290, tmp19)
    tmp292 = tmp21 - tmp288
    tmp293 = triton_helpers.maximum(tmp292, tmp17)
    tmp294 = libdevice.pow(tmp293, tmp19)
    tmp295 = tmp291 + tmp294
    tmp296 = tmp26 - tmp288
    tmp297 = triton_helpers.maximum(tmp296, tmp17)
    tmp298 = libdevice.pow(tmp297, tmp19)
    tmp299 = tmp295 + tmp298
    tmp300 = tmp31 - tmp288
    tmp301 = triton_helpers.maximum(tmp300, tmp17)
    tmp302 = libdevice.pow(tmp301, tmp19)
    tmp303 = tmp299 + tmp302
    tmp304 = tmp303 - tmp10
    tmp305 = tmp304 * tmp52
    tmp306 = tmp305 >= tmp17
    tmp307 = tl.where(tmp306, tmp288, tmp286)
    tmp308 = tmp287 * tmp1
    tmp309 = tmp307 + tmp308
    tmp310 = tmp2 - tmp309
    tmp311 = triton_helpers.maximum(tmp310, tmp17)
    tmp312 = libdevice.pow(tmp311, tmp19)
    tmp313 = tmp21 - tmp309
    tmp314 = triton_helpers.maximum(tmp313, tmp17)
    tmp315 = libdevice.pow(tmp314, tmp19)
    tmp316 = tmp312 + tmp315
    tmp317 = tmp26 - tmp309
    tmp318 = triton_helpers.maximum(tmp317, tmp17)
    tmp319 = libdevice.pow(tmp318, tmp19)
    tmp320 = tmp316 + tmp319
    tmp321 = tmp31 - tmp309
    tmp322 = triton_helpers.maximum(tmp321, tmp17)
    tmp323 = libdevice.pow(tmp322, tmp19)
    tmp324 = tmp320 + tmp323
    tmp325 = tmp324 - tmp10
    tmp326 = tmp325 * tmp52
    tmp327 = tmp326 >= tmp17
    tmp328 = tl.where(tmp327, tmp309, tmp307)
    tmp329 = tmp308 * tmp1
    tmp330 = tmp328 + tmp329
    tmp331 = tmp2 - tmp330
    tmp332 = triton_helpers.maximum(tmp331, tmp17)
    tmp333 = libdevice.pow(tmp332, tmp19)
    tmp334 = tmp21 - tmp330
    tmp335 = triton_helpers.maximum(tmp334, tmp17)
    tmp336 = libdevice.pow(tmp335, tmp19)
    tmp337 = tmp333 + tmp336
    tmp338 = tmp26 - tmp330
    tmp339 = triton_helpers.maximum(tmp338, tmp17)
    tmp340 = libdevice.pow(tmp339, tmp19)
    tmp341 = tmp337 + tmp340
    tmp342 = tmp31 - tmp330
    tmp343 = triton_helpers.maximum(tmp342, tmp17)
    tmp344 = libdevice.pow(tmp343, tmp19)
    tmp345 = tmp341 + tmp344
    tmp346 = tmp345 - tmp10
    tmp347 = tmp346 * tmp52
    tmp348 = tmp347 >= tmp17
    tmp349 = tl.where(tmp348, tmp330, tmp328)
    tmp350 = tmp329 * tmp1
    tmp351 = tmp349 + tmp350
    tmp352 = tmp2 - tmp351
    tmp353 = triton_helpers.maximum(tmp352, tmp17)
    tmp354 = libdevice.pow(tmp353, tmp19)
    tmp355 = tmp21 - tmp351
    tmp356 = triton_helpers.maximum(tmp355, tmp17)
    tmp357 = libdevice.pow(tmp356, tmp19)
    tmp358 = tmp354 + tmp357
    tmp359 = tmp26 - tmp351
    tmp360 = triton_helpers.maximum(tmp359, tmp17)
    tmp361 = libdevice.pow(tmp360, tmp19)
    tmp362 = tmp358 + tmp361
    tmp363 = tmp31 - tmp351
    tmp364 = triton_helpers.maximum(tmp363, tmp17)
    tmp365 = libdevice.pow(tmp364, tmp19)
    tmp366 = tmp362 + tmp365
    tmp367 = tmp366 - tmp10
    tmp368 = tmp367 * tmp52
    tmp369 = tmp368 >= tmp17
    tmp370 = tl.where(tmp369, tmp351, tmp349)
    tmp371 = tmp350 * tmp1
    tmp372 = tmp370 + tmp371
    tmp373 = tmp2 - tmp372
    tmp374 = triton_helpers.maximum(tmp373, tmp17)
    tmp375 = libdevice.pow(tmp374, tmp19)
    tmp376 = tmp21 - tmp372
    tmp377 = triton_helpers.maximum(tmp376, tmp17)
    tmp378 = libdevice.pow(tmp377, tmp19)
    tmp379 = tmp375 + tmp378
    tmp380 = tmp26 - tmp372
    tmp381 = triton_helpers.maximum(tmp380, tmp17)
    tmp382 = libdevice.pow(tmp381, tmp19)
    tmp383 = tmp379 + tmp382
    tmp384 = tmp31 - tmp372
    tmp385 = triton_helpers.maximum(tmp384, tmp17)
    tmp386 = libdevice.pow(tmp385, tmp19)
    tmp387 = tmp383 + tmp386
    tmp388 = tmp387 - tmp10
    tmp389 = tmp388 * tmp52
    tmp390 = tmp389 >= tmp17
    tmp391 = tl.where(tmp390, tmp372, tmp370)
    tmp392 = tmp371 * tmp1
    tmp393 = tmp391 + tmp392
    tmp394 = tmp2 - tmp393
    tmp395 = triton_helpers.maximum(tmp394, tmp17)
    tmp396 = libdevice.pow(tmp395, tmp19)
    tmp397 = tmp21 - tmp393
    tmp398 = triton_helpers.maximum(tmp397, tmp17)
    tmp399 = libdevice.pow(tmp398, tmp19)
    tmp400 = tmp396 + tmp399
    tmp401 = tmp26 - tmp393
    tmp402 = triton_helpers.maximum(tmp401, tmp17)
    tmp403 = libdevice.pow(tmp402, tmp19)
    tmp404 = tmp400 + tmp403
    tmp405 = tmp31 - tmp393
    tmp406 = triton_helpers.maximum(tmp405, tmp17)
    tmp407 = libdevice.pow(tmp406, tmp19)
    tmp408 = tmp404 + tmp407
    tmp409 = tmp408 - tmp10
    tmp410 = tmp409 * tmp52
    tmp411 = tmp410 >= tmp17
    tmp412 = tl.where(tmp411, tmp393, tmp391)
    tmp413 = tmp392 * tmp1
    tmp414 = tmp412 + tmp413
    tmp415 = tmp2 - tmp414
    tmp416 = triton_helpers.maximum(tmp415, tmp17)
    tmp417 = libdevice.pow(tmp416, tmp19)
    tmp418 = tmp21 - tmp414
    tmp419 = triton_helpers.maximum(tmp418, tmp17)
    tmp420 = libdevice.pow(tmp419, tmp19)
    tmp421 = tmp417 + tmp420
    tmp422 = tmp26 - tmp414
    tmp423 = triton_helpers.maximum(tmp422, tmp17)
    tmp424 = libdevice.pow(tmp423, tmp19)
    tmp425 = tmp421 + tmp424
    tmp426 = tmp31 - tmp414
    tmp427 = triton_helpers.maximum(tmp426, tmp17)
    tmp428 = libdevice.pow(tmp427, tmp19)
    tmp429 = tmp425 + tmp428
    tmp430 = tmp429 - tmp10
    tmp431 = tmp430 * tmp52
    tmp432 = tmp431 >= tmp17
    tmp433 = tl.where(tmp432, tmp414, tmp412)
    tmp434 = tmp413 * tmp1
    tmp435 = tmp433 + tmp434
    tmp436 = tmp2 - tmp435
    tmp437 = triton_helpers.maximum(tmp436, tmp17)
    tmp438 = libdevice.pow(tmp437, tmp19)
    tmp439 = tmp21 - tmp435
    tmp440 = triton_helpers.maximum(tmp439, tmp17)
    tmp441 = libdevice.pow(tmp440, tmp19)
    tmp442 = tmp438 + tmp441
    tmp443 = tmp26 - tmp435
    tmp444 = triton_helpers.maximum(tmp443, tmp17)
    tmp445 = libdevice.pow(tmp444, tmp19)
    tmp446 = tmp442 + tmp445
    tmp447 = tmp31 - tmp435
    tmp448 = triton_helpers.maximum(tmp447, tmp17)
    tmp449 = libdevice.pow(tmp448, tmp19)
    tmp450 = tmp446 + tmp449
    tmp451 = tmp450 - tmp10
    tmp452 = tmp451 * tmp52
    tmp453 = tmp452 >= tmp17
    tmp454 = tl.where(tmp453, tmp435, tmp433)
    tmp455 = tmp434 * tmp1
    tmp456 = tmp454 + tmp455
    tmp457 = tmp2 - tmp456
    tmp458 = triton_helpers.maximum(tmp457, tmp17)
    tmp459 = libdevice.pow(tmp458, tmp19)
    tmp460 = tmp21 - tmp456
    tmp461 = triton_helpers.maximum(tmp460, tmp17)
    tmp462 = libdevice.pow(tmp461, tmp19)
    tmp463 = tmp459 + tmp462
    tmp464 = tmp26 - tmp456
    tmp465 = triton_helpers.maximum(tmp464, tmp17)
    tmp466 = libdevice.pow(tmp465, tmp19)
    tmp467 = tmp463 + tmp466
    tmp468 = tmp31 - tmp456
    tmp469 = triton_helpers.maximum(tmp468, tmp17)
    tmp470 = libdevice.pow(tmp469, tmp19)
    tmp471 = tmp467 + tmp470
    tmp472 = tmp471 - tmp10
    tmp473 = tmp472 * tmp52
    tmp474 = tmp473 >= tmp17
    tmp475 = tl.where(tmp474, tmp456, tmp454)
    tmp476 = tmp455 * tmp1
    tmp477 = tmp475 + tmp476
    tmp478 = tmp2 - tmp477
    tmp479 = triton_helpers.maximum(tmp478, tmp17)
    tmp480 = libdevice.pow(tmp479, tmp19)
    tmp481 = tmp21 - tmp477
    tmp482 = triton_helpers.maximum(tmp481, tmp17)
    tmp483 = libdevice.pow(tmp482, tmp19)
    tmp484 = tmp480 + tmp483
    tmp485 = tmp26 - tmp477
    tmp486 = triton_helpers.maximum(tmp485, tmp17)
    tmp487 = libdevice.pow(tmp486, tmp19)
    tmp488 = tmp484 + tmp487
    tmp489 = tmp31 - tmp477
    tmp490 = triton_helpers.maximum(tmp489, tmp17)
    tmp491 = libdevice.pow(tmp490, tmp19)
    tmp492 = tmp488 + tmp491
    tmp493 = tmp492 - tmp10
    tmp494 = tmp493 * tmp52
    tmp495 = tmp494 >= tmp17
    tmp496 = tl.where(tmp495, tmp477, tmp475)
    tmp497 = tmp476 * tmp1
    tmp498 = tmp496 + tmp497
    tmp499 = tmp2 - tmp498
    tmp500 = triton_helpers.maximum(tmp499, tmp17)
    tmp501 = libdevice.pow(tmp500, tmp19)
    tmp502 = tmp21 - tmp498
    tmp503 = triton_helpers.maximum(tmp502, tmp17)
    tmp504 = libdevice.pow(tmp503, tmp19)
    tmp505 = tmp501 + tmp504
    tmp506 = tmp26 - tmp498
    tmp507 = triton_helpers.maximum(tmp506, tmp17)
    tmp508 = libdevice.pow(tmp507, tmp19)
    tmp509 = tmp505 + tmp508
    tmp510 = tmp31 - tmp498
    tmp511 = triton_helpers.maximum(tmp510, tmp17)
    tmp512 = libdevice.pow(tmp511, tmp19)
    tmp513 = tmp509 + tmp512
    tmp514 = tmp513 - tmp10
    tmp515 = tmp514 * tmp52
    tmp516 = tmp515 >= tmp17
    tmp517 = tl.where(tmp516, tmp498, tmp496)
    tmp518 = tmp497 * tmp1
    tmp519 = tmp517 + tmp518
    tmp520 = tmp2 - tmp519
    tmp521 = triton_helpers.maximum(tmp520, tmp17)
    tmp522 = libdevice.pow(tmp521, tmp19)
    tmp523 = tmp21 - tmp519
    tmp524 = triton_helpers.maximum(tmp523, tmp17)
    tmp525 = libdevice.pow(tmp524, tmp19)
    tmp526 = tmp522 + tmp525
    tmp527 = tmp26 - tmp519
    tmp528 = triton_helpers.maximum(tmp527, tmp17)
    tmp529 = libdevice.pow(tmp528, tmp19)
    tmp530 = tmp526 + tmp529
    tmp531 = tmp31 - tmp519
    tmp532 = triton_helpers.maximum(tmp531, tmp17)
    tmp533 = libdevice.pow(tmp532, tmp19)
    tmp534 = tmp530 + tmp533
    tmp535 = tmp534 - tmp10
    tmp536 = tmp535 * tmp52
    tmp537 = tmp536 >= tmp17
    tmp538 = tl.where(tmp537, tmp519, tmp517)
    tmp539 = tmp518 * tmp1
    tmp540 = tmp538 + tmp539
    tmp541 = tmp2 - tmp540
    tmp542 = triton_helpers.maximum(tmp541, tmp17)
    tmp543 = libdevice.pow(tmp542, tmp19)
    tmp544 = tmp21 - tmp540
    tmp545 = triton_helpers.maximum(tmp544, tmp17)
    tmp546 = libdevice.pow(tmp545, tmp19)
    tmp547 = tmp543 + tmp546
    tmp548 = tmp26 - tmp540
    tmp549 = triton_helpers.maximum(tmp548, tmp17)
    tmp550 = libdevice.pow(tmp549, tmp19)
    tmp551 = tmp547 + tmp550
    tmp552 = tmp31 - tmp540
    tmp553 = triton_helpers.maximum(tmp552, tmp17)
    tmp554 = libdevice.pow(tmp553, tmp19)
    tmp555 = tmp551 + tmp554
    tmp556 = tmp555 - tmp10
    tmp557 = tmp556 * tmp52
    tmp558 = tmp557 >= tmp17
    tmp559 = tl.where(tmp558, tmp540, tmp538)
    tmp560 = tmp539 * tmp1
    tmp561 = tmp559 + tmp560
    tmp562 = tmp2 - tmp561
    tmp563 = triton_helpers.maximum(tmp562, tmp17)
    tmp564 = libdevice.pow(tmp563, tmp19)
    tmp565 = tmp21 - tmp561
    tmp566 = triton_helpers.maximum(tmp565, tmp17)
    tmp567 = libdevice.pow(tmp566, tmp19)
    tmp568 = tmp564 + tmp567
    tmp569 = tmp26 - tmp561
    tmp570 = triton_helpers.maximum(tmp569, tmp17)
    tmp571 = libdevice.pow(tmp570, tmp19)
    tmp572 = tmp568 + tmp571
    tmp573 = tmp31 - tmp561
    tmp574 = triton_helpers.maximum(tmp573, tmp17)
    tmp575 = libdevice.pow(tmp574, tmp19)
    tmp576 = tmp572 + tmp575
    tmp577 = tmp576 - tmp10
    tmp578 = tmp577 * tmp52
    tmp579 = tmp578 >= tmp17
    tmp580 = tl.where(tmp579, tmp561, tmp559)
    tmp581 = tmp560 * tmp1
    tmp582 = tmp580 + tmp581
    tmp583 = tmp2 - tmp582
    tmp584 = triton_helpers.maximum(tmp583, tmp17)
    tmp585 = libdevice.pow(tmp584, tmp19)
    tmp586 = tmp21 - tmp582
    tmp587 = triton_helpers.maximum(tmp586, tmp17)
    tmp588 = libdevice.pow(tmp587, tmp19)
    tmp589 = tmp585 + tmp588
    tmp590 = tmp26 - tmp582
    tmp591 = triton_helpers.maximum(tmp590, tmp17)
    tmp592 = libdevice.pow(tmp591, tmp19)
    tmp593 = tmp589 + tmp592
    tmp594 = tmp31 - tmp582
    tmp595 = triton_helpers.maximum(tmp594, tmp17)
    tmp596 = libdevice.pow(tmp595, tmp19)
    tmp597 = tmp593 + tmp596
    tmp598 = tmp597 - tmp10
    tmp599 = tmp598 * tmp52
    tmp600 = tmp599 >= tmp17
    tmp601 = tl.where(tmp600, tmp582, tmp580)
    tmp602 = tmp581 * tmp1
    tmp603 = tmp601 + tmp602
    tmp604 = tmp2 - tmp603
    tmp605 = triton_helpers.maximum(tmp604, tmp17)
    tmp606 = libdevice.pow(tmp605, tmp19)
    tmp607 = tmp21 - tmp603
    tmp608 = triton_helpers.maximum(tmp607, tmp17)
    tmp609 = libdevice.pow(tmp608, tmp19)
    tmp610 = tmp606 + tmp609
    tmp611 = tmp26 - tmp603
    tmp612 = triton_helpers.maximum(tmp611, tmp17)
    tmp613 = libdevice.pow(tmp612, tmp19)
    tmp614 = tmp610 + tmp613
    tmp615 = tmp31 - tmp603
    tmp616 = triton_helpers.maximum(tmp615, tmp17)
    tmp617 = libdevice.pow(tmp616, tmp19)
    tmp618 = tmp614 + tmp617
    tl.store(out_ptr0 + x0, tmp50, xmask)
    tl.store(out_ptr25 + x0, tmp392, xmask)
    tl.store(in_out_ptr13 + x0, tmp601, xmask)
    tl.store(out_ptr31 + x0, tmp618, xmask)


@triton.jit
def triton_poi_fused_add_clamp_div_mul_pow_sub_where_1(in_ptr0, in_ptr1,
    in_ptr2, in_ptr3, in_ptr4, out_ptr0, xnumel, XBLOCK: tl.constexpr):
    xnumel = 256
    xoffset = tl.program_id(0) * XBLOCK
    xindex = xoffset + tl.arange(0, XBLOCK)[:]
    xmask = xindex < xnumel
    x2 = xindex
    x1 = xindex // 4
    tmp0 = tl.load(in_ptr0 + x2, xmask)
    tmp3 = tl.load(in_ptr1 + x1, xmask, eviction_policy='evict_last')
    tmp6 = tl.load(in_ptr2 + x1, xmask, eviction_policy='evict_last')
    tmp11 = tl.load(in_ptr3 + x1, xmask, eviction_policy='evict_last')
    tmp12 = tl.load(in_ptr4 + x1, xmask, eviction_policy='evict_last')
    tmp1 = 0.5
    tmp2 = tmp0 * tmp1
    tmp4 = 1.0
    tmp5 = tmp3 - tmp4
    tmp7 = tmp6 - tmp4
    tmp8 = tmp5 * tmp7
    tmp9 = 0.0
    tmp10 = tmp8 >= tmp9
    tmp13 = tmp12 * tmp1
    tmp14 = tmp13 * tmp1
    tmp15 = tmp14 * tmp1
    tmp16 = tmp15 * tmp1
    tmp17 = tmp16 * tmp1
    tmp18 = tmp17 * tmp1
    tmp19 = tmp18 * tmp1
    tmp20 = tmp19 * tmp1
    tmp21 = tmp20 * tmp1
    tmp22 = tmp21 * tmp1
    tmp23 = tmp11 + tmp22
    tmp24 = tl.where(tmp10, tmp23, tmp11)
    tmp25 = tmp22 * tmp1
    tmp26 = tmp24 + tmp25
    tmp27 = tmp2 - tmp26
    tmp28 = triton_helpers.maximum(tmp27, tmp9)
    tmp29 = 2.0
    tmp30 = libdevice.pow(tmp28, tmp29)
    tl.store(out_ptr0 + x2, tmp30, xmask)


@triton.jit
def triton_poi_fused_add_clamp_div_mul_pow_sub_sum_where_2(in_out_ptr0,
    in_ptr0, in_ptr1, in_ptr2, in_ptr3, in_ptr4, out_ptr0, xnumel, XBLOCK:
    tl.constexpr):
    xnumel = 64
    xoffset = tl.program_id(0) * XBLOCK
    xindex = xoffset + tl.arange(0, XBLOCK)[:]
    xmask = xindex < xnumel
    x0 = xindex
    tmp0 = tl.load(in_ptr0 + 4 * x0, xmask, eviction_policy='evict_last')
    tmp1 = tl.load(in_ptr0 + (1 + 4 * x0), xmask, eviction_policy='evict_last')
    tmp3 = tl.load(in_ptr0 + (2 + 4 * x0), xmask, eviction_policy='evict_last')
    tmp5 = tl.load(in_ptr0 + (3 + 4 * x0), xmask, eviction_policy='evict_last')
    tmp9 = tl.load(in_ptr1 + x0, xmask)
    tmp14 = tl.load(in_ptr2 + x0, xmask)
    tmp18 = tl.load(in_out_ptr0 + x0, xmask)
    tmp19 = tl.load(in_ptr3 + x0, xmask)
    tmp36 = tl.load(in_ptr4 + 4 * x0, xmask, eviction_policy='evict_last')
    tmp44 = tl.load(in_ptr4 + (1 + 4 * x0), xmask, eviction_policy='evict_last'
        )
    tmp50 = tl.load(in_ptr4 + (2 + 4 * x0), xmask, eviction_policy='evict_last'
        )
    tmp56 = tl.load(in_ptr4 + (3 + 4 * x0), xmask, eviction_policy='evict_last'
        )
    tmp2 = tmp0 + tmp1
    tmp4 = tmp2 + tmp3
    tmp6 = tmp4 + tmp5
    tmp7 = 1.0
    tmp8 = tmp6 - tmp7
    tmp10 = tmp9 - tmp7
    tmp11 = tmp8 * tmp10
    tmp12 = 0.0
    tmp13 = tmp11 >= tmp12
    tmp15 = tmp14 - tmp7
    tmp16 = tmp15 * tmp10
    tmp17 = tmp16 >= tmp12
    tmp20 = 0.5
    tmp21 = tmp19 * tmp20
    tmp22 = tmp21 * tmp20
    tmp23 = tmp22 * tmp20
    tmp24 = tmp23 * tmp20
    tmp25 = tmp24 * tmp20
    tmp26 = tmp25 * tmp20
    tmp27 = tmp26 * tmp20
    tmp28 = tmp27 * tmp20
    tmp29 = tmp28 * tmp20
    tmp30 = tmp29 * tmp20
    tmp31 = tmp18 + tmp30
    tmp32 = tl.where(tmp17, tmp31, tmp18)
    tmp33 = tmp30 * tmp20
    tmp34 = tmp32 + tmp33
    tmp35 = tl.where(tmp13, tmp34, tmp32)
    tmp37 = tmp36 * tmp20
    tmp38 = tmp33 * tmp20
    tmp39 = tmp35 + tmp38
    tmp40 = tmp37 - tmp39
    tmp41 = triton_helpers.maximum(tmp40, tmp12)
    tmp42 = 2.0
    tmp43 = libdevice.pow(tmp41, tmp42)
    tmp45 = tmp44 * tmp20
    tmp46 = tmp45 - tmp39
    tmp47 = triton_helpers.maximum(tmp46, tmp12)
    tmp48 = libdevice.pow(tmp47, tmp42)
    tmp49 = tmp43 + tmp48
    tmp51 = tmp50 * tmp20
    tmp52 = tmp51 - tmp39
    tmp53 = triton_helpers.maximum(tmp52, tmp12)
    tmp54 = libdevice.pow(tmp53, tmp42)
    tmp55 = tmp49 + tmp54
    tmp57 = tmp56 * tmp20
    tmp58 = tmp57 - tmp39
    tmp59 = triton_helpers.maximum(tmp58, tmp12)
    tmp60 = libdevice.pow(tmp59, tmp42)
    tmp61 = tmp55 + tmp60
    tl.store(in_out_ptr0 + x0, tmp35, xmask)
    tl.store(out_ptr0 + x0, tmp61, xmask)


@triton.jit
def triton_poi_fused_add_clamp_div_mul_sub_where_3(in_ptr0, in_ptr1,
    in_ptr2, in_ptr3, in_ptr4, out_ptr0, xnumel, XBLOCK: tl.constexpr):
    xnumel = 256
    xoffset = tl.program_id(0) * XBLOCK
    xindex = xoffset + tl.arange(0, XBLOCK)[:]
    xmask = xindex < xnumel
    x2 = xindex
    x1 = xindex // 4
    tmp0 = tl.load(in_ptr0 + x2, xmask)
    tmp3 = tl.load(in_ptr1 + x1, xmask, eviction_policy='evict_last')
    tmp6 = tl.load(in_ptr2 + x1, xmask, eviction_policy='evict_last')
    tmp11 = tl.load(in_ptr3 + x1, xmask, eviction_policy='evict_last')
    tmp12 = tl.load(in_ptr4 + x1, xmask, eviction_policy='evict_last')
    tmp1 = 0.5
    tmp2 = tmp0 * tmp1
    tmp4 = 1.0
    tmp5 = tmp3 - tmp4
    tmp7 = tmp6 - tmp4
    tmp8 = tmp5 * tmp7
    tmp9 = 0.0
    tmp10 = tmp8 >= tmp9
    tmp13 = tmp12 * tmp1
    tmp14 = tmp13 * tmp1
    tmp15 = tmp14 * tmp1
    tmp16 = tmp15 * tmp1
    tmp17 = tmp16 * tmp1
    tmp18 = tmp17 * tmp1
    tmp19 = tmp18 * tmp1
    tmp20 = tmp19 * tmp1
    tmp21 = tmp20 * tmp1
    tmp22 = tmp21 * tmp1
    tmp23 = tmp22 * tmp1
    tmp24 = tmp23 * tmp1
    tmp25 = tmp11 + tmp24
    tmp26 = tl.where(tmp10, tmp25, tmp11)
    tmp27 = tmp24 * tmp1
    tmp28 = tmp26 + tmp27
    tmp29 = tmp2 - tmp28
    tmp30 = triton_helpers.maximum(tmp29, tmp9)
    tl.store(out_ptr0 + x2, tmp30, xmask)


@triton.jit
def triton_poi_fused_add_clamp_div_mul_pow_sub_sum_where_4(in_out_ptr0,
    in_ptr0, in_ptr1, in_ptr2, in_ptr3, in_ptr4, out_ptr0, xnumel, XBLOCK:
    tl.constexpr):
    xnumel = 64
    xoffset = tl.program_id(0) * XBLOCK
    xindex = xoffset + tl.arange(0, XBLOCK)[:]
    xmask = xindex < xnumel
    x0 = xindex
    tmp0 = tl.load(in_ptr0 + 4 * x0, xmask, eviction_policy='evict_last')
    tmp3 = tl.load(in_ptr0 + (1 + 4 * x0), xmask, eviction_policy='evict_last')
    tmp6 = tl.load(in_ptr0 + (2 + 4 * x0), xmask, eviction_policy='evict_last')
    tmp9 = tl.load(in_ptr0 + (3 + 4 * x0), xmask, eviction_policy='evict_last')
    tmp14 = tl.load(in_ptr1 + x0, xmask)
    tmp19 = tl.load(in_ptr2 + x0, xmask)
    tmp23 = tl.load(in_out_ptr0 + x0, xmask)
    tmp24 = tl.load(in_ptr3 + x0, xmask)
    tmp43 = tl.load(in_ptr4 + 4 * x0, xmask, eviction_policy='evict_last')
    tmp50 = tl.load(in_ptr4 + (1 + 4 * x0), xmask, eviction_policy='evict_last'
        )
    tmp56 = tl.load(in_ptr4 + (2 + 4 * x0), xmask, eviction_policy='evict_last'
        )
    tmp62 = tl.load(in_ptr4 + (3 + 4 * x0), xmask, eviction_policy='evict_last'
        )
    tmp1 = 2.0
    tmp2 = libdevice.pow(tmp0, tmp1)
    tmp4 = libdevice.pow(tmp3, tmp1)
    tmp5 = tmp2 + tmp4
    tmp7 = libdevice.pow(tmp6, tmp1)
    tmp8 = tmp5 + tmp7
    tmp10 = libdevice.pow(tmp9, tmp1)
    tmp11 = tmp8 + tmp10
    tmp12 = 1.0
    tmp13 = tmp11 - tmp12
    tmp15 = tmp14 - tmp12
    tmp16 = tmp13 * tmp15
    tmp17 = 0.0
    tmp18 = tmp16 >= tmp17
    tmp20 = tmp19 - tmp12
    tmp21 = tmp20 * tmp15
    tmp22 = tmp21 >= tmp17
    tmp25 = 0.5
    tmp26 = tmp24 * tmp25
    tmp27 = tmp26 * tmp25
    tmp28 = tmp27 * tmp25
    tmp29 = tmp28 * tmp25
    tmp30 = tmp29 * tmp25
    tmp31 = tmp30 * tmp25
    tmp32 = tmp31 * tmp25
    tmp33 = tmp32 * tmp25
    tmp34 = tmp33 * tmp25
    tmp35 = tmp34 * tmp25
    tmp36 = tmp35 * tmp25
    tmp37 = tmp36 * tmp25
    tmp38 = tmp23 + tmp37
    tmp39 = tl.where(tmp22, tmp38, tmp23)
    tmp40 = tmp37 * tmp25
    tmp41 = tmp39 + tmp40
    tmp42 = tl.where(tmp18, tmp41, tmp39)
    tmp44 = tmp43 * tmp25
    tmp45 = tmp40 * tmp25
    tmp46 = tmp42 + tmp45
    tmp47 = tmp44 - tmp46
    tmp48 = triton_helpers.maximum(tmp47, tmp17)
    tmp49 = libdevice.pow(tmp48, tmp1)
    tmp51 = tmp50 * tmp25
    tmp52 = tmp51 - tmp46
    tmp53 = triton_helpers.maximum(tmp52, tmp17)
    tmp54 = libdevice.pow(tmp53, tmp1)
    tmp55 = tmp49 + tmp54
    tmp57 = tmp56 * tmp25
    tmp58 = tmp57 - tmp46
    tmp59 = triton_helpers.maximum(tmp58, tmp17)
    tmp60 = libdevice.pow(tmp59, tmp1)
    tmp61 = tmp55 + tmp60
    tmp63 = tmp62 * tmp25
    tmp64 = tmp63 - tmp46
    tmp65 = triton_helpers.maximum(tmp64, tmp17)
    tmp66 = libdevice.pow(tmp65, tmp1)
    tmp67 = tmp61 + tmp66
    tl.store(in_out_ptr0 + x0, tmp42, xmask)
    tl.store(out_ptr0 + x0, tmp67, xmask)


@triton.jit
def triton_poi_fused_add_div_mul_sub_where_5(in_ptr0, in_ptr1, in_ptr2,
    in_ptr3, in_ptr4, out_ptr0, xnumel, XBLOCK: tl.constexpr):
    xnumel = 256
    xoffset = tl.program_id(0) * XBLOCK
    xindex = xoffset + tl.arange(0, XBLOCK)[:]
    xmask = xindex < xnumel
    x2 = xindex
    x1 = xindex // 4
    tmp0 = tl.load(in_ptr0 + x2, xmask)
    tmp3 = tl.load(in_ptr1 + x1, xmask, eviction_policy='evict_last')
    tmp6 = tl.load(in_ptr2 + x1, xmask, eviction_policy='evict_last')
    tmp11 = tl.load(in_ptr3 + x1, xmask, eviction_policy='evict_last')
    tmp12 = tl.load(in_ptr4 + x1, xmask, eviction_policy='evict_last')
    tmp1 = 0.5
    tmp2 = tmp0 * tmp1
    tmp4 = 1.0
    tmp5 = tmp3 - tmp4
    tmp7 = tmp6 - tmp4
    tmp8 = tmp5 * tmp7
    tmp9 = 0.0
    tmp10 = tmp8 >= tmp9
    tmp13 = tmp12 * tmp1
    tmp14 = tmp13 * tmp1
    tmp15 = tmp14 * tmp1
    tmp16 = tmp15 * tmp1
    tmp17 = tmp16 * tmp1
    tmp18 = tmp17 * tmp1
    tmp19 = tmp18 * tmp1
    tmp20 = tmp19 * tmp1
    tmp21 = tmp20 * tmp1
    tmp22 = tmp21 * tmp1
    tmp23 = tmp22 * tmp1
    tmp24 = tmp23 * tmp1
    tmp25 = tmp24 * tmp1
    tmp26 = tmp25 * tmp1
    tmp27 = tmp11 + tmp26
    tmp28 = tl.where(tmp10, tmp27, tmp11)
    tmp29 = tmp26 * tmp1
    tmp30 = tmp28 + tmp29
    tmp31 = tmp2 - tmp30
    tl.store(out_ptr0 + x2, tmp31, xmask)


@triton.jit
def triton_poi_fused_add_clamp_div_mul_pow_sub_sum_where_6(in_out_ptr0,
    in_out_ptr3, in_ptr0, in_ptr1, in_ptr2, in_ptr3, in_ptr4, xnumel,
    XBLOCK: tl.constexpr):
    xnumel = 64
    xoffset = tl.program_id(0) * XBLOCK
    xindex = xoffset + tl.arange(0, XBLOCK)[:]
    xmask = xindex < xnumel
    x0 = xindex
    tmp0 = tl.load(in_ptr0 + 4 * x0, xmask, eviction_policy='evict_last')
    tmp5 = tl.load(in_ptr0 + (1 + 4 * x0), xmask, eviction_policy='evict_last')
    tmp9 = tl.load(in_ptr0 + (2 + 4 * x0), xmask, eviction_policy='evict_last')
    tmp13 = tl.load(in_ptr0 + (3 + 4 * x0), xmask, eviction_policy='evict_last'
        )
    tmp19 = tl.load(in_ptr1 + x0, xmask)
    tmp23 = tl.load(in_ptr2 + x0, xmask)
    tmp27 = tl.load(in_out_ptr0 + x0, xmask)
    tmp28 = tl.load(in_ptr3 + x0, xmask)
    tmp49 = tl.load(in_ptr4 + 4 * x0, xmask, eviction_policy='evict_last')
    tmp56 = tl.load(in_ptr4 + (1 + 4 * x0), xmask, eviction_policy='evict_last'
        )
    tmp62 = tl.load(in_ptr4 + (2 + 4 * x0), xmask, eviction_policy='evict_last'
        )
    tmp68 = tl.load(in_ptr4 + (3 + 4 * x0), xmask, eviction_policy='evict_last'
        )
    tmp1 = 0.0
    tmp2 = triton_helpers.maximum(tmp0, tmp1)
    tmp3 = 2.0
    tmp4 = libdevice.pow(tmp2, tmp3)
    tmp6 = triton_helpers.maximum(tmp5, tmp1)
    tmp7 = libdevice.pow(tmp6, tmp3)
    tmp8 = tmp4 + tmp7
    tmp10 = triton_helpers.maximum(tmp9, tmp1)
    tmp11 = libdevice.pow(tmp10, tmp3)
    tmp12 = tmp8 + tmp11
    tmp14 = triton_helpers.maximum(tmp13, tmp1)
    tmp15 = libdevice.pow(tmp14, tmp3)
    tmp16 = tmp12 + tmp15
    tmp17 = 1.0
    tmp18 = tmp16 - tmp17
    tmp20 = tmp19 - tmp17
    tmp21 = tmp18 * tmp20
    tmp22 = tmp21 >= tmp1
    tmp24 = tmp23 - tmp17
    tmp25 = tmp24 * tmp20
    tmp26 = tmp25 >= tmp1
    tmp29 = 0.5
    tmp30 = tmp28 * tmp29
    tmp31 = tmp30 * tmp29
    tmp32 = tmp31 * tmp29
    tmp33 = tmp32 * tmp29
    tmp34 = tmp33 * tmp29
    tmp35 = tmp34 * tmp29
    tmp36 = tmp35 * tmp29
    tmp37 = tmp36 * tmp29
    tmp38 = tmp37 * tmp29
    tmp39 = tmp38 * tmp29
    tmp40 = tmp39 * tmp29
    tmp41 = tmp40 * tmp29
    tmp42 = tmp41 * tmp29
    tmp43 = tmp42 * tmp29
    tmp44 = tmp27 + tmp43
    tmp45 = tl.where(tmp26, tmp44, tmp27)
    tmp46 = tmp43 * tmp29
    tmp47 = tmp45 + tmp46
    tmp48 = tl.where(tmp22, tmp47, tmp45)
    tmp50 = tmp49 * tmp29
    tmp51 = tmp46 * tmp29
    tmp52 = tmp48 + tmp51
    tmp53 = tmp50 - tmp52
    tmp54 = triton_helpers.maximum(tmp53, tmp1)
    tmp55 = libdevice.pow(tmp54, tmp3)
    tmp57 = tmp56 * tmp29
    tmp58 = tmp57 - tmp52
    tmp59 = triton_helpers.maximum(tmp58, tmp1)
    tmp60 = libdevice.pow(tmp59, tmp3)
    tmp61 = tmp55 + tmp60
    tmp63 = tmp62 * tmp29
    tmp64 = tmp63 - tmp52
    tmp65 = triton_helpers.maximum(tmp64, tmp1)
    tmp66 = libdevice.pow(tmp65, tmp3)
    tmp67 = tmp61 + tmp66
    tmp69 = tmp68 * tmp29
    tmp70 = tmp69 - tmp52
    tmp71 = triton_helpers.maximum(tmp70, tmp1)
    tmp72 = libdevice.pow(tmp71, tmp3)
    tmp73 = tmp67 + tmp72
    tmp74 = tmp73 - tmp17
    tmp75 = tmp74 * tmp20
    tmp76 = tmp75 >= tmp1
    tmp77 = tl.where(tmp76, tmp52, tmp48)
    tmp78 = tmp51 * tmp29
    tmp79 = tmp77 + tmp78
    tmp80 = tmp50 - tmp79
    tmp81 = triton_helpers.maximum(tmp80, tmp1)
    tmp82 = libdevice.pow(tmp81, tmp3)
    tmp83 = tmp57 - tmp79
    tmp84 = triton_helpers.maximum(tmp83, tmp1)
    tmp85 = libdevice.pow(tmp84, tmp3)
    tmp86 = tmp82 + tmp85
    tmp87 = tmp63 - tmp79
    tmp88 = triton_helpers.maximum(tmp87, tmp1)
    tmp89 = libdevice.pow(tmp88, tmp3)
    tmp90 = tmp86 + tmp89
    tmp91 = tmp69 - tmp79
    tmp92 = triton_helpers.maximum(tmp91, tmp1)
    tmp93 = libdevice.pow(tmp92, tmp3)
    tmp94 = tmp90 + tmp93
    tmp95 = tmp94 - tmp17
    tmp96 = tmp95 * tmp20
    tmp97 = tmp96 >= tmp1
    tmp98 = tl.where(tmp97, tmp79, tmp77)
    tmp99 = tmp78 * tmp29
    tmp100 = tmp98 + tmp99
    tmp101 = tmp50 - tmp100
    tmp102 = triton_helpers.maximum(tmp101, tmp1)
    tmp103 = libdevice.pow(tmp102, tmp3)
    tmp104 = tmp57 - tmp100
    tmp105 = triton_helpers.maximum(tmp104, tmp1)
    tmp106 = libdevice.pow(tmp105, tmp3)
    tmp107 = tmp103 + tmp106
    tmp108 = tmp63 - tmp100
    tmp109 = triton_helpers.maximum(tmp108, tmp1)
    tmp110 = libdevice.pow(tmp109, tmp3)
    tmp111 = tmp107 + tmp110
    tmp112 = tmp69 - tmp100
    tmp113 = triton_helpers.maximum(tmp112, tmp1)
    tmp114 = libdevice.pow(tmp113, tmp3)
    tmp115 = tmp111 + tmp114
    tmp116 = tmp115 - tmp17
    tmp117 = tmp116 * tmp20
    tmp118 = tmp117 >= tmp1
    tmp119 = tl.where(tmp118, tmp100, tmp98)
    tmp120 = tmp99 * tmp29
    tmp121 = tmp119 + tmp120
    tmp122 = tmp50 - tmp121
    tmp123 = triton_helpers.maximum(tmp122, tmp1)
    tmp124 = libdevice.pow(tmp123, tmp3)
    tmp125 = tmp57 - tmp121
    tmp126 = triton_helpers.maximum(tmp125, tmp1)
    tmp127 = libdevice.pow(tmp126, tmp3)
    tmp128 = tmp124 + tmp127
    tmp129 = tmp63 - tmp121
    tmp130 = triton_helpers.maximum(tmp129, tmp1)
    tmp131 = libdevice.pow(tmp130, tmp3)
    tmp132 = tmp128 + tmp131
    tmp133 = tmp69 - tmp121
    tmp134 = triton_helpers.maximum(tmp133, tmp1)
    tmp135 = libdevice.pow(tmp134, tmp3)
    tmp136 = tmp132 + tmp135
    tmp137 = tmp136 - tmp17
    tmp138 = tmp137 * tmp20
    tmp139 = tmp138 >= tmp1
    tmp140 = tl.where(tmp139, tmp121, tmp119)
    tl.store(in_out_ptr3 + x0, tmp140, xmask)


@triton.jit
def triton_poi_fused_add_clamp_div_mul_pow_sub_7(in_ptr0, in_ptr1, in_ptr2,
    out_ptr0, xnumel, XBLOCK: tl.constexpr):
    xnumel = 256
    xoffset = tl.program_id(0) * XBLOCK
    xindex = xoffset + tl.arange(0, XBLOCK)[:]
    xmask = xindex < xnumel
    x2 = xindex
    x1 = xindex // 4
    tmp0 = tl.load(in_ptr0 + x2, xmask)
    tmp3 = tl.load(in_ptr1 + x1, xmask, eviction_policy='evict_last')
    tmp4 = tl.load(in_ptr2 + x1, xmask, eviction_policy='evict_last')
    tmp1 = 0.5
    tmp2 = tmp0 * tmp1
    tmp5 = tmp4 * tmp1
    tmp6 = tmp5 * tmp1
    tmp7 = tmp6 * tmp1
    tmp8 = tmp7 * tmp1
    tmp9 = tmp8 * tmp1
    tmp10 = tmp9 * tmp1
    tmp11 = tmp10 * tmp1
    tmp12 = tmp11 * tmp1
    tmp13 = tmp12 * tmp1
    tmp14 = tmp13 * tmp1
    tmp15 = tmp14 * tmp1
    tmp16 = tmp15 * tmp1
    tmp17 = tmp16 * tmp1
    tmp18 = tmp17 * tmp1
    tmp19 = tmp18 * tmp1
    tmp20 = tmp19 * tmp1
    tmp21 = tmp20 * tmp1
    tmp22 = tmp21 * tmp1
    tmp23 = tmp22 * tmp1
    tmp24 = tmp23 * tmp1
    tmp25 = tmp3 + tmp24
    tmp26 = tmp2 - tmp25
    tmp27 = 0.0
    tmp28 = triton_helpers.maximum(tmp26, tmp27)
    tmp29 = 2.0
    tmp30 = libdevice.pow(tmp28, tmp29)
    tl.store(out_ptr0 + x2, tmp30, xmask)


@triton.jit
def triton_poi_fused_add_div_where_8(in_out_ptr0, in_ptr0, in_ptr1, in_ptr2,
    xnumel, XBLOCK: tl.constexpr):
    xnumel = 64
    xoffset = tl.program_id(0) * XBLOCK
    xindex = xoffset + tl.arange(0, XBLOCK)[:]
    xmask = xindex < xnumel
    x0 = xindex
    tmp0 = tl.load(in_ptr0 + 4 * x0, xmask, eviction_policy='evict_last')
    tmp1 = tl.load(in_ptr0 + (1 + 4 * x0), xmask, eviction_policy='evict_last')
    tmp3 = tl.load(in_ptr0 + (2 + 4 * x0), xmask, eviction_policy='evict_last')
    tmp5 = tl.load(in_ptr0 + (3 + 4 * x0), xmask, eviction_policy='evict_last')
    tmp9 = tl.load(in_ptr1 + x0, xmask)
    tmp14 = tl.load(in_out_ptr0 + x0, xmask)
    tmp15 = tl.load(in_ptr2 + x0, xmask)
    tmp2 = tmp0 + tmp1
    tmp4 = tmp2 + tmp3
    tmp6 = tmp4 + tmp5
    tmp7 = 1.0
    tmp8 = tmp6 - tmp7
    tmp10 = tmp9 - tmp7
    tmp11 = tmp8 * tmp10
    tmp12 = 0.0
    tmp13 = tmp11 >= tmp12
    tmp16 = 0.5
    tmp17 = tmp15 * tmp16
    tmp18 = tmp17 * tmp16
    tmp19 = tmp18 * tmp16
    tmp20 = tmp19 * tmp16
    tmp21 = tmp20 * tmp16
    tmp22 = tmp21 * tmp16
    tmp23 = tmp22 * tmp16
    tmp24 = tmp23 * tmp16
    tmp25 = tmp24 * tmp16
    tmp26 = tmp25 * tmp16
    tmp27 = tmp26 * tmp16
    tmp28 = tmp27 * tmp16
    tmp29 = tmp28 * tmp16
    tmp30 = tmp29 * tmp16
    tmp31 = tmp30 * tmp16
    tmp32 = tmp31 * tmp16
    tmp33 = tmp32 * tmp16
    tmp34 = tmp33 * tmp16
    tmp35 = tmp34 * tmp16
    tmp36 = tmp35 * tmp16
    tmp37 = tmp14 + tmp36
    tmp38 = tl.where(tmp13, tmp37, tmp14)
    tl.store(in_out_ptr0 + x0, tmp38, xmask)


@triton.jit
def triton_poi_fused_add_clamp_div_mul_pow_sub_9(in_ptr0, in_ptr1, in_ptr2,
    out_ptr0, xnumel, XBLOCK: tl.constexpr):
    xnumel = 256
    xoffset = tl.program_id(0) * XBLOCK
    xindex = xoffset + tl.arange(0, XBLOCK)[:]
    xmask = xindex < xnumel
    x2 = xindex
    x1 = xindex // 4
    tmp0 = tl.load(in_ptr0 + x2, xmask)
    tmp3 = tl.load(in_ptr1 + x1, xmask, eviction_policy='evict_last')
    tmp4 = tl.load(in_ptr2 + x1, xmask, eviction_policy='evict_last')
    tmp1 = 0.5
    tmp2 = tmp0 * tmp1
    tmp5 = tmp4 * tmp1
    tmp6 = tmp5 * tmp1
    tmp7 = tmp6 * tmp1
    tmp8 = tmp7 * tmp1
    tmp9 = tmp8 * tmp1
    tmp10 = tmp9 * tmp1
    tmp11 = tmp10 * tmp1
    tmp12 = tmp11 * tmp1
    tmp13 = tmp12 * tmp1
    tmp14 = tmp13 * tmp1
    tmp15 = tmp14 * tmp1
    tmp16 = tmp15 * tmp1
    tmp17 = tmp16 * tmp1
    tmp18 = tmp17 * tmp1
    tmp19 = tmp18 * tmp1
    tmp20 = tmp19 * tmp1
    tmp21 = tmp20 * tmp1
    tmp22 = tmp21 * tmp1
    tmp23 = tmp22 * tmp1
    tmp24 = tmp23 * tmp1
    tmp25 = tmp24 * tmp1
    tmp26 = tmp3 + tmp25
    tmp27 = tmp2 - tmp26
    tmp28 = 0.0
    tmp29 = triton_helpers.maximum(tmp27, tmp28)
    tmp30 = 2.0
    tmp31 = libdevice.pow(tmp29, tmp30)
    tl.store(out_ptr0 + x2, tmp31, xmask)


@triton.jit
def triton_poi_fused_add_div_where_10(in_out_ptr0, in_ptr0, in_ptr1,
    in_ptr2, xnumel, XBLOCK: tl.constexpr):
    xnumel = 64
    xoffset = tl.program_id(0) * XBLOCK
    xindex = xoffset + tl.arange(0, XBLOCK)[:]
    xmask = xindex < xnumel
    x0 = xindex
    tmp0 = tl.load(in_ptr0 + 4 * x0, xmask, eviction_policy='evict_last')
    tmp1 = tl.load(in_ptr0 + (1 + 4 * x0), xmask, eviction_policy='evict_last')
    tmp3 = tl.load(in_ptr0 + (2 + 4 * x0), xmask, eviction_policy='evict_last')
    tmp5 = tl.load(in_ptr0 + (3 + 4 * x0), xmask, eviction_policy='evict_last')
    tmp9 = tl.load(in_ptr1 + x0, xmask)
    tmp14 = tl.load(in_out_ptr0 + x0, xmask)
    tmp15 = tl.load(in_ptr2 + x0, xmask)
    tmp2 = tmp0 + tmp1
    tmp4 = tmp2 + tmp3
    tmp6 = tmp4 + tmp5
    tmp7 = 1.0
    tmp8 = tmp6 - tmp7
    tmp10 = tmp9 - tmp7
    tmp11 = tmp8 * tmp10
    tmp12 = 0.0
    tmp13 = tmp11 >= tmp12
    tmp16 = 0.5
    tmp17 = tmp15 * tmp16
    tmp18 = tmp17 * tmp16
    tmp19 = tmp18 * tmp16
    tmp20 = tmp19 * tmp16
    tmp21 = tmp20 * tmp16
    tmp22 = tmp21 * tmp16
    tmp23 = tmp22 * tmp16
    tmp24 = tmp23 * tmp16
    tmp25 = tmp24 * tmp16
    tmp26 = tmp25 * tmp16
    tmp27 = tmp26 * tmp16
    tmp28 = tmp27 * tmp16
    tmp29 = tmp28 * tmp16
    tmp30 = tmp29 * tmp16
    tmp31 = tmp30 * tmp16
    tmp32 = tmp31 * tmp16
    tmp33 = tmp32 * tmp16
    tmp34 = tmp33 * tmp16
    tmp35 = tmp34 * tmp16
    tmp36 = tmp35 * tmp16
    tmp37 = tmp36 * tmp16
    tmp38 = tmp14 + tmp37
    tmp39 = tl.where(tmp13, tmp38, tmp14)
    tl.store(in_out_ptr0 + x0, tmp39, xmask)


@triton.jit
def triton_poi_fused_add_clamp_div_mul_sub_11(in_ptr0, in_ptr1, in_ptr2,
    out_ptr0, xnumel, XBLOCK: tl.constexpr):
    xnumel = 256
    xoffset = tl.program_id(0) * XBLOCK
    xindex = xoffset + tl.arange(0, XBLOCK)[:]
    xmask = xindex < xnumel
    x2 = xindex
    x1 = xindex // 4
    tmp0 = tl.load(in_ptr0 + x2, xmask)
    tmp3 = tl.load(in_ptr1 + x1, xmask, eviction_policy='evict_last')
    tmp4 = tl.load(in_ptr2 + x1, xmask, eviction_policy='evict_last')
    tmp1 = 0.5
    tmp2 = tmp0 * tmp1
    tmp5 = tmp4 * tmp1
    tmp6 = tmp5 * tmp1
    tmp7 = tmp6 * tmp1
    tmp8 = tmp7 * tmp1
    tmp9 = tmp8 * tmp1
    tmp10 = tmp9 * tmp1
    tmp11 = tmp10 * tmp1
    tmp12 = tmp11 * tmp1
    tmp13 = tmp12 * tmp1
    tmp14 = tmp13 * tmp1
    tmp15 = tmp14 * tmp1
    tmp16 = tmp15 * tmp1
    tmp17 = tmp16 * tmp1
    tmp18 = tmp17 * tmp1
    tmp19 = tmp18 * tmp1
    tmp20 = tmp19 * tmp1
    tmp21 = tmp20 * tmp1
    tmp22 = tmp21 * tmp1
    tmp23 = tmp22 * tmp1
    tmp24 = tmp23 * tmp1
    tmp25 = tmp24 * tmp1
    tmp26 = tmp25 * tmp1
    tmp27 = tmp3 + tmp26
    tmp28 = tmp2 - tmp27
    tmp29 = 0.0
    tmp30 = triton_helpers.maximum(tmp28, tmp29)
    tl.store(out_ptr0 + x2, tmp30, xmask)


@triton.jit
def triton_poi_fused_add_div_where_12(in_out_ptr0, in_ptr0, in_ptr1,
    in_ptr2, xnumel, XBLOCK: tl.constexpr):
    xnumel = 64
    xoffset = tl.program_id(0) * XBLOCK
    xindex = xoffset + tl.arange(0, XBLOCK)[:]
    xmask = xindex < xnumel
    x0 = xindex
    tmp0 = tl.load(in_ptr0 + 4 * x0, xmask, eviction_policy='evict_last')
    tmp3 = tl.load(in_ptr0 + (1 + 4 * x0), xmask, eviction_policy='evict_last')
    tmp6 = tl.load(in_ptr0 + (2 + 4 * x0), xmask, eviction_policy='evict_last')
    tmp9 = tl.load(in_ptr0 + (3 + 4 * x0), xmask, eviction_policy='evict_last')
    tmp14 = tl.load(in_ptr1 + x0, xmask)
    tmp19 = tl.load(in_out_ptr0 + x0, xmask)
    tmp20 = tl.load(in_ptr2 + x0, xmask)
    tmp1 = 2.0
    tmp2 = libdevice.pow(tmp0, tmp1)
    tmp4 = libdevice.pow(tmp3, tmp1)
    tmp5 = tmp2 + tmp4
    tmp7 = libdevice.pow(tmp6, tmp1)
    tmp8 = tmp5 + tmp7
    tmp10 = libdevice.pow(tmp9, tmp1)
    tmp11 = tmp8 + tmp10
    tmp12 = 1.0
    tmp13 = tmp11 - tmp12
    tmp15 = tmp14 - tmp12
    tmp16 = tmp13 * tmp15
    tmp17 = 0.0
    tmp18 = tmp16 >= tmp17
    tmp21 = 0.5
    tmp22 = tmp20 * tmp21
    tmp23 = tmp22 * tmp21
    tmp24 = tmp23 * tmp21
    tmp25 = tmp24 * tmp21
    tmp26 = tmp25 * tmp21
    tmp27 = tmp26 * tmp21
    tmp28 = tmp27 * tmp21
    tmp29 = tmp28 * tmp21
    tmp30 = tmp29 * tmp21
    tmp31 = tmp30 * tmp21
    tmp32 = tmp31 * tmp21
    tmp33 = tmp32 * tmp21
    tmp34 = tmp33 * tmp21
    tmp35 = tmp34 * tmp21
    tmp36 = tmp35 * tmp21
    tmp37 = tmp36 * tmp21
    tmp38 = tmp37 * tmp21
    tmp39 = tmp38 * tmp21
    tmp40 = tmp39 * tmp21
    tmp41 = tmp40 * tmp21
    tmp42 = tmp41 * tmp21
    tmp43 = tmp42 * tmp21
    tmp44 = tmp19 + tmp43
    tmp45 = tl.where(tmp18, tmp44, tmp19)
    tl.store(in_out_ptr0 + x0, tmp45, xmask)


@triton.jit
def triton_poi_fused_add_clamp_div_mul_sub_13(in_ptr0, in_ptr1, in_ptr2,
    out_ptr0, xnumel, XBLOCK: tl.constexpr):
    xnumel = 256
    xoffset = tl.program_id(0) * XBLOCK
    xindex = xoffset + tl.arange(0, XBLOCK)[:]
    xmask = xindex < xnumel
    x2 = xindex
    x1 = xindex // 4
    tmp0 = tl.load(in_ptr0 + x2, xmask)
    tmp3 = tl.load(in_ptr1 + x1, xmask, eviction_policy='evict_last')
    tmp4 = tl.load(in_ptr2 + x1, xmask, eviction_policy='evict_last')
    tmp1 = 0.5
    tmp2 = tmp0 * tmp1
    tmp5 = tmp4 * tmp1
    tmp6 = tmp5 * tmp1
    tmp7 = tmp6 * tmp1
    tmp8 = tmp7 * tmp1
    tmp9 = tmp8 * tmp1
    tmp10 = tmp9 * tmp1
    tmp11 = tmp10 * tmp1
    tmp12 = tmp11 * tmp1
    tmp13 = tmp12 * tmp1
    tmp14 = tmp13 * tmp1
    tmp15 = tmp14 * tmp1
    tmp16 = tmp15 * tmp1
    tmp17 = tmp16 * tmp1
    tmp18 = tmp17 * tmp1
    tmp19 = tmp18 * tmp1
    tmp20 = tmp19 * tmp1
    tmp21 = tmp20 * tmp1
    tmp22 = tmp21 * tmp1
    tmp23 = tmp22 * tmp1
    tmp24 = tmp23 * tmp1
    tmp25 = tmp24 * tmp1
    tmp26 = tmp25 * tmp1
    tmp27 = tmp26 * tmp1
    tmp28 = tmp3 + tmp27
    tmp29 = tmp2 - tmp28
    tmp30 = 0.0
    tmp31 = triton_helpers.maximum(tmp29, tmp30)
    tl.store(out_ptr0 + x2, tmp31, xmask)


@triton.jit
def triton_poi_fused_add_div_where_14(in_out_ptr0, in_ptr0, in_ptr1,
    in_ptr2, xnumel, XBLOCK: tl.constexpr):
    xnumel = 64
    xoffset = tl.program_id(0) * XBLOCK
    xindex = xoffset + tl.arange(0, XBLOCK)[:]
    xmask = xindex < xnumel
    x0 = xindex
    tmp0 = tl.load(in_ptr0 + 4 * x0, xmask, eviction_policy='evict_last')
    tmp3 = tl.load(in_ptr0 + (1 + 4 * x0), xmask, eviction_policy='evict_last')
    tmp6 = tl.load(in_ptr0 + (2 + 4 * x0), xmask, eviction_policy='evict_last')
    tmp9 = tl.load(in_ptr0 + (3 + 4 * x0), xmask, eviction_policy='evict_last')
    tmp14 = tl.load(in_ptr1 + x0, xmask)
    tmp19 = tl.load(in_out_ptr0 + x0, xmask)
    tmp20 = tl.load(in_ptr2 + x0, xmask)
    tmp1 = 2.0
    tmp2 = libdevice.pow(tmp0, tmp1)
    tmp4 = libdevice.pow(tmp3, tmp1)
    tmp5 = tmp2 + tmp4
    tmp7 = libdevice.pow(tmp6, tmp1)
    tmp8 = tmp5 + tmp7
    tmp10 = libdevice.pow(tmp9, tmp1)
    tmp11 = tmp8 + tmp10
    tmp12 = 1.0
    tmp13 = tmp11 - tmp12
    tmp15 = tmp14 - tmp12
    tmp16 = tmp13 * tmp15
    tmp17 = 0.0
    tmp18 = tmp16 >= tmp17
    tmp21 = 0.5
    tmp22 = tmp20 * tmp21
    tmp23 = tmp22 * tmp21
    tmp24 = tmp23 * tmp21
    tmp25 = tmp24 * tmp21
    tmp26 = tmp25 * tmp21
    tmp27 = tmp26 * tmp21
    tmp28 = tmp27 * tmp21
    tmp29 = tmp28 * tmp21
    tmp30 = tmp29 * tmp21
    tmp31 = tmp30 * tmp21
    tmp32 = tmp31 * tmp21
    tmp33 = tmp32 * tmp21
    tmp34 = tmp33 * tmp21
    tmp35 = tmp34 * tmp21
    tmp36 = tmp35 * tmp21
    tmp37 = tmp36 * tmp21
    tmp38 = tmp37 * tmp21
    tmp39 = tmp38 * tmp21
    tmp40 = tmp39 * tmp21
    tmp41 = tmp40 * tmp21
    tmp42 = tmp41 * tmp21
    tmp43 = tmp42 * tmp21
    tmp44 = tmp43 * tmp21
    tmp45 = tmp19 + tmp44
    tmp46 = tl.where(tmp18, tmp45, tmp19)
    tl.store(in_out_ptr0 + x0, tmp46, xmask)


@triton.jit
def triton_poi_fused_add_div_mul_sub_15(in_ptr0, in_ptr1, in_ptr2, out_ptr0,
    xnumel, XBLOCK: tl.constexpr):
    xnumel = 256
    xoffset = tl.program_id(0) * XBLOCK
    xindex = xoffset + tl.arange(0, XBLOCK)[:]
    xmask = xindex < xnumel
    x2 = xindex
    x1 = xindex // 4
    tmp0 = tl.load(in_ptr0 + x2, xmask)
    tmp3 = tl.load(in_ptr1 + x1, xmask, eviction_policy='evict_last')
    tmp4 = tl.load(in_ptr2 + x1, xmask, eviction_policy='evict_last')
    tmp1 = 0.5
    tmp2 = tmp0 * tmp1
    tmp5 = tmp4 * tmp1
    tmp6 = tmp5 * tmp1
    tmp7 = tmp6 * tmp1
    tmp8 = tmp7 * tmp1
    tmp9 = tmp8 * tmp1
    tmp10 = tmp9 * tmp1
    tmp11 = tmp10 * tmp1
    tmp12 = tmp11 * tmp1
    tmp13 = tmp12 * tmp1
    tmp14 = tmp13 * tmp1
    tmp15 = tmp14 * tmp1
    tmp16 = tmp15 * tmp1
    tmp17 = tmp16 * tmp1
    tmp18 = tmp17 * tmp1
    tmp19 = tmp18 * tmp1
    tmp20 = tmp19 * tmp1
    tmp21 = tmp20 * tmp1
    tmp22 = tmp21 * tmp1
    tmp23 = tmp22 * tmp1
    tmp24 = tmp23 * tmp1
    tmp25 = tmp24 * tmp1
    tmp26 = tmp25 * tmp1
    tmp27 = tmp26 * tmp1
    tmp28 = tmp27 * tmp1
    tmp29 = tmp3 + tmp28
    tmp30 = tmp2 - tmp29
    tl.store(out_ptr0 + x2, tmp30, xmask)


@triton.jit
def triton_poi_fused_add_div_where_16(in_out_ptr0, in_ptr0, in_ptr1,
    in_ptr2, xnumel, XBLOCK: tl.constexpr):
    xnumel = 64
    xoffset = tl.program_id(0) * XBLOCK
    xindex = xoffset + tl.arange(0, XBLOCK)[:]
    xmask = xindex < xnumel
    x0 = xindex
    tmp0 = tl.load(in_ptr0 + 4 * x0, xmask, eviction_policy='evict_last')
    tmp5 = tl.load(in_ptr0 + (1 + 4 * x0), xmask, eviction_policy='evict_last')
    tmp9 = tl.load(in_ptr0 + (2 + 4 * x0), xmask, eviction_policy='evict_last')
    tmp13 = tl.load(in_ptr0 + (3 + 4 * x0), xmask, eviction_policy='evict_last'
        )
    tmp19 = tl.load(in_ptr1 + x0, xmask)
    tmp23 = tl.load(in_out_ptr0 + x0, xmask)
    tmp24 = tl.load(in_ptr2 + x0, xmask)
    tmp1 = 0.0
    tmp2 = triton_helpers.maximum(tmp0, tmp1)
    tmp3 = 2.0
    tmp4 = libdevice.pow(tmp2, tmp3)
    tmp6 = triton_helpers.maximum(tmp5, tmp1)
    tmp7 = libdevice.pow(tmp6, tmp3)
    tmp8 = tmp4 + tmp7
    tmp10 = triton_helpers.maximum(tmp9, tmp1)
    tmp11 = libdevice.pow(tmp10, tmp3)
    tmp12 = tmp8 + tmp11
    tmp14 = triton_helpers.maximum(tmp13, tmp1)
    tmp15 = libdevice.pow(tmp14, tmp3)
    tmp16 = tmp12 + tmp15
    tmp17 = 1.0
    tmp18 = tmp16 - tmp17
    tmp20 = tmp19 - tmp17
    tmp21 = tmp18 * tmp20
    tmp22 = tmp21 >= tmp1
    tmp25 = 0.5
    tmp26 = tmp24 * tmp25
    tmp27 = tmp26 * tmp25
    tmp28 = tmp27 * tmp25
    tmp29 = tmp28 * tmp25
    tmp30 = tmp29 * tmp25
    tmp31 = tmp30 * tmp25
    tmp32 = tmp31 * tmp25
    tmp33 = tmp32 * tmp25
    tmp34 = tmp33 * tmp25
    tmp35 = tmp34 * tmp25
    tmp36 = tmp35 * tmp25
    tmp37 = tmp36 * tmp25
    tmp38 = tmp37 * tmp25
    tmp39 = tmp38 * tmp25
    tmp40 = tmp39 * tmp25
    tmp41 = tmp40 * tmp25
    tmp42 = tmp41 * tmp25
    tmp43 = tmp42 * tmp25
    tmp44 = tmp43 * tmp25
    tmp45 = tmp44 * tmp25
    tmp46 = tmp45 * tmp25
    tmp47 = tmp46 * tmp25
    tmp48 = tmp47 * tmp25
    tmp49 = tmp48 * tmp25
    tmp50 = tmp23 + tmp49
    tmp51 = tl.where(tmp22, tmp50, tmp23)
    tl.store(in_out_ptr0 + x0, tmp51, xmask)


@triton.jit
def triton_poi_fused_add_div_mul_sub_17(in_ptr0, in_ptr1, in_ptr2, out_ptr0,
    xnumel, XBLOCK: tl.constexpr):
    xnumel = 256
    xoffset = tl.program_id(0) * XBLOCK
    xindex = xoffset + tl.arange(0, XBLOCK)[:]
    xmask = xindex < xnumel
    x2 = xindex
    x1 = xindex // 4
    tmp0 = tl.load(in_ptr0 + x2, xmask)
    tmp3 = tl.load(in_ptr1 + x1, xmask, eviction_policy='evict_last')
    tmp4 = tl.load(in_ptr2 + x1, xmask, eviction_policy='evict_last')
    tmp1 = 0.5
    tmp2 = tmp0 * tmp1
    tmp5 = tmp4 * tmp1
    tmp6 = tmp5 * tmp1
    tmp7 = tmp6 * tmp1
    tmp8 = tmp7 * tmp1
    tmp9 = tmp8 * tmp1
    tmp10 = tmp9 * tmp1
    tmp11 = tmp10 * tmp1
    tmp12 = tmp11 * tmp1
    tmp13 = tmp12 * tmp1
    tmp14 = tmp13 * tmp1
    tmp15 = tmp14 * tmp1
    tmp16 = tmp15 * tmp1
    tmp17 = tmp16 * tmp1
    tmp18 = tmp17 * tmp1
    tmp19 = tmp18 * tmp1
    tmp20 = tmp19 * tmp1
    tmp21 = tmp20 * tmp1
    tmp22 = tmp21 * tmp1
    tmp23 = tmp22 * tmp1
    tmp24 = tmp23 * tmp1
    tmp25 = tmp24 * tmp1
    tmp26 = tmp25 * tmp1
    tmp27 = tmp26 * tmp1
    tmp28 = tmp27 * tmp1
    tmp29 = tmp28 * tmp1
    tmp30 = tmp3 + tmp29
    tmp31 = tmp2 - tmp30
    tl.store(out_ptr0 + x2, tmp31, xmask)


@triton.jit
def triton_poi_fused_add_div_where_18(in_out_ptr0, in_ptr0, in_ptr1,
    in_ptr2, xnumel, XBLOCK: tl.constexpr):
    xnumel = 64
    xoffset = tl.program_id(0) * XBLOCK
    xindex = xoffset + tl.arange(0, XBLOCK)[:]
    xmask = xindex < xnumel
    x0 = xindex
    tmp0 = tl.load(in_ptr0 + 4 * x0, xmask, eviction_policy='evict_last')
    tmp5 = tl.load(in_ptr0 + (1 + 4 * x0), xmask, eviction_policy='evict_last')
    tmp9 = tl.load(in_ptr0 + (2 + 4 * x0), xmask, eviction_policy='evict_last')
    tmp13 = tl.load(in_ptr0 + (3 + 4 * x0), xmask, eviction_policy='evict_last'
        )
    tmp19 = tl.load(in_ptr1 + x0, xmask)
    tmp23 = tl.load(in_out_ptr0 + x0, xmask)
    tmp24 = tl.load(in_ptr2 + x0, xmask)
    tmp1 = 0.0
    tmp2 = triton_helpers.maximum(tmp0, tmp1)
    tmp3 = 2.0
    tmp4 = libdevice.pow(tmp2, tmp3)
    tmp6 = triton_helpers.maximum(tmp5, tmp1)
    tmp7 = libdevice.pow(tmp6, tmp3)
    tmp8 = tmp4 + tmp7
    tmp10 = triton_helpers.maximum(tmp9, tmp1)
    tmp11 = libdevice.pow(tmp10, tmp3)
    tmp12 = tmp8 + tmp11
    tmp14 = triton_helpers.maximum(tmp13, tmp1)
    tmp15 = libdevice.pow(tmp14, tmp3)
    tmp16 = tmp12 + tmp15
    tmp17 = 1.0
    tmp18 = tmp16 - tmp17
    tmp20 = tmp19 - tmp17
    tmp21 = tmp18 * tmp20
    tmp22 = tmp21 >= tmp1
    tmp25 = 0.5
    tmp26 = tmp24 * tmp25
    tmp27 = tmp26 * tmp25
    tmp28 = tmp27 * tmp25
    tmp29 = tmp28 * tmp25
    tmp30 = tmp29 * tmp25
    tmp31 = tmp30 * tmp25
    tmp32 = tmp31 * tmp25
    tmp33 = tmp32 * tmp25
    tmp34 = tmp33 * tmp25
    tmp35 = tmp34 * tmp25
    tmp36 = tmp35 * tmp25
    tmp37 = tmp36 * tmp25
    tmp38 = tmp37 * tmp25
    tmp39 = tmp38 * tmp25
    tmp40 = tmp39 * tmp25
    tmp41 = tmp40 * tmp25
    tmp42 = tmp41 * tmp25
    tmp43 = tmp42 * tmp25
    tmp44 = tmp43 * tmp25
    tmp45 = tmp44 * tmp25
    tmp46 = tmp45 * tmp25
    tmp47 = tmp46 * tmp25
    tmp48 = tmp47 * tmp25
    tmp49 = tmp48 * tmp25
    tmp50 = tmp49 * tmp25
    tmp51 = tmp23 + tmp50
    tmp52 = tl.where(tmp22, tmp51, tmp23)
    tl.store(in_out_ptr0 + x0, tmp52, xmask)


@triton.jit
def triton_poi_fused_add_div_mul_sub_19(in_ptr0, in_ptr1, in_ptr2, out_ptr0,
    xnumel, XBLOCK: tl.constexpr):
    xnumel = 256
    xoffset = tl.program_id(0) * XBLOCK
    xindex = xoffset + tl.arange(0, XBLOCK)[:]
    xmask = xindex < xnumel
    x2 = xindex
    x1 = xindex // 4
    tmp0 = tl.load(in_ptr0 + x2, xmask)
    tmp3 = tl.load(in_ptr1 + x1, xmask, eviction_policy='evict_last')
    tmp4 = tl.load(in_ptr2 + x1, xmask, eviction_policy='evict_last')
    tmp1 = 0.5
    tmp2 = tmp0 * tmp1
    tmp5 = tmp4 * tmp1
    tmp6 = tmp5 * tmp1
    tmp7 = tmp6 * tmp1
    tmp8 = tmp7 * tmp1
    tmp9 = tmp8 * tmp1
    tmp10 = tmp9 * tmp1
    tmp11 = tmp10 * tmp1
    tmp12 = tmp11 * tmp1
    tmp13 = tmp12 * tmp1
    tmp14 = tmp13 * tmp1
    tmp15 = tmp14 * tmp1
    tmp16 = tmp15 * tmp1
    tmp17 = tmp16 * tmp1
    tmp18 = tmp17 * tmp1
    tmp19 = tmp18 * tmp1
    tmp20 = tmp19 * tmp1
    tmp21 = tmp20 * tmp1
    tmp22 = tmp21 * tmp1
    tmp23 = tmp22 * tmp1
    tmp24 = tmp23 * tmp1
    tmp25 = tmp24 * tmp1
    tmp26 = tmp25 * tmp1
    tmp27 = tmp26 * tmp1
    tmp28 = tmp27 * tmp1
    tmp29 = tmp28 * tmp1
    tmp30 = tmp29 * tmp1
    tmp31 = tmp3 + tmp30
    tmp32 = tmp2 - tmp31
    tl.store(out_ptr0 + x2, tmp32, xmask)


@triton.jit
def triton_poi_fused_add_clamp_div_mul_pow_sub_sum_where_20(in_out_ptr0,
    in_out_ptr2, in_ptr0, in_ptr1, in_ptr2, in_ptr3, out_ptr3, out_ptr5,
    xnumel, XBLOCK: tl.constexpr):
    xnumel = 64
    xoffset = tl.program_id(0) * XBLOCK
    xindex = xoffset + tl.arange(0, XBLOCK)[:]
    xmask = xindex < xnumel
    x0 = xindex
    tmp0 = tl.load(in_ptr0 + 4 * x0, xmask, eviction_policy='evict_last')
    tmp5 = tl.load(in_ptr0 + (1 + 4 * x0), xmask, eviction_policy='evict_last')
    tmp9 = tl.load(in_ptr0 + (2 + 4 * x0), xmask, eviction_policy='evict_last')
    tmp13 = tl.load(in_ptr0 + (3 + 4 * x0), xmask, eviction_policy='evict_last'
        )
    tmp19 = tl.load(in_ptr1 + x0, xmask)
    tmp23 = tl.load(in_out_ptr0 + x0, xmask)
    tmp24 = tl.load(in_ptr2 + x0, xmask)
    tmp56 = tl.load(in_ptr3 + 4 * x0, xmask, eviction_policy='evict_last')
    tmp61 = tl.load(in_ptr3 + (1 + 4 * x0), xmask, eviction_policy='evict_last'
        )
    tmp67 = tl.load(in_ptr3 + (2 + 4 * x0), xmask, eviction_policy='evict_last'
        )
    tmp73 = tl.load(in_ptr3 + (3 + 4 * x0), xmask, eviction_policy='evict_last'
        )
    tmp1 = 0.0
    tmp2 = triton_helpers.maximum(tmp0, tmp1)
    tmp3 = 2.0
    tmp4 = libdevice.pow(tmp2, tmp3)
    tmp6 = triton_helpers.maximum(tmp5, tmp1)
    tmp7 = libdevice.pow(tmp6, tmp3)
    tmp8 = tmp4 + tmp7
    tmp10 = triton_helpers.maximum(tmp9, tmp1)
    tmp11 = libdevice.pow(tmp10, tmp3)
    tmp12 = tmp8 + tmp11
    tmp14 = triton_helpers.maximum(tmp13, tmp1)
    tmp15 = libdevice.pow(tmp14, tmp3)
    tmp16 = tmp12 + tmp15
    tmp17 = 1.0
    tmp18 = tmp16 - tmp17
    tmp20 = tmp19 - tmp17
    tmp21 = tmp18 * tmp20
    tmp22 = tmp21 >= tmp1
    tmp25 = 0.5
    tmp26 = tmp24 * tmp25
    tmp27 = tmp26 * tmp25
    tmp28 = tmp27 * tmp25
    tmp29 = tmp28 * tmp25
    tmp30 = tmp29 * tmp25
    tmp31 = tmp30 * tmp25
    tmp32 = tmp31 * tmp25
    tmp33 = tmp32 * tmp25
    tmp34 = tmp33 * tmp25
    tmp35 = tmp34 * tmp25
    tmp36 = tmp35 * tmp25
    tmp37 = tmp36 * tmp25
    tmp38 = tmp37 * tmp25
    tmp39 = tmp38 * tmp25
    tmp40 = tmp39 * tmp25
    tmp41 = tmp40 * tmp25
    tmp42 = tmp41 * tmp25
    tmp43 = tmp42 * tmp25
    tmp44 = tmp43 * tmp25
    tmp45 = tmp44 * tmp25
    tmp46 = tmp45 * tmp25
    tmp47 = tmp46 * tmp25
    tmp48 = tmp47 * tmp25
    tmp49 = tmp48 * tmp25
    tmp50 = tmp49 * tmp25
    tmp51 = tmp50 * tmp25
    tmp52 = tmp23 + tmp51
    tmp53 = tl.where(tmp22, tmp52, tmp23)
    tmp54 = tmp51 * tmp25
    tmp55 = tmp53 + tmp54
    tmp57 = tmp56 * tmp25
    tmp58 = tmp57 - tmp55
    tmp59 = triton_helpers.maximum(tmp58, tmp1)
    tmp60 = libdevice.pow(tmp59, tmp3)
    tmp62 = tmp61 * tmp25
    tmp63 = tmp62 - tmp55
    tmp64 = triton_helpers.maximum(tmp63, tmp1)
    tmp65 = libdevice.pow(tmp64, tmp3)
    tmp66 = tmp60 + tmp65
    tmp68 = tmp67 * tmp25
    tmp69 = tmp68 - tmp55
    tmp70 = triton_helpers.maximum(tmp69, tmp1)
    tmp71 = libdevice.pow(tmp70, tmp3)
    tmp72 = tmp66 + tmp71
    tmp74 = tmp73 * tmp25
    tmp75 = tmp74 - tmp55
    tmp76 = triton_helpers.maximum(tmp75, tmp1)
    tmp77 = libdevice.pow(tmp76, tmp3)
    tmp78 = tmp72 + tmp77
    tmp79 = tmp78 - tmp17
    tmp80 = tmp79 * tmp20
    tmp81 = tmp80 >= tmp1
    tmp82 = tl.where(tmp81, tmp55, tmp53)
    tmp83 = tmp54 * tmp25
    tmp84 = tmp82 + tmp83
    tmp85 = tmp57 - tmp84
    tmp86 = triton_helpers.maximum(tmp85, tmp1)
    tmp87 = libdevice.pow(tmp86, tmp3)
    tmp88 = tmp62 - tmp84
    tmp89 = triton_helpers.maximum(tmp88, tmp1)
    tmp90 = libdevice.pow(tmp89, tmp3)
    tmp91 = tmp87 + tmp90
    tmp92 = tmp68 - tmp84
    tmp93 = triton_helpers.maximum(tmp92, tmp1)
    tmp94 = libdevice.pow(tmp93, tmp3)
    tmp95 = tmp91 + tmp94
    tmp96 = tmp74 - tmp84
    tmp97 = triton_helpers.maximum(tmp96, tmp1)
    tmp98 = libdevice.pow(tmp97, tmp3)
    tmp99 = tmp95 + tmp98
    tmp100 = tmp99 - tmp17
    tmp101 = tmp100 * tmp20
    tmp102 = tmp101 >= tmp1
    tmp103 = tl.where(tmp102, tmp84, tmp82)
    tmp104 = tmp83 * tmp25
    tmp105 = tmp103 + tmp104
    tmp106 = tmp57 - tmp105
    tmp107 = triton_helpers.maximum(tmp106, tmp1)
    tmp108 = libdevice.pow(tmp107, tmp3)
    tmp109 = tmp62 - tmp105
    tmp110 = triton_helpers.maximum(tmp109, tmp1)
    tmp111 = libdevice.pow(tmp110, tmp3)
    tmp112 = tmp108 + tmp111
    tmp113 = tmp68 - tmp105
    tmp114 = triton_helpers.maximum(tmp113, tmp1)
    tmp115 = libdevice.pow(tmp114, tmp3)
    tmp116 = tmp112 + tmp115
    tmp117 = tmp74 - tmp105
    tmp118 = triton_helpers.maximum(tmp117, tmp1)
    tmp119 = libdevice.pow(tmp118, tmp3)
    tmp120 = tmp116 + tmp119
    tmp121 = tmp120 - tmp17
    tmp122 = tmp121 * tmp20
    tmp123 = tmp122 >= tmp1
    tmp124 = tl.where(tmp123, tmp105, tmp103)
    tmp125 = tmp104 * tmp25
    tmp126 = tmp124 + tmp125
    tmp127 = tmp57 - tmp126
    tmp128 = triton_helpers.maximum(tmp127, tmp1)
    tmp129 = libdevice.pow(tmp128, tmp3)
    tmp130 = tmp62 - tmp126
    tmp131 = triton_helpers.maximum(tmp130, tmp1)
    tmp132 = libdevice.pow(tmp131, tmp3)
    tmp133 = tmp129 + tmp132
    tmp134 = tmp68 - tmp126
    tmp135 = triton_helpers.maximum(tmp134, tmp1)
    tmp136 = libdevice.pow(tmp135, tmp3)
    tmp137 = tmp133 + tmp136
    tmp138 = tmp74 - tmp126
    tmp139 = triton_helpers.maximum(tmp138, tmp1)
    tmp140 = libdevice.pow(tmp139, tmp3)
    tmp141 = tmp137 + tmp140
    tmp142 = tmp141 - tmp17
    tmp143 = tmp142 * tmp20
    tmp144 = tmp143 >= tmp1
    tmp145 = tl.where(tmp144, tmp126, tmp124)
    tmp146 = tmp125 * tmp25
    tmp147 = tmp145 + tmp146
    tmp148 = tmp57 - tmp147
    tmp149 = triton_helpers.maximum(tmp148, tmp1)
    tmp150 = libdevice.pow(tmp149, tmp3)
    tmp151 = tmp62 - tmp147
    tmp152 = triton_helpers.maximum(tmp151, tmp1)
    tmp153 = libdevice.pow(tmp152, tmp3)
    tmp154 = tmp150 + tmp153
    tmp155 = tmp68 - tmp147
    tmp156 = triton_helpers.maximum(tmp155, tmp1)
    tmp157 = libdevice.pow(tmp156, tmp3)
    tmp158 = tmp154 + tmp157
    tmp159 = tmp74 - tmp147
    tmp160 = triton_helpers.maximum(tmp159, tmp1)
    tmp161 = libdevice.pow(tmp160, tmp3)
    tmp162 = tmp158 + tmp161
    tl.store(out_ptr3 + x0, tmp104, xmask)
    tl.store(in_out_ptr2 + x0, tmp145, xmask)
    tl.store(out_ptr5 + x0, tmp162, xmask)


@triton.jit
def triton_poi_fused_add_clamp_div_mul_pow_sub_where_21(in_ptr0, in_ptr1,
    in_ptr2, in_ptr3, in_ptr4, out_ptr0, xnumel, XBLOCK: tl.constexpr):
    xnumel = 256
    xoffset = tl.program_id(0) * XBLOCK
    xindex = xoffset + tl.arange(0, XBLOCK)[:]
    xmask = xindex < xnumel
    x2 = xindex
    x1 = xindex // 4
    tmp0 = tl.load(in_ptr0 + x2, xmask)
    tmp3 = tl.load(in_ptr1 + x1, xmask, eviction_policy='evict_last')
    tmp6 = tl.load(in_ptr2 + x1, xmask, eviction_policy='evict_last')
    tmp11 = tl.load(in_ptr3 + x1, xmask, eviction_policy='evict_last')
    tmp12 = tl.load(in_ptr4 + x1, xmask, eviction_policy='evict_last')
    tmp1 = 0.5
    tmp2 = tmp0 * tmp1
    tmp4 = 1.0
    tmp5 = tmp3 - tmp4
    tmp7 = tmp6 - tmp4
    tmp8 = tmp5 * tmp7
    tmp9 = 0.0
    tmp10 = tmp8 >= tmp9
    tmp13 = tmp12 * tmp1
    tmp14 = tmp13 * tmp1
    tmp15 = tmp11 + tmp14
    tmp16 = tl.where(tmp10, tmp15, tmp11)
    tmp17 = tmp14 * tmp1
    tmp18 = tmp16 + tmp17
    tmp19 = tmp2 - tmp18
    tmp20 = triton_helpers.maximum(tmp19, tmp9)
    tmp21 = 2.0
    tmp22 = libdevice.pow(tmp20, tmp21)
    tl.store(out_ptr0 + x2, tmp22, xmask)


@triton.jit
def triton_poi_fused_div_22(in_ptr0, out_ptr0, xnumel, XBLOCK: tl.constexpr):
    xnumel = 256
    xoffset = tl.program_id(0) * XBLOCK
    xindex = xoffset + tl.arange(0, XBLOCK)[:]
    xmask = xindex < xnumel
    x2 = xindex
    x1 = xindex // 4
    tmp0 = tl.load(in_ptr0 + x2, xmask)
    tmp1 = tl.load(in_ptr0 + 4 * x1, xmask, eviction_policy='evict_last')
    tmp2 = tl.load(in_ptr0 + (1 + 4 * x1), xmask, eviction_policy='evict_last')
    tmp4 = tl.load(in_ptr0 + (2 + 4 * x1), xmask, eviction_policy='evict_last')
    tmp6 = tl.load(in_ptr0 + (3 + 4 * x1), xmask, eviction_policy='evict_last')
    tmp3 = tmp1 + tmp2
    tmp5 = tmp3 + tmp4
    tmp7 = tmp5 + tmp6
    tmp8 = tmp0 / tmp7
    tl.store(out_ptr0 + x2, tmp8, xmask)


def call(args):
    arg0_1, = args
    args.clear()
    assert_size_stride(arg0_1, (4, 4, 4, 4), (64, 16, 4, 1))
    with torch.cuda._DeviceGuard(0):
        torch.cuda.set_device(0)
        buf1 = empty_strided_cuda((4, 4, 4), (16, 4, 1), torch.float32)
        buf43 = empty_strided_cuda((4, 4, 4, 1), (16, 4, 1, 64), torch.float32)
        buf57 = empty_strided_cuda((4, 4, 4), (16, 4, 1), torch.float32)
        buf58 = reinterpret_tensor(buf57, (4, 4, 4, 1), (16, 4, 1, 64), 0)
        del buf57
        buf59 = empty_strided_cuda((4, 4, 4), (16, 4, 1), torch.float32)
        get_raw_stream(0)
        triton_poi_fused_add_clamp_div_max_mul_pow_sub_sum_where_0[grid(64)](
            buf58, arg0_1, buf1, buf43, buf59, 64, XBLOCK=64, num_warps=1,
            num_stages=1)
        buf60 = empty_strided_cuda((4, 4, 4, 4), (64, 16, 4, 1), torch.float32)
        triton_poi_fused_add_clamp_div_mul_pow_sub_where_1[grid(256)](arg0_1,
            buf59, buf1, buf58, buf43, buf60, 256, XBLOCK=128, num_warps=4,
            num_stages=1)
        buf61 = buf58
        del buf58
        buf62 = empty_strided_cuda((4, 4, 4), (16, 4, 1), torch.float32)
        triton_poi_fused_add_clamp_div_mul_pow_sub_sum_where_2[grid(64)](buf61,
            buf60, buf1, buf59, buf43, arg0_1, buf62, 64, XBLOCK=64,
            num_warps=1, num_stages=1)
        buf63 = buf60
        del buf60
        triton_poi_fused_add_clamp_div_mul_sub_where_3[grid(256)](arg0_1,
            buf62, buf1, buf61, buf43, buf63, 256, XBLOCK=256, num_warps=4,
            num_stages=1)
        buf64 = buf61
        del buf61
        buf65 = buf59
        del buf59
        triton_poi_fused_add_clamp_div_mul_pow_sub_sum_where_4[grid(64)](buf64,
            buf63, buf1, buf62, buf43, arg0_1, buf65, 64, XBLOCK=64,
            num_warps=1, num_stages=1)
        buf66 = buf63
        del buf63
        triton_poi_fused_add_div_mul_sub_where_5[grid(256)](arg0_1, buf65,
            buf1, buf64, buf43, buf66, 256, XBLOCK=256, num_warps=4,
            num_stages=1)
        buf67 = buf64
        del buf64
        buf74 = buf62
        del buf62
        buf75 = reinterpret_tensor(buf74, (4, 4, 4, 1), (16, 4, 1, 64), 0)
        del buf74
        triton_poi_fused_add_clamp_div_mul_pow_sub_sum_where_6[grid(64)](buf67,
            buf75, buf66, buf1, buf65, buf43, arg0_1, 64, XBLOCK=64,
            num_warps=1, num_stages=1)
        buf76 = buf66
        del buf66
        triton_poi_fused_add_clamp_div_mul_pow_sub_7[grid(256)](arg0_1,
            buf75, buf43, buf76, 256, XBLOCK=256, num_warps=4, num_stages=1)
        buf77 = buf75
        del buf75
        triton_poi_fused_add_div_where_8[grid(64)](buf77, buf76, buf1,
            buf43, 64, XBLOCK=64, num_warps=1, num_stages=1)
        buf78 = buf76
        del buf76
        triton_poi_fused_add_clamp_div_mul_pow_sub_9[grid(256)](arg0_1,
            buf77, buf43, buf78, 256, XBLOCK=256, num_warps=4, num_stages=1)
        buf79 = buf77
        del buf77
        triton_poi_fused_add_div_where_10[grid(64)](buf79, buf78, buf1,
            buf43, 64, XBLOCK=64, num_warps=1, num_stages=1)
        buf80 = buf78
        del buf78
        triton_poi_fused_add_clamp_div_mul_sub_11[grid(256)](arg0_1, buf79,
            buf43, buf80, 256, XBLOCK=256, num_warps=4, num_stages=1)
        buf81 = buf79
        del buf79
        triton_poi_fused_add_div_where_12[grid(64)](buf81, buf80, buf1,
            buf43, 64, XBLOCK=64, num_warps=1, num_stages=1)
        buf82 = buf80
        del buf80
        triton_poi_fused_add_clamp_div_mul_sub_13[grid(256)](arg0_1, buf81,
            buf43, buf82, 256, XBLOCK=256, num_warps=4, num_stages=1)
        buf83 = buf81
        del buf81
        triton_poi_fused_add_div_where_14[grid(64)](buf83, buf82, buf1,
            buf43, 64, XBLOCK=64, num_warps=1, num_stages=1)
        buf84 = buf82
        del buf82
        triton_poi_fused_add_div_mul_sub_15[grid(256)](arg0_1, buf83, buf43,
            buf84, 256, XBLOCK=256, num_warps=4, num_stages=1)
        buf85 = buf83
        del buf83
        triton_poi_fused_add_div_where_16[grid(64)](buf85, buf84, buf1,
            buf43, 64, XBLOCK=64, num_warps=1, num_stages=1)
        buf86 = buf84
        del buf84
        triton_poi_fused_add_div_mul_sub_17[grid(256)](arg0_1, buf85, buf43,
            buf86, 256, XBLOCK=256, num_warps=4, num_stages=1)
        buf87 = buf85
        del buf85
        triton_poi_fused_add_div_where_18[grid(64)](buf87, buf86, buf1,
            buf43, 64, XBLOCK=64, num_warps=1, num_stages=1)
        buf88 = buf86
        del buf86
        triton_poi_fused_add_div_mul_sub_19[grid(256)](arg0_1, buf87, buf43,
            buf88, 256, XBLOCK=256, num_warps=4, num_stages=1)
        buf89 = buf87
        del buf87
        buf95 = buf67
        del buf67
        buf97 = buf65
        del buf65
        buf98 = reinterpret_tensor(buf97, (4, 4, 4, 1), (16, 4, 1, 64), 0)
        del buf97
        buf99 = empty_strided_cuda((4, 4, 4), (16, 4, 1), torch.float32)
        triton_poi_fused_add_clamp_div_mul_pow_sub_sum_where_20[grid(64)](buf89
            , buf98, buf88, buf1, buf43, arg0_1, buf95, buf99, 64, XBLOCK=
            64, num_warps=1, num_stages=1)
        del buf43
        del buf89
        buf100 = buf88
        del buf88
        triton_poi_fused_add_clamp_div_mul_pow_sub_where_21[grid(256)](arg0_1,
            buf99, buf1, buf98, buf95, buf100, 256, XBLOCK=256, num_warps=4,
            num_stages=1)
        del arg0_1
        del buf1
        del buf95
        del buf98
        del buf99
        buf101 = empty_strided_cuda((4, 4, 4, 4), (64, 16, 4, 1), torch.float32
            )
        triton_poi_fused_div_22[grid(256)](buf100, buf101, 256, XBLOCK=128,
            num_warps=4, num_stages=1)
        del buf100
    return buf101,


def entmax_bisect(X, alpha=1.5, dim=-1, n_iter=50, ensure_sum_one=True):
    """alpha-entmax: normalizing sparse transform (a la softmax).

    Solves the optimization problem:

        max_p <x, p> - H_a(p)    s.t.    p >= 0, sum(p) == 1.

    where H_a(p) is the Tsallis alpha-entropy with custom alpha >= 1,
    using a bisection (root finding, binary search) algorithm.

    This function is differentiable with respect to both X and alpha.

    Parameters
    ----------
    X : torch.Tensor
        The input tensor.

    alpha : float or torch.Tensor
        Tensor of alpha parameters (> 1) to use. If scalar
        or python float, the same value is used for all rows, otherwise,
        it must have shape (or be expandable to)
        alpha.shape[j] == (X.shape[j] if j != dim else 1)
        A value of alpha=2 corresponds to sparsemax, and alpha=1 would in theory recover
        softmax. For numeric reasons, this algorithm does not work with `alpha=1`: if you
        want softmax, we recommend `torch.nn.softmax`.

    dim : int
        The dimension along which to apply alpha-entmax.

    n_iter : int
        Number of bisection iterations. For float32, 24 iterations should
        suffice for machine precision.

    ensure_sum_one : bool,
        Whether to divide the result by its sum. If false, the result might
        sum to close but not exactly 1, which might cause downstream problems.

    Returns
    -------
    P : torch tensor, same shape as X
        The projection result, such that P.sum(dim=dim) == 1 elementwise.
    """
    return EntmaxBisectFunction.apply(X, alpha, dim, n_iter, ensure_sum_one)


class EntmaxBisectFunction(Function):

    @classmethod
    def _gp(cls, x, alpha):
        return x ** (alpha - 1)

    @classmethod
    def _gp_inv(cls, y, alpha):
        return y ** (1 / (alpha - 1))

    @classmethod
    def _p(cls, X, alpha):
        return cls._gp_inv(torch.clamp(X, min=0), alpha)

    @classmethod
    def forward(cls, ctx, X, alpha=1.5, dim=-1, n_iter=50, ensure_sum_one=True
        ):
        if not isinstance(alpha, torch.Tensor):
            alpha = torch.tensor(alpha, dtype=X.dtype, device=X.device)
        alpha_shape = list(X.shape)
        alpha_shape[dim] = 1
        alpha = alpha.expand(*alpha_shape)
        ctx.alpha = alpha
        ctx.dim = dim
        d = X.shape[dim]
        max_val, _ = X.max(dim=dim, keepdim=True)
        X = X * (alpha - 1)
        max_val = max_val * (alpha - 1)
        tau_lo = max_val - cls._gp(1, alpha)
        tau_hi = max_val - cls._gp(1 / d, alpha)
        f_lo = cls._p(X - tau_lo, alpha).sum(dim) - 1
        dm = tau_hi - tau_lo
        for it in range(n_iter):
            dm /= 2
            tau_m = tau_lo + dm
            p_m = cls._p(X - tau_m, alpha)
            f_m = p_m.sum(dim) - 1
            mask = (f_m * f_lo >= 0).unsqueeze(dim)
            tau_lo = torch.where(mask, tau_m, tau_lo)
        if ensure_sum_one:
            p_m /= p_m.sum(dim=dim).unsqueeze(dim=dim)
        ctx.save_for_backward(p_m)
        return p_m

    @classmethod
    def backward(cls, ctx, dY):
        Y, = ctx.saved_tensors
        gppr = torch.where(Y > 0, Y ** (2 - ctx.alpha), Y.new_zeros(1))
        dX = dY * gppr
        q = dX.sum(ctx.dim) / gppr.sum(ctx.dim)
        q = q.unsqueeze(ctx.dim)
        dX -= q * gppr
        d_alpha = None
        if ctx.needs_input_grad[1]:
            S = torch.where(Y > 0, Y * torch.log(Y), Y.new_zeros(1))
            ent = S.sum(ctx.dim).unsqueeze(ctx.dim)
            Y_skewed = gppr / gppr.sum(ctx.dim).unsqueeze(ctx.dim)
            d_alpha = dY * (Y - Y_skewed) / (ctx.alpha - 1) ** 2
            d_alpha -= dY * (S - Y_skewed * ent) / (ctx.alpha - 1)
            d_alpha = d_alpha.sum(ctx.dim).unsqueeze(ctx.dim)
        return dX, d_alpha, None, None, None


class EntmaxBisectNew(nn.Module):

    def __init__(self, alpha=1.5, dim=-1, n_iter=50):
        """alpha-entmax: normalizing sparse map (a la softmax) via bisection.

        Solves the optimization problem:

            max_p <x, p> - H_a(p)    s.t.    p >= 0, sum(p) == 1.

        where H_a(p) is the Tsallis alpha-entropy with custom alpha >= 1,
        using a bisection (root finding, binary search) algorithm.

        Parameters
        ----------
        alpha : float or torch.Tensor
            Tensor of alpha parameters (> 1) to use. If scalar
            or python float, the same value is used for all rows, otherwise,
            it must have shape (or be expandable to)
            alpha.shape[j] == (X.shape[j] if j != dim else 1)
            A value of alpha=2 corresponds to sparsemax; and alpha=1 would in theory recover
            softmax. For numeric reasons, this algorithm does not work with `alpha=1`; if you
            want softmax, we recommend `torch.nn.softmax`.

        dim : int
            The dimension along which to apply alpha-entmax.

        n_iter : int
            Number of bisection iterations. For float32, 24 iterations should
            suffice for machine precision.

        """
        self.dim = dim
        self.n_iter = n_iter
        self.alpha = alpha
        super().__init__()

    def forward(self, input_0):
        arg0_1 = input_0
        output = call([arg0_1])
        return output[0]


Measured latency_ms: 0.318208