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


@triton.jit
def triton_poi_fused_add_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 = tmp24 * tmp1
    tmp26 = tmp11 + tmp25
    tmp27 = tl.where(tmp10, tmp26, tmp11)
    tmp28 = tmp25 * tmp1
    tmp29 = tmp27 + tmp28
    tmp30 = tmp2 - tmp29
    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')
    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)
    tmp48 = tl.load(in_ptr4 + 4 * x0, xmask, eviction_policy='evict_last')
    tmp55 = tl.load(in_ptr4 + (1 + 4 * x0), xmask, eviction_policy='evict_last'
        )
    tmp61 = tl.load(in_ptr4 + (2 + 4 * x0), xmask, eviction_policy='evict_last'
        )
    tmp67 = 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 = tmp27 + tmp42
    tmp44 = tl.where(tmp26, tmp43, tmp27)
    tmp45 = tmp42 * tmp29
    tmp46 = tmp44 + tmp45
    tmp47 = tl.where(tmp22, tmp46, tmp44)
    tmp49 = tmp48 * tmp29
    tmp50 = tmp45 * tmp29
    tmp51 = tmp47 + tmp50
    tmp52 = tmp49 - tmp51
    tmp53 = triton_helpers.maximum(tmp52, tmp1)
    tmp54 = libdevice.pow(tmp53, tmp3)
    tmp56 = tmp55 * tmp29
    tmp57 = tmp56 - tmp51
    tmp58 = triton_helpers.maximum(tmp57, tmp1)
    tmp59 = libdevice.pow(tmp58, tmp3)
    tmp60 = tmp54 + tmp59
    tmp62 = tmp61 * tmp29
    tmp63 = tmp62 - tmp51
    tmp64 = triton_helpers.maximum(tmp63, tmp1)
    tmp65 = libdevice.pow(tmp64, tmp3)
    tmp66 = tmp60 + tmp65
    tmp68 = tmp67 * tmp29
    tmp69 = tmp68 - tmp51
    tmp70 = triton_helpers.maximum(tmp69, tmp1)
    tmp71 = libdevice.pow(tmp70, tmp3)
    tmp72 = tmp66 + tmp71
    tl.store(in_out_ptr0 + x0, tmp47, xmask)
    tl.store(out_ptr0 + x0, tmp72, 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 = tmp26 * tmp1
    tmp28 = tmp11 + tmp27
    tmp29 = tl.where(tmp10, tmp28, tmp11)
    tmp30 = tmp27 * tmp1
    tmp31 = tmp29 + 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_6(in_out_ptr0,
    in_out_ptr2, 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)
    tmp50 = tl.load(in_ptr4 + 4 * x0, xmask, eviction_policy='evict_last')
    tmp57 = tl.load(in_ptr4 + (1 + 4 * x0), xmask, eviction_policy='evict_last'
        )
    tmp63 = tl.load(in_ptr4 + (2 + 4 * x0), xmask, eviction_policy='evict_last'
        )
    tmp69 = 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 = tmp43 * tmp29
    tmp45 = tmp27 + tmp44
    tmp46 = tl.where(tmp26, tmp45, tmp27)
    tmp47 = tmp44 * tmp29
    tmp48 = tmp46 + tmp47
    tmp49 = tl.where(tmp22, tmp48, tmp46)
    tmp51 = tmp50 * tmp29
    tmp52 = tmp47 * tmp29
    tmp53 = tmp49 + tmp52
    tmp54 = tmp51 - tmp53
    tmp55 = triton_helpers.maximum(tmp54, tmp1)
    tmp56 = libdevice.pow(tmp55, tmp3)
    tmp58 = tmp57 * tmp29
    tmp59 = tmp58 - tmp53
    tmp60 = triton_helpers.maximum(tmp59, tmp1)
    tmp61 = libdevice.pow(tmp60, tmp3)
    tmp62 = tmp56 + tmp61
    tmp64 = tmp63 * tmp29
    tmp65 = tmp64 - tmp53
    tmp66 = triton_helpers.maximum(tmp65, tmp1)
    tmp67 = libdevice.pow(tmp66, tmp3)
    tmp68 = tmp62 + tmp67
    tmp70 = tmp69 * tmp29
    tmp71 = tmp70 - tmp53
    tmp72 = triton_helpers.maximum(tmp71, tmp1)
    tmp73 = libdevice.pow(tmp72, tmp3)
    tmp74 = tmp68 + tmp73
    tmp75 = tmp74 - tmp17
    tmp76 = tmp75 * tmp20
    tmp77 = tmp76 >= tmp1
    tmp78 = tl.where(tmp77, tmp53, tmp49)
    tmp79 = tmp52 * tmp29
    tmp80 = tmp78 + tmp79
    tmp81 = tmp51 - tmp80
    tmp82 = triton_helpers.maximum(tmp81, tmp1)
    tmp83 = libdevice.pow(tmp82, tmp3)
    tmp84 = tmp58 - tmp80
    tmp85 = triton_helpers.maximum(tmp84, tmp1)
    tmp86 = libdevice.pow(tmp85, tmp3)
    tmp87 = tmp83 + tmp86
    tmp88 = tmp64 - tmp80
    tmp89 = triton_helpers.maximum(tmp88, tmp1)
    tmp90 = libdevice.pow(tmp89, tmp3)
    tmp91 = tmp87 + tmp90
    tmp92 = tmp70 - tmp80
    tmp93 = triton_helpers.maximum(tmp92, tmp1)
    tmp94 = libdevice.pow(tmp93, tmp3)
    tmp95 = tmp91 + tmp94
    tmp96 = tmp95 - tmp17
    tmp97 = tmp96 * tmp20
    tmp98 = tmp97 >= tmp1
    tmp99 = tl.where(tmp98, tmp80, tmp78)
    tmp100 = tmp79 * tmp29
    tmp101 = tmp99 + tmp100
    tmp102 = tmp51 - tmp101
    tmp103 = triton_helpers.maximum(tmp102, tmp1)
    tmp104 = libdevice.pow(tmp103, tmp3)
    tmp105 = tmp58 - tmp101
    tmp106 = triton_helpers.maximum(tmp105, tmp1)
    tmp107 = libdevice.pow(tmp106, tmp3)
    tmp108 = tmp104 + tmp107
    tmp109 = tmp64 - tmp101
    tmp110 = triton_helpers.maximum(tmp109, tmp1)
    tmp111 = libdevice.pow(tmp110, tmp3)
    tmp112 = tmp108 + tmp111
    tmp113 = tmp70 - tmp101
    tmp114 = triton_helpers.maximum(tmp113, tmp1)
    tmp115 = libdevice.pow(tmp114, tmp3)
    tmp116 = tmp112 + tmp115
    tmp117 = tmp116 - tmp17
    tmp118 = tmp117 * tmp20
    tmp119 = tmp118 >= tmp1
    tmp120 = tl.where(tmp119, tmp101, tmp99)
    tl.store(in_out_ptr2 + x0, tmp120, 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_ptr4, in_ptr0, in_ptr1, in_ptr2, in_ptr3, out_ptr7, 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
    tmp163 = tmp162 - tmp17
    tmp164 = tmp163 * tmp20
    tmp165 = tmp164 >= tmp1
    tmp166 = tl.where(tmp165, tmp147, tmp145)
    tmp167 = tmp146 * tmp25
    tmp168 = tmp166 + tmp167
    tmp169 = tmp57 - tmp168
    tmp170 = triton_helpers.maximum(tmp169, tmp1)
    tmp171 = libdevice.pow(tmp170, tmp3)
    tmp172 = tmp62 - tmp168
    tmp173 = triton_helpers.maximum(tmp172, tmp1)
    tmp174 = libdevice.pow(tmp173, tmp3)
    tmp175 = tmp171 + tmp174
    tmp176 = tmp68 - tmp168
    tmp177 = triton_helpers.maximum(tmp176, tmp1)
    tmp178 = libdevice.pow(tmp177, tmp3)
    tmp179 = tmp175 + tmp178
    tmp180 = tmp74 - tmp168
    tmp181 = triton_helpers.maximum(tmp180, tmp1)
    tmp182 = libdevice.pow(tmp181, tmp3)
    tmp183 = tmp179 + tmp182
    tmp184 = tmp183 - tmp17
    tmp185 = tmp184 * tmp20
    tmp186 = tmp185 >= tmp1
    tmp187 = tl.where(tmp186, tmp168, tmp166)
    tmp188 = tmp167 * tmp25
    tmp189 = tmp187 + tmp188
    tmp190 = tmp57 - tmp189
    tmp191 = triton_helpers.maximum(tmp190, tmp1)
    tmp192 = libdevice.pow(tmp191, tmp3)
    tmp193 = tmp62 - tmp189
    tmp194 = triton_helpers.maximum(tmp193, tmp1)
    tmp195 = libdevice.pow(tmp194, tmp3)
    tmp196 = tmp192 + tmp195
    tmp197 = tmp68 - tmp189
    tmp198 = triton_helpers.maximum(tmp197, tmp1)
    tmp199 = libdevice.pow(tmp198, tmp3)
    tmp200 = tmp196 + tmp199
    tmp201 = tmp74 - tmp189
    tmp202 = triton_helpers.maximum(tmp201, tmp1)
    tmp203 = libdevice.pow(tmp202, tmp3)
    tmp204 = tmp200 + tmp203
    tmp205 = tmp204 - tmp17
    tmp206 = tmp205 * tmp20
    tmp207 = tmp206 >= tmp1
    tmp208 = tl.where(tmp207, tmp189, tmp187)
    tmp209 = tmp188 * tmp25
    tmp210 = tmp208 + tmp209
    tmp211 = tmp57 - tmp210
    tmp212 = triton_helpers.maximum(tmp211, tmp1)
    tmp213 = libdevice.pow(tmp212, tmp3)
    tmp214 = tmp62 - tmp210
    tmp215 = triton_helpers.maximum(tmp214, tmp1)
    tmp216 = libdevice.pow(tmp215, tmp3)
    tmp217 = tmp213 + tmp216
    tmp218 = tmp68 - tmp210
    tmp219 = triton_helpers.maximum(tmp218, tmp1)
    tmp220 = libdevice.pow(tmp219, tmp3)
    tmp221 = tmp217 + tmp220
    tmp222 = tmp74 - tmp210
    tmp223 = triton_helpers.maximum(tmp222, tmp1)
    tmp224 = libdevice.pow(tmp223, tmp3)
    tmp225 = tmp221 + tmp224
    tmp226 = tmp225 - tmp17
    tmp227 = tmp226 * tmp20
    tmp228 = tmp227 >= tmp1
    tmp229 = tl.where(tmp228, tmp210, tmp208)
    tmp230 = tmp209 * tmp25
    tmp231 = tmp229 + tmp230
    tmp232 = tmp57 - tmp231
    tmp233 = triton_helpers.maximum(tmp232, tmp1)
    tmp234 = libdevice.pow(tmp233, tmp3)
    tmp235 = tmp62 - tmp231
    tmp236 = triton_helpers.maximum(tmp235, tmp1)
    tmp237 = libdevice.pow(tmp236, tmp3)
    tmp238 = tmp234 + tmp237
    tmp239 = tmp68 - tmp231
    tmp240 = triton_helpers.maximum(tmp239, tmp1)
    tmp241 = libdevice.pow(tmp240, tmp3)
    tmp242 = tmp238 + tmp241
    tmp243 = tmp74 - tmp231
    tmp244 = triton_helpers.maximum(tmp243, tmp1)
    tmp245 = libdevice.pow(tmp244, tmp3)
    tmp246 = tmp242 + tmp245
    tl.store(in_out_ptr4 + x0, tmp231, xmask)
    tl.store(out_ptr7 + x0, tmp246, xmask)


@triton.jit
def triton_poi_fused_add_clamp_div_mul_pow_sub_where_21(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')
    tmp9 = tl.load(in_ptr2 + x1, xmask, eviction_policy='evict_last')
    tmp1 = 0.5
    tmp2 = tmp0 * tmp1
    tmp4 = tmp2 - tmp3
    tmp5 = 0.0
    tmp6 = triton_helpers.maximum(tmp4, tmp5)
    tmp7 = 2.0
    tmp8 = libdevice.pow(tmp6, tmp7)
    tmp10 = tmp8 / tmp9
    tl.store(out_ptr0 + x2, tmp10, 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)
        buf35 = empty_strided_cuda((4, 4, 4, 1), (16, 4, 1, 64), torch.float32)
        buf51 = empty_strided_cuda((4, 4, 4), (16, 4, 1), torch.float32)
        buf52 = reinterpret_tensor(buf51, (4, 4, 4, 1), (16, 4, 1, 64), 0)
        del buf51
        buf53 = 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)](
            buf52, arg0_1, buf1, buf35, buf53, 64, XBLOCK=64, num_warps=1,
            num_stages=1)
        buf54 = 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,
            buf53, buf1, buf52, buf35, buf54, 256, XBLOCK=128, num_warps=4,
            num_stages=1)
        buf55 = buf52
        del buf52
        buf56 = 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)](buf55,
            buf54, buf1, buf53, buf35, arg0_1, buf56, 64, XBLOCK=64,
            num_warps=1, num_stages=1)
        buf57 = buf54
        del buf54
        triton_poi_fused_add_div_mul_sub_where_3[grid(256)](arg0_1, buf56,
            buf1, buf55, buf35, buf57, 256, XBLOCK=256, num_warps=4,
            num_stages=1)
        buf58 = buf55
        del buf55
        buf59 = buf53
        del buf53
        triton_poi_fused_add_clamp_div_mul_pow_sub_sum_where_4[grid(64)](buf58,
            buf57, buf1, buf56, buf35, arg0_1, buf59, 64, XBLOCK=64,
            num_warps=1, num_stages=1)
        buf60 = buf57
        del buf57
        triton_poi_fused_add_div_mul_sub_where_5[grid(256)](arg0_1, buf59,
            buf1, buf58, buf35, buf60, 256, XBLOCK=128, num_warps=4,
            num_stages=1)
        buf61 = buf58
        del buf58
        buf66 = buf56
        del buf56
        buf67 = reinterpret_tensor(buf66, (4, 4, 4, 1), (16, 4, 1, 64), 0)
        del buf66
        triton_poi_fused_add_clamp_div_mul_pow_sub_sum_where_6[grid(64)](buf61,
            buf67, buf60, buf1, buf59, buf35, arg0_1, 64, XBLOCK=64,
            num_warps=1, num_stages=1)
        buf68 = buf60
        del buf60
        triton_poi_fused_add_clamp_div_mul_pow_sub_7[grid(256)](arg0_1,
            buf67, buf35, buf68, 256, XBLOCK=128, num_warps=4, num_stages=1)
        buf69 = buf67
        del buf67
        triton_poi_fused_add_div_where_8[grid(64)](buf69, buf68, buf1,
            buf35, 64, XBLOCK=64, num_warps=1, num_stages=1)
        buf70 = buf68
        del buf68
        triton_poi_fused_add_clamp_div_mul_pow_sub_9[grid(256)](arg0_1,
            buf69, buf35, buf70, 256, XBLOCK=128, num_warps=4, num_stages=1)
        buf71 = buf69
        del buf69
        triton_poi_fused_add_div_where_10[grid(64)](buf71, buf70, buf1,
            buf35, 64, XBLOCK=64, num_warps=1, num_stages=1)
        buf72 = buf70
        del buf70
        triton_poi_fused_add_clamp_div_mul_sub_11[grid(256)](arg0_1, buf71,
            buf35, buf72, 256, XBLOCK=256, num_warps=4, num_stages=1)
        buf73 = buf71
        del buf71
        triton_poi_fused_add_div_where_12[grid(64)](buf73, buf72, buf1,
            buf35, 64, XBLOCK=64, num_warps=1, num_stages=1)
        buf74 = buf72
        del buf72
        triton_poi_fused_add_clamp_div_mul_sub_13[grid(256)](arg0_1, buf73,
            buf35, buf74, 256, XBLOCK=256, num_warps=4, num_stages=1)
        buf75 = buf73
        del buf73
        triton_poi_fused_add_div_where_14[grid(64)](buf75, buf74, buf1,
            buf35, 64, XBLOCK=64, num_warps=1, num_stages=1)
        buf76 = buf74
        del buf74
        triton_poi_fused_add_div_mul_sub_15[grid(256)](arg0_1, buf75, buf35,
            buf76, 256, XBLOCK=256, num_warps=4, num_stages=1)
        buf77 = buf75
        del buf75
        triton_poi_fused_add_div_where_16[grid(64)](buf77, buf76, buf1,
            buf35, 64, XBLOCK=64, num_warps=1, num_stages=1)
        buf78 = buf76
        del buf76
        triton_poi_fused_add_div_mul_sub_17[grid(256)](arg0_1, buf77, buf35,
            buf78, 256, XBLOCK=256, num_warps=4, num_stages=1)
        buf79 = buf77
        del buf77
        triton_poi_fused_add_div_where_18[grid(64)](buf79, buf78, buf1,
            buf35, 64, XBLOCK=64, num_warps=1, num_stages=1)
        buf80 = buf78
        del buf78
        triton_poi_fused_add_div_mul_sub_19[grid(256)](arg0_1, buf79, buf35,
            buf80, 256, XBLOCK=256, num_warps=4, num_stages=1)
        buf81 = buf79
        del buf79
        buf95 = reinterpret_tensor(buf61, (4, 4, 4), (16, 4, 1), 0)
        del buf61
        buf96 = reinterpret_tensor(buf95, (4, 4, 4, 1), (16, 4, 1, 64), 0)
        del buf95
        buf97 = buf59
        del buf59
        triton_poi_fused_add_clamp_div_mul_pow_sub_sum_where_20[grid(64)](buf81
            , buf96, buf80, buf1, buf35, arg0_1, buf97, 64, XBLOCK=64,
            num_warps=1, num_stages=1)
        del buf1
        del buf35
        del buf81
        buf98 = buf80
        del buf80
        triton_poi_fused_add_clamp_div_mul_pow_sub_where_21[grid(256)](arg0_1,
            buf96, buf97, buf98, 256, XBLOCK=128, num_warps=4, num_stages=1)
        del arg0_1
        del buf96
        del buf97
    return buf98,


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 corresponds to
        softmax (but computing it this way is likely unstable).

    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]
        X = X * (alpha - 1)
        max_val, _ = X.max(dim=dim, keepdim=True)
        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; alpha=1 corresponds
            to softmax (but computing it this way is likely unstable).

        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.315475