import torch
from torch._inductor.select_algorithm import extern_kernels
import triton
import triton.language as tl
from torch._inductor.runtime.triton_heuristics import grid
from torch._C import _cuda_getCurrentRawStream as get_raw_stream
from torch._inductor.runtime import triton_helpers
import torch.nn as nn
import torch.nn.functional as F
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_constant_pad_nd_replication_pad2d_0(in_ptr0, out_ptr0,
    xnumel, XBLOCK: tl.constexpr):
    xnumel = 504
    xoffset = tl.program_id(0) * XBLOCK
    xindex = xoffset + tl.arange(0, XBLOCK)[:]
    xmask = xindex < xnumel
    x1 = xindex // 6 % 7
    x0 = xindex % 6
    x2 = xindex // 42
    x3 = xindex
    tmp0 = -1 + (4 * (4 <= 0 * (0 >= -1 + x1) + (-1 + x1) * (-1 + x1 > 0)) +
        (0 * (0 >= -1 + x1) + (-1 + x1) * (-1 + x1 > 0)) * (0 * (0 >= -1 +
        x1) + (-1 + x1) * (-1 + x1 > 0) < 4))
    tmp1 = tl.full([1], 0, tl.int64)
    tmp2 = tmp0 >= tmp1
    tmp3 = tl.load(in_ptr0 + (-4 + 4 * (4 * (4 <= 0 * (0 >= -1 + x1) + (-1 +
        x1) * (-1 + x1 > 0)) + (0 * (0 >= -1 + x1) + (-1 + x1) * (-1 + x1 >
        0)) * (0 * (0 >= -1 + x1) + (-1 + x1) * (-1 + x1 > 0) < 4)) + 16 *
        x2 + (3 * (3 <= 0 * (0 >= -1 + x0) + (-1 + x0) * (-1 + x0 > 0)) + (
        0 * (0 >= -1 + x0) + (-1 + x0) * (-1 + x0 > 0)) * (0 * (0 >= -1 +
        x0) + (-1 + x0) * (-1 + x0 > 0) < 3))), tmp2 & xmask,
        eviction_policy='evict_last', other=0.0)
    tl.store(out_ptr0 + x3, tmp3, xmask)


@triton.jit
def triton_poi_fused_constant_pad_nd_1(in_ptr0, out_ptr0, xnumel, XBLOCK:
    tl.constexpr):
    xnumel = 3840
    xoffset = tl.program_id(0) * XBLOCK
    xindex = xoffset + tl.arange(0, XBLOCK)[:]
    xmask = xindex < xnumel
    x1 = xindex // 4 % 5
    x3 = xindex
    tmp0 = -1 + x1
    tmp1 = tl.full([1], 0, tl.int64)
    tmp2 = tmp0 >= tmp1
    tmp3 = tl.load(in_ptr0 + (-4 + x3), tmp2 & xmask, other=0.0)
    tmp4 = 0.0
    tmp5 = tmp3 > tmp4
    tmp6 = 0.1
    tmp7 = tmp3 * tmp6
    tmp8 = tl.where(tmp5, tmp3, tmp7)
    tmp9 = tl.full(tmp8.shape, 0.0, tmp8.dtype)
    tmp10 = tl.where(tmp2, tmp8, tmp9)
    tl.store(out_ptr0 + x3, tmp10, xmask)


@triton.jit
def triton_poi_fused_replication_pad2d_2(in_ptr0, out_ptr0, xnumel, XBLOCK:
    tl.constexpr):
    xnumel = 8064
    xoffset = tl.program_id(0) * XBLOCK
    xindex = xoffset + tl.arange(0, XBLOCK)[:]
    xmask = xindex < xnumel
    x0 = xindex % 6
    x1 = xindex // 6 % 7
    x2 = xindex // 42
    x3 = xindex
    tmp0 = tl.load(in_ptr0 + (4 * (4 * (4 <= 0 * (0 >= -1 + x1) + (-1 + x1) *
        (-1 + x1 > 0)) + (0 * (0 >= -1 + x1) + (-1 + x1) * (-1 + x1 > 0)) *
        (0 * (0 >= -1 + x1) + (-1 + x1) * (-1 + x1 > 0) < 4)) + 20 * x2 + (
        3 * (3 <= 0 * (0 >= -1 + x0) + (-1 + x0) * (-1 + x0 > 0)) + (0 * (0 >=
        -1 + x0) + (-1 + x0) * (-1 + x0 > 0)) * (0 * (0 >= -1 + x0) + (-1 +
        x0) * (-1 + x0 > 0) < 3))), xmask, eviction_policy='evict_last')
    tl.store(out_ptr0 + x3, tmp0, xmask)


@triton.jit
def triton_poi_fused_max_pool2d_with_indices_3(in_ptr0, out_ptr0, xnumel,
    XBLOCK: tl.constexpr):
    xnumel = 768
    xoffset = tl.program_id(0) * XBLOCK
    xindex = xoffset + tl.arange(0, XBLOCK)[:]
    xmask = xindex < xnumel
    x0 = xindex % 2
    x1 = xindex // 2 % 2
    x2 = xindex // 4
    x3 = xindex
    tmp0 = tl.load(in_ptr0 + (2 * x0 + 8 * x1 + 20 * x2), xmask,
        eviction_policy='evict_last')
    tmp1 = tl.load(in_ptr0 + (1 + 2 * x0 + 8 * x1 + 20 * x2), xmask,
        eviction_policy='evict_last')
    tmp7 = tl.load(in_ptr0 + (4 + 2 * x0 + 8 * x1 + 20 * x2), xmask,
        eviction_policy='evict_last')
    tmp12 = tl.load(in_ptr0 + (5 + 2 * x0 + 8 * x1 + 20 * x2), xmask,
        eviction_policy='evict_last')
    tmp2 = tmp1 > tmp0
    tmp3 = tl.full([1], 1, tl.int8)
    tmp4 = tl.full([1], 0, tl.int8)
    tmp5 = tl.where(tmp2, tmp3, tmp4)
    tmp6 = triton_helpers.maximum(tmp1, tmp0)
    tmp8 = tmp7 > tmp6
    tmp9 = tl.full([1], 2, tl.int8)
    tmp10 = tl.where(tmp8, tmp9, tmp5)
    tmp11 = triton_helpers.maximum(tmp7, tmp6)
    tmp13 = tmp12 > tmp11
    tmp14 = tl.full([1], 3, tl.int8)
    tmp15 = tl.where(tmp13, tmp14, tmp10)
    triton_helpers.maximum(tmp12, tmp11)
    tl.store(out_ptr0 + x3, tmp15, xmask)


@triton.jit
def triton_poi_fused_constant_pad_nd_max_pool2d_with_indices_4(in_ptr0,
    out_ptr0, xnumel, XBLOCK: tl.constexpr):
    xnumel = 1152
    xoffset = tl.program_id(0) * XBLOCK
    xindex = xoffset + tl.arange(0, XBLOCK)[:]
    xmask = xindex < xnumel
    x1 = xindex // 2 % 3
    x0 = xindex % 2
    x2 = xindex // 6
    x3 = xindex
    tmp0 = -1 + x1
    tmp1 = tl.full([1], 0, tl.int64)
    tmp2 = tmp0 >= tmp1
    tmp3 = tl.load(in_ptr0 + (-8 + 2 * x0 + 8 * x1 + 20 * x2), tmp2 & xmask,
        eviction_policy='evict_last', other=0.0)
    tmp4 = tl.load(in_ptr0 + (-7 + 2 * x0 + 8 * x1 + 20 * x2), tmp2 & xmask,
        eviction_policy='evict_last', other=0.0)
    tmp5 = triton_helpers.maximum(tmp4, tmp3)
    tmp6 = tl.load(in_ptr0 + (-4 + 2 * x0 + 8 * x1 + 20 * x2), tmp2 & xmask,
        eviction_policy='evict_last', other=0.0)
    tmp7 = triton_helpers.maximum(tmp6, tmp5)
    tmp8 = tl.load(in_ptr0 + (-3 + 2 * x0 + 8 * x1 + 20 * x2), tmp2 & xmask,
        eviction_policy='evict_last', other=0.0)
    tmp9 = triton_helpers.maximum(tmp8, tmp7)
    tmp10 = tl.full(tmp9.shape, 0.0, tmp9.dtype)
    tmp11 = tl.where(tmp2, tmp9, tmp10)
    tl.store(out_ptr0 + x3, tmp11, xmask)


@triton.jit
def triton_poi_fused_replication_pad2d_5(in_ptr0, out_ptr0, xnumel, XBLOCK:
    tl.constexpr):
    xnumel = 3840
    xoffset = tl.program_id(0) * XBLOCK
    xindex = xoffset + tl.arange(0, XBLOCK)[:]
    xmask = xindex < xnumel
    x0 = xindex % 4
    x1 = xindex // 4 % 5
    x2 = xindex // 20
    x3 = xindex
    tmp0 = tl.load(in_ptr0 + (2 * (2 * (2 <= 0 * (0 >= -1 + x1) + (-1 + x1) *
        (-1 + x1 > 0)) + (0 * (0 >= -1 + x1) + (-1 + x1) * (-1 + x1 > 0)) *
        (0 * (0 >= -1 + x1) + (-1 + x1) * (-1 + x1 > 0) < 2)) + 6 * x2 + (1 *
        (1 <= 0 * (0 >= -1 + x0) + (-1 + x0) * (-1 + x0 > 0)) + (0 * (0 >= 
        -1 + x0) + (-1 + x0) * (-1 + x0 > 0)) * (0 * (0 >= -1 + x0) + (-1 +
        x0) * (-1 + x0 > 0) < 1))), xmask, eviction_policy='evict_last')
    tl.store(out_ptr0 + x3, tmp0, xmask)


@triton.jit
def triton_poi_fused_constant_pad_nd_6(in_ptr0, out_ptr0, xnumel, XBLOCK:
    tl.constexpr):
    xnumel = 1152
    xoffset = tl.program_id(0) * XBLOCK
    xindex = xoffset + tl.arange(0, XBLOCK)[:]
    xmask = xindex < xnumel
    x1 = xindex // 2 % 3
    x3 = xindex
    tmp0 = -1 + x1
    tmp1 = tl.full([1], 0, tl.int64)
    tmp2 = tmp0 >= tmp1
    tmp3 = tl.load(in_ptr0 + (-2 + x3), tmp2 & xmask, other=0.0)
    tmp4 = 0.0
    tmp5 = tmp3 > tmp4
    tmp6 = 0.1
    tmp7 = tmp3 * tmp6
    tmp8 = tl.where(tmp5, tmp3, tmp7)
    tmp9 = tl.full(tmp8.shape, 0.0, tmp8.dtype)
    tmp10 = tl.where(tmp2, tmp8, tmp9)
    tl.store(out_ptr0 + x3, tmp10, xmask)


@triton.jit
def triton_poi_fused_max_pool2d_with_indices_7(in_ptr0, out_ptr0, xnumel,
    XBLOCK: tl.constexpr):
    xnumel = 192
    xoffset = tl.program_id(0) * XBLOCK
    xindex = xoffset + tl.arange(0, XBLOCK)[:]
    xmask = xindex < xnumel
    x0 = xindex
    tmp0 = tl.load(in_ptr0 + 6 * x0, xmask, eviction_policy='evict_last')
    tmp1 = tl.load(in_ptr0 + (1 + 6 * x0), xmask, eviction_policy='evict_last')
    tmp7 = tl.load(in_ptr0 + (2 + 6 * x0), xmask, eviction_policy='evict_last')
    tmp12 = tl.load(in_ptr0 + (3 + 6 * x0), xmask, eviction_policy='evict_last'
        )
    tmp2 = tmp1 > tmp0
    tmp3 = tl.full([1], 1, tl.int8)
    tmp4 = tl.full([1], 0, tl.int8)
    tmp5 = tl.where(tmp2, tmp3, tmp4)
    tmp6 = triton_helpers.maximum(tmp1, tmp0)
    tmp8 = tmp7 > tmp6
    tmp9 = tl.full([1], 2, tl.int8)
    tmp10 = tl.where(tmp8, tmp9, tmp5)
    tmp11 = triton_helpers.maximum(tmp7, tmp6)
    tmp13 = tmp12 > tmp11
    tmp14 = tl.full([1], 3, tl.int8)
    tmp15 = tl.where(tmp13, tmp14, tmp10)
    triton_helpers.maximum(tmp12, tmp11)
    tl.store(out_ptr0 + x0, tmp15, xmask)


@triton.jit
def triton_poi_fused_constant_pad_nd_max_pool2d_with_indices_8(in_ptr0,
    out_ptr0, xnumel, XBLOCK: tl.constexpr):
    xnumel = 384
    xoffset = tl.program_id(0) * XBLOCK
    xindex = xoffset + tl.arange(0, XBLOCK)[:]
    xmask = xindex < xnumel
    x0 = xindex % 2
    x1 = xindex // 2
    x2 = xindex
    tmp0 = -1 + x0
    tmp1 = tl.full([1], 0, tl.int64)
    tmp2 = tmp0 >= tmp1
    tmp3 = tl.load(in_ptr0 + (-4 + 4 * x0 + 6 * x1), tmp2 & xmask,
        eviction_policy='evict_last', other=0.0)
    tmp4 = tl.load(in_ptr0 + (-3 + 4 * x0 + 6 * x1), tmp2 & xmask,
        eviction_policy='evict_last', other=0.0)
    tmp5 = triton_helpers.maximum(tmp4, tmp3)
    tmp6 = tl.load(in_ptr0 + (-2 + 4 * x0 + 6 * x1), tmp2 & xmask,
        eviction_policy='evict_last', other=0.0)
    tmp7 = triton_helpers.maximum(tmp6, tmp5)
    tmp8 = tl.load(in_ptr0 + (-1 + 4 * x0 + 6 * x1), tmp2 & xmask,
        eviction_policy='evict_last', other=0.0)
    tmp9 = triton_helpers.maximum(tmp8, tmp7)
    tmp10 = tl.full(tmp9.shape, 0.0, tmp9.dtype)
    tmp11 = tl.where(tmp2, tmp9, tmp10)
    tl.store(out_ptr0 + x2, tmp11, xmask)


@triton.jit
def triton_poi_fused_replication_pad2d_9(in_ptr0, out_ptr0, xnumel, XBLOCK:
    tl.constexpr):
    xnumel = 2304
    xoffset = tl.program_id(0) * XBLOCK
    xindex = xoffset + tl.arange(0, XBLOCK)[:]
    xmask = xindex < xnumel
    x1 = xindex // 3 % 4
    x2 = xindex // 12
    x3 = xindex
    tmp0 = tl.load(in_ptr0 + (2 * x2 + (1 * (1 <= 0 * (0 >= -1 + x1) + (-1 +
        x1) * (-1 + x1 > 0)) + (0 * (0 >= -1 + x1) + (-1 + x1) * (-1 + x1 >
        0)) * (0 * (0 >= -1 + x1) + (-1 + x1) * (-1 + x1 > 0) < 1))), xmask,
        eviction_policy='evict_last')
    tl.store(out_ptr0 + x3, tmp0, xmask)


@triton.jit
def triton_poi_fused_constant_pad_nd_10(in_ptr0, out_ptr0, xnumel, XBLOCK:
    tl.constexpr):
    xnumel = 768
    xoffset = tl.program_id(0) * XBLOCK
    xindex = xoffset + tl.arange(0, XBLOCK)[:]
    xmask = xindex < xnumel
    x0 = xindex % 2
    x2 = xindex
    tmp0 = -1 + x0
    tmp1 = tl.full([1], 0, tl.int64)
    tmp2 = tmp0 >= tmp1
    tmp3 = tl.load(in_ptr0 + (-1 + x2), tmp2 & xmask, other=0.0)
    tmp4 = 0.0
    tmp5 = tmp3 > tmp4
    tmp6 = 0.1
    tmp7 = tmp3 * tmp6
    tmp8 = tl.where(tmp5, tmp3, tmp7)
    tmp9 = tl.full(tmp8.shape, 0.0, tmp8.dtype)
    tmp10 = tl.where(tmp2, tmp8, tmp9)
    tl.store(out_ptr0 + x2, tmp10, xmask)


@triton.jit
def triton_poi_fused_replication_pad2d_11(in_ptr0, out_ptr0, xnumel, XBLOCK:
    tl.constexpr):
    xnumel = 4608
    xoffset = tl.program_id(0) * XBLOCK
    xindex = xoffset + tl.arange(0, XBLOCK)[:]
    xmask = xindex < xnumel
    x1 = xindex // 3 % 4
    x2 = xindex // 12
    x3 = xindex
    tmp0 = tl.load(in_ptr0 + (2 * x2 + (1 * (1 <= 0 * (0 >= -1 + x1) + (-1 +
        x1) * (-1 + x1 > 0)) + (0 * (0 >= -1 + x1) + (-1 + x1) * (-1 + x1 >
        0)) * (0 * (0 >= -1 + x1) + (-1 + x1) * (-1 + x1 > 0) < 1))), xmask,
        eviction_policy='evict_last')
    tl.store(out_ptr0 + x3, tmp0, xmask)


@triton.jit
def triton_poi_fused__to_copy_add_arange_mul_12(out_ptr0, xnumel, XBLOCK:
    tl.constexpr):
    xnumel = 2
    xoffset = tl.program_id(0) * XBLOCK
    xindex = xoffset + tl.arange(0, XBLOCK)[:]
    xmask = xindex < xnumel
    x0 = xindex
    tmp0 = x0
    tmp1 = tmp0.to(tl.float32)
    tmp2 = 0.5
    tmp3 = tmp1 * tmp2
    tmp4 = tmp3.to(tl.int32)
    tl.store(out_ptr0 + x0, tmp4, xmask)


@triton.jit
def triton_poi_fused_cat_constant_pad_nd_13(in_ptr0, in_ptr1, in_ptr2,
    out_ptr0, xnumel, XBLOCK: tl.constexpr):
    xnumel = 2304
    xoffset = tl.program_id(0) * XBLOCK
    xindex = xoffset + tl.arange(0, XBLOCK)[:]
    xmask = xindex < xnumel
    x1 = xindex // 2 % 3
    x2 = xindex // 6 % 96
    x0 = xindex % 2
    x3 = xindex // 576
    x6 = xindex
    tmp0 = -1 + x1
    tmp1 = tl.full([1], 0, tl.int64)
    tmp2 = tmp0 >= tmp1
    tmp3 = x2
    tmp5 = tl.full([1], 48, tl.int64)
    tmp6 = tmp3 < tmp5
    tmp7 = tmp6 & tmp2
    tmp8 = tl.load(in_ptr0 + (-1 + x1), tmp7 & xmask, eviction_policy=
        'evict_last', other=0.0)
    tmp9 = tl.full([XBLOCK], 1, tl.int32)
    tmp10 = tmp8 + tmp9
    tmp11 = tmp8 < 0
    tmp12 = tl.where(tmp11, tmp10, tmp8)
    tmp13 = tl.load(in_ptr0 + x0, tmp7 & xmask, eviction_policy=
        'evict_last', other=0.0)
    tmp14 = tmp13 + tmp9
    tmp15 = tmp13 < 0
    tl.where(tmp15, tmp14, tmp13)
    tmp17 = tl.load(in_ptr1 + (tmp12 + 2 * x2 + 96 * x3), tmp7 & xmask,
        eviction_policy='evict_last', other=0.0)
    tmp18 = 0.0
    tmp19 = tmp17 > tmp18
    tmp20 = 0.1
    tmp21 = tmp17 * tmp20
    tmp22 = tl.where(tmp19, tmp17, tmp21)
    tmp23 = tl.full(tmp22.shape, 0.0, tmp22.dtype)
    tmp24 = tl.where(tmp7, tmp22, tmp23)
    tmp25 = tmp3 >= tmp5
    tl.full([1], 96, tl.int64)
    tmp28 = tmp25 & tmp2
    tmp29 = tl.load(in_ptr2 + (-8 + 2 * x0 + 8 * x1 + 20 * (-48 + x2) + 960 *
        x3), tmp28 & xmask, eviction_policy='evict_last', other=0.0)
    tmp30 = tl.load(in_ptr2 + (-7 + 2 * x0 + 8 * x1 + 20 * (-48 + x2) + 960 *
        x3), tmp28 & xmask, eviction_policy='evict_last', other=0.0)
    tmp31 = triton_helpers.maximum(tmp30, tmp29)
    tmp32 = tl.load(in_ptr2 + (-4 + 2 * x0 + 8 * x1 + 20 * (-48 + x2) + 960 *
        x3), tmp28 & xmask, eviction_policy='evict_last', other=0.0)
    tmp33 = triton_helpers.maximum(tmp32, tmp31)
    tmp34 = tl.load(in_ptr2 + (-3 + 2 * x0 + 8 * x1 + 20 * (-48 + x2) + 960 *
        x3), tmp28 & xmask, eviction_policy='evict_last', other=0.0)
    tmp35 = triton_helpers.maximum(tmp34, tmp33)
    tmp36 = tl.full(tmp35.shape, 0.0, tmp35.dtype)
    tmp37 = tl.where(tmp28, tmp35, tmp36)
    tmp38 = tl.where(tmp6, tmp24, tmp37)
    tmp39 = tl.full(tmp38.shape, 0.0, tmp38.dtype)
    tmp40 = tl.where(tmp2, tmp38, tmp39)
    tl.store(out_ptr0 + x6, tmp40, xmask)


@triton.jit
def triton_poi_fused_replication_pad2d_14(in_ptr0, out_ptr0, xnumel, XBLOCK:
    tl.constexpr):
    xnumel = 7680
    xoffset = tl.program_id(0) * XBLOCK
    xindex = xoffset + tl.arange(0, XBLOCK)[:]
    xmask = xindex < xnumel
    x0 = xindex % 4
    x1 = xindex // 4 % 5
    x2 = xindex // 20
    x3 = xindex
    tmp0 = tl.load(in_ptr0 + (2 * (2 * (2 <= 0 * (0 >= -1 + x1) + (-1 + x1) *
        (-1 + x1 > 0)) + (0 * (0 >= -1 + x1) + (-1 + x1) * (-1 + x1 > 0)) *
        (0 * (0 >= -1 + x1) + (-1 + x1) * (-1 + x1 > 0) < 2)) + 6 * x2 + (1 *
        (1 <= 0 * (0 >= -1 + x0) + (-1 + x0) * (-1 + x0 > 0)) + (0 * (0 >= 
        -1 + x0) + (-1 + x0) * (-1 + x0 > 0)) * (0 * (0 >= -1 + x0) + (-1 +
        x0) * (-1 + x0 > 0) < 1))), xmask, eviction_policy='evict_last')
    tl.store(out_ptr0 + x3, tmp0, xmask)


@triton.jit
def triton_poi_fused_constant_pad_nd_15(in_ptr0, out_ptr0, xnumel, XBLOCK:
    tl.constexpr):
    xnumel = 2304
    xoffset = tl.program_id(0) * XBLOCK
    xindex = xoffset + tl.arange(0, XBLOCK)[:]
    xmask = xindex < xnumel
    x1 = xindex // 2 % 3
    x3 = xindex
    tmp0 = -1 + x1
    tmp1 = tl.full([1], 0, tl.int64)
    tmp2 = tmp0 >= tmp1
    tmp3 = tl.load(in_ptr0 + (-2 + x3), tmp2 & xmask, other=0.0)
    tmp4 = 0.0
    tmp5 = tmp3 > tmp4
    tmp6 = 0.1
    tmp7 = tmp3 * tmp6
    tmp8 = tl.where(tmp5, tmp3, tmp7)
    tmp9 = tl.full(tmp8.shape, 0.0, tmp8.dtype)
    tmp10 = tl.where(tmp2, tmp8, tmp9)
    tl.store(out_ptr0 + x3, tmp10, xmask)


@triton.jit
def triton_poi_fused__to_copy_add_arange_mul_16(out_ptr0, xnumel, XBLOCK:
    tl.constexpr):
    xnumel = 4
    xoffset = tl.program_id(0) * XBLOCK
    xindex = xoffset + tl.arange(0, XBLOCK)[:]
    xmask = xindex < xnumel
    x0 = xindex
    tmp0 = x0
    tmp1 = tmp0.to(tl.float32)
    tmp2 = 0.5
    tmp3 = tmp1 * tmp2
    tmp4 = tmp3.to(tl.int32)
    tl.store(out_ptr0 + x0, tmp4, xmask)


@triton.jit
def triton_poi_fused_cat_constant_pad_nd_17(in_ptr0, in_ptr1, in_ptr2,
    out_ptr0, xnumel, XBLOCK: tl.constexpr):
    xnumel = 7920
    xoffset = tl.program_id(0) * XBLOCK
    xindex = xoffset + tl.arange(0, XBLOCK)[:]
    xmask = xindex < xnumel
    x1 = xindex // 4 % 5
    x2 = xindex // 20 % 99
    x0 = xindex % 4
    x3 = xindex // 1980
    x5 = xindex % 20
    x6 = xindex
    tmp0 = -1 + x1
    tmp1 = tl.full([1], 0, tl.int64)
    tmp2 = tmp0 >= tmp1
    tmp3 = x2
    tmp5 = tl.full([1], 96, tl.int64)
    tmp6 = tmp3 < tmp5
    tmp7 = tmp6 & tmp2
    tmp8 = tl.load(in_ptr0 + (-1 + x1), tmp7 & xmask, eviction_policy=
        'evict_last', other=0.0)
    tmp9 = tl.full([XBLOCK], 2, tl.int32)
    tmp10 = tmp8 + tmp9
    tmp11 = tmp8 < 0
    tmp12 = tl.where(tmp11, tmp10, tmp8)
    tmp13 = tl.load(in_ptr0 + x0, tmp7 & xmask, eviction_policy=
        'evict_last', other=0.0)
    tmp14 = tmp13 + tmp9
    tmp15 = tmp13 < 0
    tmp16 = tl.where(tmp15, tmp14, tmp13)
    tmp17 = tl.load(in_ptr1 + (tmp16 + 2 * tmp12 + 6 * x2 + 576 * x3), tmp7 &
        xmask, eviction_policy='evict_last', other=0.0)
    tmp18 = 0.0
    tmp19 = tmp17 > tmp18
    tmp20 = 0.1
    tmp21 = tmp17 * tmp20
    tmp22 = tl.where(tmp19, tmp17, tmp21)
    tmp23 = tl.full(tmp22.shape, 0.0, tmp22.dtype)
    tmp24 = tl.where(tmp7, tmp22, tmp23)
    tmp25 = tmp3 >= tmp5
    tl.full([1], 99, tl.int64)
    tmp28 = tmp25 & tmp2
    tmp29 = tl.load(in_ptr2 + (-4 + x5 + 16 * (-96 + x2) + 48 * x3), tmp28 &
        xmask, other=0.0)
    tmp30 = tl.where(tmp6, tmp24, tmp29)
    tmp31 = tl.full(tmp30.shape, 0.0, tmp30.dtype)
    tmp32 = tl.where(tmp2, tmp30, tmp31)
    tl.store(out_ptr0 + x6, tmp32, xmask)


@triton.jit
def triton_poi_fused_replication_pad2d_18(in_ptr0, out_ptr0, xnumel, XBLOCK:
    tl.constexpr):
    xnumel = 16632
    xoffset = tl.program_id(0) * XBLOCK
    xindex = xoffset + tl.arange(0, XBLOCK)[:]
    xmask = xindex < xnumel
    x0 = xindex % 6
    x1 = xindex // 6 % 7
    x2 = xindex // 42
    x3 = xindex
    tmp0 = tl.load(in_ptr0 + (4 * (4 * (4 <= 0 * (0 >= -1 + x1) + (-1 + x1) *
        (-1 + x1 > 0)) + (0 * (0 >= -1 + x1) + (-1 + x1) * (-1 + x1 > 0)) *
        (0 * (0 >= -1 + x1) + (-1 + x1) * (-1 + x1 > 0) < 4)) + 20 * x2 + (
        3 * (3 <= 0 * (0 >= -1 + x0) + (-1 + x0) * (-1 + x0 > 0)) + (0 * (0 >=
        -1 + x0) + (-1 + x0) * (-1 + x0 > 0)) * (0 * (0 >= -1 + x0) + (-1 +
        x0) * (-1 + x0 > 0) < 3))), xmask, eviction_policy='evict_last')
    tl.store(out_ptr0 + x3, tmp0, xmask)


@triton.jit
def triton_poi_fused_constant_pad_nd_19(in_ptr0, out_ptr0, xnumel, XBLOCK:
    tl.constexpr):
    xnumel = 7680
    xoffset = tl.program_id(0) * XBLOCK
    xindex = xoffset + tl.arange(0, XBLOCK)[:]
    xmask = xindex < xnumel
    x1 = xindex // 4 % 5
    x3 = xindex
    tmp0 = -1 + x1
    tmp1 = tl.full([1], 0, tl.int64)
    tmp2 = tmp0 >= tmp1
    tmp3 = tl.load(in_ptr0 + (-4 + x3), tmp2 & xmask, other=0.0)
    tmp4 = 0.0
    tmp5 = tmp3 > tmp4
    tmp6 = 0.1
    tmp7 = tmp3 * tmp6
    tmp8 = tl.where(tmp5, tmp3, tmp7)
    tmp9 = tl.full(tmp8.shape, 0.0, tmp8.dtype)
    tmp10 = tl.where(tmp2, tmp8, tmp9)
    tl.store(out_ptr0 + x3, tmp10, xmask)


@triton.jit
def triton_poi_fused_replication_pad2d_20(in_ptr0, out_ptr0, xnumel, XBLOCK:
    tl.constexpr):
    xnumel = 16128
    xoffset = tl.program_id(0) * XBLOCK
    xindex = xoffset + tl.arange(0, XBLOCK)[:]
    xmask = xindex < xnumel
    x0 = xindex % 6
    x1 = xindex // 6 % 7
    x2 = xindex // 42
    x3 = xindex
    tmp0 = tl.load(in_ptr0 + (4 * (4 * (4 <= 0 * (0 >= -1 + x1) + (-1 + x1) *
        (-1 + x1 > 0)) + (0 * (0 >= -1 + x1) + (-1 + x1) * (-1 + x1 > 0)) *
        (0 * (0 >= -1 + x1) + (-1 + x1) * (-1 + x1 > 0) < 4)) + 20 * x2 + (
        3 * (3 <= 0 * (0 >= -1 + x0) + (-1 + x0) * (-1 + x0 > 0)) + (0 * (0 >=
        -1 + x0) + (-1 + x0) * (-1 + x0 > 0)) * (0 * (0 >= -1 + x0) + (-1 +
        x0) * (-1 + x0 > 0) < 3))), xmask, eviction_policy='evict_last')
    tl.store(out_ptr0 + x3, tmp0, xmask)


@triton.jit
def triton_poi_fused_leaky_relu_leaky_relu_backward_21(in_ptr0, out_ptr0,
    out_ptr1, xnumel, XBLOCK: tl.constexpr):
    xnumel = 7680
    xoffset = tl.program_id(0) * XBLOCK
    xindex = xoffset + tl.arange(0, XBLOCK)[:]
    xmask = xindex < xnumel
    x0 = xindex
    tmp0 = tl.load(in_ptr0 + x0, xmask)
    tmp1 = 0.0
    tmp2 = tmp0 > tmp1
    tmp3 = 0.1
    tmp4 = tmp0 * tmp3
    tmp5 = tl.where(tmp2, tmp0, tmp4)
    tmp6 = tmp5 > tmp1
    tl.store(out_ptr0 + x0, tmp6, xmask)
    tl.store(out_ptr1 + x0, tmp5, xmask)


@triton.jit
def triton_poi_fused_leaky_relu_leaky_relu_backward_22(in_ptr0, out_ptr0,
    xnumel, XBLOCK: tl.constexpr):
    xnumel = 7680
    xoffset = tl.program_id(0) * XBLOCK
    xindex = xoffset + tl.arange(0, XBLOCK)[:]
    xmask = xindex < xnumel
    x0 = xindex
    tmp0 = tl.load(in_ptr0 + x0, xmask)
    tmp1 = 0.0
    tmp2 = tmp0 > tmp1
    tmp3 = 0.1
    tmp4 = tmp0 * tmp3
    tmp5 = tl.where(tmp2, tmp0, tmp4)
    tmp6 = tmp5 > tmp1
    tl.store(out_ptr0 + x0, tmp6, xmask)


@triton.jit
def triton_poi_fused_leaky_relu_leaky_relu_backward_23(in_ptr0, out_ptr0,
    xnumel, XBLOCK: tl.constexpr):
    xnumel = 2304
    xoffset = tl.program_id(0) * XBLOCK
    xindex = xoffset + tl.arange(0, XBLOCK)[:]
    xmask = xindex < xnumel
    x0 = xindex
    tmp0 = tl.load(in_ptr0 + x0, xmask)
    tmp1 = 0.0
    tmp2 = tmp0 > tmp1
    tmp3 = 0.1
    tmp4 = tmp0 * tmp3
    tmp5 = tl.where(tmp2, tmp0, tmp4)
    tmp6 = tmp5 > tmp1
    tl.store(out_ptr0 + x0, tmp6, xmask)


@triton.jit
def triton_poi_fused_leaky_relu_leaky_relu_backward_24(in_ptr0, out_ptr0,
    xnumel, XBLOCK: tl.constexpr):
    xnumel = 384
    xoffset = tl.program_id(0) * XBLOCK
    xindex = xoffset + tl.arange(0, XBLOCK)[:]
    xmask = xindex < xnumel
    x0 = xindex
    tmp0 = tl.load(in_ptr0 + x0, xmask)
    tmp1 = 0.0
    tmp2 = tmp0 > tmp1
    tmp3 = 0.1
    tmp4 = tmp0 * tmp3
    tmp5 = tl.where(tmp2, tmp0, tmp4)
    tmp6 = tmp5 > tmp1
    tl.store(out_ptr0 + x0, tmp6, xmask)


@triton.jit
def triton_poi_fused_leaky_relu_leaky_relu_backward_25(in_ptr0, out_ptr0,
    xnumel, XBLOCK: tl.constexpr):
    xnumel = 768
    xoffset = tl.program_id(0) * XBLOCK
    xindex = xoffset + tl.arange(0, XBLOCK)[:]
    xmask = xindex < xnumel
    x0 = xindex
    tmp0 = tl.load(in_ptr0 + x0, xmask)
    tmp1 = 0.0
    tmp2 = tmp0 > tmp1
    tmp3 = 0.1
    tmp4 = tmp0 * tmp3
    tmp5 = tl.where(tmp2, tmp0, tmp4)
    tmp6 = tmp5 > tmp1
    tl.store(out_ptr0 + x0, tmp6, xmask)


@triton.jit
def triton_poi_fused_leaky_relu_leaky_relu_backward_26(in_ptr0, out_ptr0,
    xnumel, XBLOCK: tl.constexpr):
    xnumel = 1152
    xoffset = tl.program_id(0) * XBLOCK
    xindex = xoffset + tl.arange(0, XBLOCK)[:]
    xmask = xindex < xnumel
    x0 = xindex
    tmp0 = tl.load(in_ptr0 + x0, xmask)
    tmp1 = 0.0
    tmp2 = tmp0 > tmp1
    tmp3 = 0.1
    tmp4 = tmp0 * tmp3
    tmp5 = tl.where(tmp2, tmp0, tmp4)
    tmp6 = tmp5 > tmp1
    tl.store(out_ptr0 + x0, tmp6, xmask)


@triton.jit
def triton_poi_fused_leaky_relu_leaky_relu_backward_27(in_ptr0, out_ptr0,
    xnumel, XBLOCK: tl.constexpr):
    xnumel = 3840
    xoffset = tl.program_id(0) * XBLOCK
    xindex = xoffset + tl.arange(0, XBLOCK)[:]
    xmask = xindex < xnumel
    x0 = xindex
    tmp0 = tl.load(in_ptr0 + x0, xmask)
    tmp1 = 0.0
    tmp2 = tmp0 > tmp1
    tmp3 = 0.1
    tmp4 = tmp0 * tmp3
    tmp5 = tl.where(tmp2, tmp0, tmp4)
    tmp6 = tmp5 > tmp1
    tl.store(out_ptr0 + x0, tmp6, xmask)


def call(args):
    (primals_1, primals_2, primals_3, primals_4, primals_5, primals_6,
        primals_7, primals_8, primals_9, primals_10, primals_11, primals_12,
        primals_13, primals_14, primals_15, primals_16, primals_17, primals_18
        ) = args
    args.clear()
    assert_size_stride(primals_1, (4, 3, 4, 4), (48, 16, 4, 1))
    assert_size_stride(primals_2, (48, 3, 3, 3), (27, 9, 3, 1))
    assert_size_stride(primals_3, (48, 48, 3, 3), (432, 9, 3, 1))
    assert_size_stride(primals_4, (48, 48, 3, 3), (432, 9, 3, 1))
    assert_size_stride(primals_5, (48, 48, 3, 3), (432, 9, 3, 1))
    assert_size_stride(primals_6, (48, 48, 3, 3), (432, 9, 3, 1))
    assert_size_stride(primals_7, (48, 48, 3, 3), (432, 9, 3, 1))
    assert_size_stride(primals_8, (96, 48, 3, 3), (432, 9, 3, 1))
    assert_size_stride(primals_9, (96, 96, 3, 3), (864, 9, 3, 1))
    assert_size_stride(primals_10, (48, 96, 3, 3), (864, 9, 3, 1))
    assert_size_stride(primals_11, (96, 96, 3, 3), (864, 9, 3, 1))
    assert_size_stride(primals_12, (96, 96, 3, 3), (864, 9, 3, 1))
    assert_size_stride(primals_13, (96, 96, 3, 3), (864, 9, 3, 1))
    assert_size_stride(primals_14, (96, 96, 3, 3), (864, 9, 3, 1))
    assert_size_stride(primals_15, (96, 99, 3, 3), (891, 9, 3, 1))
    assert_size_stride(primals_16, (96, 96, 3, 3), (864, 9, 3, 1))
    assert_size_stride(primals_17, (96, 96, 3, 3), (864, 9, 3, 1))
    assert_size_stride(primals_18, (96, 96, 3, 3), (864, 9, 3, 1))
    with torch.cuda._DeviceGuard(0):
        torch.cuda.set_device(0)
        buf0 = empty_strided_cuda((4, 3, 7, 6), (126, 42, 6, 1), torch.float32)
        get_raw_stream(0)
        triton_poi_fused_constant_pad_nd_replication_pad2d_0[grid(504)](
            primals_1, buf0, 504, XBLOCK=256, num_warps=4, num_stages=1)
        buf1 = extern_kernels.convolution(buf0, primals_2, stride=(1, 1),
            padding=(0, 0), dilation=(1, 1), transposed=False,
            output_padding=(0, 0), groups=1, bias=None)
        assert_size_stride(buf1, (4, 48, 5, 4), (960, 20, 4, 1))
        buf2 = empty_strided_cuda((4, 48, 5, 4), (960, 20, 4, 1), torch.float32
            )
        triton_poi_fused_constant_pad_nd_1[grid(3840)](buf1, buf2, 3840,
            XBLOCK=256, num_warps=4, num_stages=1)
        buf3 = empty_strided_cuda((4, 48, 7, 6), (2016, 42, 6, 1), torch.
            float32)
        triton_poi_fused_replication_pad2d_2[grid(8064)](buf2, buf3, 8064,
            XBLOCK=256, num_warps=4, num_stages=1)
        buf4 = extern_kernels.convolution(buf3, primals_3, stride=(1, 1),
            padding=(0, 0), dilation=(1, 1), transposed=False,
            output_padding=(0, 0), groups=1, bias=None)
        assert_size_stride(buf4, (4, 48, 5, 4), (960, 20, 4, 1))
        buf5 = empty_strided_cuda((4, 48, 5, 4), (960, 20, 4, 1), torch.float32
            )
        triton_poi_fused_constant_pad_nd_1[grid(3840)](buf4, buf5, 3840,
            XBLOCK=256, num_warps=4, num_stages=1)
        buf6 = empty_strided_cuda((4, 48, 7, 6), (2016, 42, 6, 1), torch.
            float32)
        triton_poi_fused_replication_pad2d_2[grid(8064)](buf5, buf6, 8064,
            XBLOCK=256, num_warps=4, num_stages=1)
        buf7 = extern_kernels.convolution(buf6, primals_4, stride=(1, 1),
            padding=(0, 0), dilation=(1, 1), transposed=False,
            output_padding=(0, 0), groups=1, bias=None)
        assert_size_stride(buf7, (4, 48, 5, 4), (960, 20, 4, 1))
        buf8 = empty_strided_cuda((4, 48, 5, 4), (960, 20, 4, 1), torch.float32
            )
        triton_poi_fused_constant_pad_nd_1[grid(3840)](buf7, buf8, 3840,
            XBLOCK=256, num_warps=4, num_stages=1)
        buf9 = empty_strided_cuda((4, 48, 2, 2), (192, 4, 2, 1), torch.int8)
        triton_poi_fused_max_pool2d_with_indices_3[grid(768)](buf8, buf9, 
            768, XBLOCK=256, num_warps=4, num_stages=1)
        buf10 = empty_strided_cuda((4, 48, 3, 2), (288, 6, 2, 1), torch.float32
            )
        triton_poi_fused_constant_pad_nd_max_pool2d_with_indices_4[grid(1152)](
            buf8, buf10, 1152, XBLOCK=128, num_warps=4, num_stages=1)
        buf11 = empty_strided_cuda((4, 48, 5, 4), (960, 20, 4, 1), torch.
            float32)
        triton_poi_fused_replication_pad2d_5[grid(3840)](buf10, buf11, 3840,
            XBLOCK=256, num_warps=4, num_stages=1)
        buf12 = extern_kernels.convolution(buf11, primals_5, stride=(1, 1),
            padding=(0, 0), dilation=(1, 1), transposed=False,
            output_padding=(0, 0), groups=1, bias=None)
        assert_size_stride(buf12, (4, 48, 3, 2), (288, 6, 2, 1))
        buf13 = empty_strided_cuda((4, 48, 3, 2), (288, 6, 2, 1), torch.float32
            )
        triton_poi_fused_constant_pad_nd_6[grid(1152)](buf12, buf13, 1152,
            XBLOCK=256, num_warps=4, num_stages=1)
        buf14 = empty_strided_cuda((4, 48, 5, 4), (960, 20, 4, 1), torch.
            float32)
        triton_poi_fused_replication_pad2d_5[grid(3840)](buf13, buf14, 3840,
            XBLOCK=256, num_warps=4, num_stages=1)
        buf15 = extern_kernels.convolution(buf14, primals_6, stride=(1, 1),
            padding=(0, 0), dilation=(1, 1), transposed=False,
            output_padding=(0, 0), groups=1, bias=None)
        assert_size_stride(buf15, (4, 48, 3, 2), (288, 6, 2, 1))
        buf16 = empty_strided_cuda((4, 48, 3, 2), (288, 6, 2, 1), torch.float32
            )
        triton_poi_fused_constant_pad_nd_6[grid(1152)](buf15, buf16, 1152,
            XBLOCK=256, num_warps=4, num_stages=1)
        buf17 = empty_strided_cuda((4, 48, 5, 4), (960, 20, 4, 1), torch.
            float32)
        triton_poi_fused_replication_pad2d_5[grid(3840)](buf16, buf17, 3840,
            XBLOCK=256, num_warps=4, num_stages=1)
        buf18 = extern_kernels.convolution(buf17, primals_7, stride=(1, 1),
            padding=(0, 0), dilation=(1, 1), transposed=False,
            output_padding=(0, 0), groups=1, bias=None)
        assert_size_stride(buf18, (4, 48, 3, 2), (288, 6, 2, 1))
        buf19 = empty_strided_cuda((4, 48, 3, 2), (288, 6, 2, 1), torch.float32
            )
        triton_poi_fused_constant_pad_nd_6[grid(1152)](buf18, buf19, 1152,
            XBLOCK=256, num_warps=4, num_stages=1)
        buf20 = empty_strided_cuda((4, 48, 1, 1), (48, 1, 1, 1), torch.int8)
        triton_poi_fused_max_pool2d_with_indices_7[grid(192)](buf19, buf20,
            192, XBLOCK=128, num_warps=4, num_stages=1)
        buf21 = empty_strided_cuda((4, 48, 2, 1), (96, 2, 1, 1), torch.float32)
        triton_poi_fused_constant_pad_nd_max_pool2d_with_indices_8[grid(384)](
            buf19, buf21, 384, XBLOCK=128, num_warps=4, num_stages=1)
        buf22 = empty_strided_cuda((4, 48, 4, 3), (576, 12, 3, 1), torch.
            float32)
        triton_poi_fused_replication_pad2d_9[grid(2304)](buf21, buf22, 2304,
            XBLOCK=128, num_warps=4, num_stages=1)
        buf23 = extern_kernels.convolution(buf22, primals_8, stride=(1, 1),
            padding=(0, 0), dilation=(1, 1), transposed=False,
            output_padding=(0, 0), groups=1, bias=None)
        assert_size_stride(buf23, (4, 96, 2, 1), (192, 2, 1, 1))
        buf24 = empty_strided_cuda((4, 96, 2, 1), (192, 2, 1, 1), torch.float32
            )
        triton_poi_fused_constant_pad_nd_10[grid(768)](buf23, buf24, 768,
            XBLOCK=256, num_warps=4, num_stages=1)
        buf25 = empty_strided_cuda((4, 96, 4, 3), (1152, 12, 3, 1), torch.
            float32)
        triton_poi_fused_replication_pad2d_11[grid(4608)](buf24, buf25, 
            4608, XBLOCK=128, num_warps=4, num_stages=1)
        buf26 = extern_kernels.convolution(buf25, primals_9, stride=(1, 1),
            padding=(0, 0), dilation=(1, 1), transposed=False,
            output_padding=(0, 0), groups=1, bias=None)
        assert_size_stride(buf26, (4, 96, 2, 1), (192, 2, 1, 1))
        buf27 = empty_strided_cuda((4, 96, 2, 1), (192, 2, 1, 1), torch.float32
            )
        triton_poi_fused_constant_pad_nd_10[grid(768)](buf26, buf27, 768,
            XBLOCK=256, num_warps=4, num_stages=1)
        buf28 = empty_strided_cuda((4, 96, 4, 3), (1152, 12, 3, 1), torch.
            float32)
        triton_poi_fused_replication_pad2d_11[grid(4608)](buf27, buf28, 
            4608, XBLOCK=128, num_warps=4, num_stages=1)
        buf29 = extern_kernels.convolution(buf28, primals_10, stride=(1, 1),
            padding=(0, 0), dilation=(1, 1), transposed=False,
            output_padding=(0, 0), groups=1, bias=None)
        assert_size_stride(buf29, (4, 48, 2, 1), (96, 2, 1, 1))
        buf30 = empty_strided_cuda((2,), (1,), torch.int64)
        triton_poi_fused__to_copy_add_arange_mul_12[grid(2)](buf30, 2,
            XBLOCK=2, num_warps=1, num_stages=1)
        buf31 = empty_strided_cuda((4, 96, 3, 2), (576, 6, 2, 1), torch.float32
            )
        triton_poi_fused_cat_constant_pad_nd_13[grid(2304)](buf30, buf29,
            buf8, buf31, 2304, XBLOCK=128, num_warps=4, num_stages=1)
        buf32 = empty_strided_cuda((4, 96, 5, 4), (1920, 20, 4, 1), torch.
            float32)
        triton_poi_fused_replication_pad2d_14[grid(7680)](buf31, buf32, 
            7680, XBLOCK=256, num_warps=4, num_stages=1)
        buf33 = extern_kernels.convolution(buf32, primals_11, stride=(1, 1),
            padding=(0, 0), dilation=(1, 1), transposed=False,
            output_padding=(0, 0), groups=1, bias=None)
        assert_size_stride(buf33, (4, 96, 3, 2), (576, 6, 2, 1))
        buf34 = empty_strided_cuda((4, 96, 3, 2), (576, 6, 2, 1), torch.float32
            )
        triton_poi_fused_constant_pad_nd_15[grid(2304)](buf33, buf34, 2304,
            XBLOCK=256, num_warps=4, num_stages=1)
        buf35 = empty_strided_cuda((4, 96, 5, 4), (1920, 20, 4, 1), torch.
            float32)
        triton_poi_fused_replication_pad2d_14[grid(7680)](buf34, buf35, 
            7680, XBLOCK=256, num_warps=4, num_stages=1)
        buf36 = extern_kernels.convolution(buf35, primals_12, stride=(1, 1),
            padding=(0, 0), dilation=(1, 1), transposed=False,
            output_padding=(0, 0), groups=1, bias=None)
        assert_size_stride(buf36, (4, 96, 3, 2), (576, 6, 2, 1))
        buf37 = empty_strided_cuda((4, 96, 3, 2), (576, 6, 2, 1), torch.float32
            )
        triton_poi_fused_constant_pad_nd_15[grid(2304)](buf36, buf37, 2304,
            XBLOCK=256, num_warps=4, num_stages=1)
        buf38 = empty_strided_cuda((4, 96, 5, 4), (1920, 20, 4, 1), torch.
            float32)
        triton_poi_fused_replication_pad2d_14[grid(7680)](buf37, buf38, 
            7680, XBLOCK=256, num_warps=4, num_stages=1)
        buf39 = extern_kernels.convolution(buf38, primals_13, stride=(1, 1),
            padding=(0, 0), dilation=(1, 1), transposed=False,
            output_padding=(0, 0), groups=1, bias=None)
        assert_size_stride(buf39, (4, 96, 3, 2), (576, 6, 2, 1))
        buf40 = empty_strided_cuda((4, 96, 3, 2), (576, 6, 2, 1), torch.float32
            )
        triton_poi_fused_constant_pad_nd_15[grid(2304)](buf39, buf40, 2304,
            XBLOCK=256, num_warps=4, num_stages=1)
        buf41 = empty_strided_cuda((4, 96, 5, 4), (1920, 20, 4, 1), torch.
            float32)
        triton_poi_fused_replication_pad2d_14[grid(7680)](buf40, buf41, 
            7680, XBLOCK=256, num_warps=4, num_stages=1)
        buf42 = extern_kernels.convolution(buf41, primals_14, stride=(1, 1),
            padding=(0, 0), dilation=(1, 1), transposed=False,
            output_padding=(0, 0), groups=1, bias=None)
        assert_size_stride(buf42, (4, 96, 3, 2), (576, 6, 2, 1))
        buf43 = empty_strided_cuda((4,), (1,), torch.int64)
        triton_poi_fused__to_copy_add_arange_mul_16[grid(4)](buf43, 4,
            XBLOCK=4, num_warps=1, num_stages=1)
        buf44 = empty_strided_cuda((4, 99, 5, 4), (1980, 20, 4, 1), torch.
            float32)
        triton_poi_fused_cat_constant_pad_nd_17[grid(7920)](buf43, buf42,
            primals_1, buf44, 7920, XBLOCK=256, num_warps=4, num_stages=1)
        del primals_1
        buf45 = empty_strided_cuda((4, 99, 7, 6), (4158, 42, 6, 1), torch.
            float32)
        triton_poi_fused_replication_pad2d_18[grid(16632)](buf44, buf45, 
            16632, XBLOCK=128, num_warps=4, num_stages=1)
        buf46 = extern_kernels.convolution(buf45, primals_15, stride=(1, 1),
            padding=(0, 0), dilation=(1, 1), transposed=False,
            output_padding=(0, 0), groups=1, bias=None)
        assert_size_stride(buf46, (4, 96, 5, 4), (1920, 20, 4, 1))
        buf47 = empty_strided_cuda((4, 96, 5, 4), (1920, 20, 4, 1), torch.
            float32)
        triton_poi_fused_constant_pad_nd_19[grid(7680)](buf46, buf47, 7680,
            XBLOCK=256, num_warps=4, num_stages=1)
        buf48 = empty_strided_cuda((4, 96, 7, 6), (4032, 42, 6, 1), torch.
            float32)
        triton_poi_fused_replication_pad2d_20[grid(16128)](buf47, buf48, 
            16128, XBLOCK=256, num_warps=4, num_stages=1)
        buf49 = extern_kernels.convolution(buf48, primals_16, stride=(1, 1),
            padding=(0, 0), dilation=(1, 1), transposed=False,
            output_padding=(0, 0), groups=1, bias=None)
        assert_size_stride(buf49, (4, 96, 5, 4), (1920, 20, 4, 1))
        buf50 = empty_strided_cuda((4, 96, 5, 4), (1920, 20, 4, 1), torch.
            float32)
        triton_poi_fused_constant_pad_nd_19[grid(7680)](buf49, buf50, 7680,
            XBLOCK=256, num_warps=4, num_stages=1)
        buf51 = empty_strided_cuda((4, 96, 7, 6), (4032, 42, 6, 1), torch.
            float32)
        triton_poi_fused_replication_pad2d_20[grid(16128)](buf50, buf51, 
            16128, XBLOCK=256, num_warps=4, num_stages=1)
        buf52 = extern_kernels.convolution(buf51, primals_17, stride=(1, 1),
            padding=(0, 0), dilation=(1, 1), transposed=False,
            output_padding=(0, 0), groups=1, bias=None)
        assert_size_stride(buf52, (4, 96, 5, 4), (1920, 20, 4, 1))
        buf53 = empty_strided_cuda((4, 96, 5, 4), (1920, 20, 4, 1), torch.
            float32)
        triton_poi_fused_constant_pad_nd_19[grid(7680)](buf52, buf53, 7680,
            XBLOCK=256, num_warps=4, num_stages=1)
        buf54 = empty_strided_cuda((4, 96, 7, 6), (4032, 42, 6, 1), torch.
            float32)
        triton_poi_fused_replication_pad2d_20[grid(16128)](buf53, buf54, 
            16128, XBLOCK=256, num_warps=4, num_stages=1)
        buf55 = extern_kernels.convolution(buf54, primals_18, stride=(1, 1),
            padding=(0, 0), dilation=(1, 1), transposed=False,
            output_padding=(0, 0), groups=1, bias=None)
        assert_size_stride(buf55, (4, 96, 5, 4), (1920, 20, 4, 1))
        buf56 = empty_strided_cuda((4, 96, 5, 4), (1920, 20, 4, 1), torch.bool)
        buf73 = empty_strided_cuda((4, 96, 5, 4), (1920, 20, 4, 1), torch.
            float32)
        triton_poi_fused_leaky_relu_leaky_relu_backward_21[grid(7680)](buf55,
            buf56, buf73, 7680, XBLOCK=256, num_warps=4, num_stages=1)
        del buf55
        buf57 = empty_strided_cuda((4, 96, 5, 4), (1920, 20, 4, 1), torch.bool)
        triton_poi_fused_leaky_relu_leaky_relu_backward_22[grid(7680)](buf52,
            buf57, 7680, XBLOCK=256, num_warps=4, num_stages=1)
        del buf52
        buf58 = empty_strided_cuda((4, 96, 5, 4), (1920, 20, 4, 1), torch.bool)
        triton_poi_fused_leaky_relu_leaky_relu_backward_22[grid(7680)](buf49,
            buf58, 7680, XBLOCK=256, num_warps=4, num_stages=1)
        del buf49
        buf59 = empty_strided_cuda((4, 96, 5, 4), (1920, 20, 4, 1), torch.bool)
        triton_poi_fused_leaky_relu_leaky_relu_backward_22[grid(7680)](buf46,
            buf59, 7680, XBLOCK=256, num_warps=4, num_stages=1)
        del buf46
        buf60 = empty_strided_cuda((4, 96, 3, 2), (576, 6, 2, 1), torch.bool)
        triton_poi_fused_leaky_relu_leaky_relu_backward_23[grid(2304)](buf42,
            buf60, 2304, XBLOCK=256, num_warps=4, num_stages=1)
        del buf42
        buf61 = empty_strided_cuda((4, 96, 3, 2), (576, 6, 2, 1), torch.bool)
        triton_poi_fused_leaky_relu_leaky_relu_backward_23[grid(2304)](buf39,
            buf61, 2304, XBLOCK=256, num_warps=4, num_stages=1)
        del buf39
        buf62 = empty_strided_cuda((4, 96, 3, 2), (576, 6, 2, 1), torch.bool)
        triton_poi_fused_leaky_relu_leaky_relu_backward_23[grid(2304)](buf36,
            buf62, 2304, XBLOCK=256, num_warps=4, num_stages=1)
        del buf36
        buf63 = empty_strided_cuda((4, 96, 3, 2), (576, 6, 2, 1), torch.bool)
        triton_poi_fused_leaky_relu_leaky_relu_backward_23[grid(2304)](buf33,
            buf63, 2304, XBLOCK=256, num_warps=4, num_stages=1)
        del buf33
        buf64 = empty_strided_cuda((4, 48, 2, 1), (96, 2, 1, 1), torch.bool)
        triton_poi_fused_leaky_relu_leaky_relu_backward_24[grid(384)](buf29,
            buf64, 384, XBLOCK=256, num_warps=4, num_stages=1)
        del buf29
        buf65 = empty_strided_cuda((4, 96, 2, 1), (192, 2, 1, 1), torch.bool)
        triton_poi_fused_leaky_relu_leaky_relu_backward_25[grid(768)](buf26,
            buf65, 768, XBLOCK=128, num_warps=4, num_stages=1)
        del buf26
        buf66 = empty_strided_cuda((4, 96, 2, 1), (192, 2, 1, 1), torch.bool)
        triton_poi_fused_leaky_relu_leaky_relu_backward_25[grid(768)](buf23,
            buf66, 768, XBLOCK=128, num_warps=4, num_stages=1)
        del buf23
        buf67 = empty_strided_cuda((4, 48, 3, 2), (288, 6, 2, 1), torch.bool)
        triton_poi_fused_leaky_relu_leaky_relu_backward_26[grid(1152)](buf18,
            buf67, 1152, XBLOCK=128, num_warps=4, num_stages=1)
        del buf18
        buf68 = empty_strided_cuda((4, 48, 3, 2), (288, 6, 2, 1), torch.bool)
        triton_poi_fused_leaky_relu_leaky_relu_backward_26[grid(1152)](buf15,
            buf68, 1152, XBLOCK=128, num_warps=4, num_stages=1)
        del buf15
        buf69 = empty_strided_cuda((4, 48, 3, 2), (288, 6, 2, 1), torch.bool)
        triton_poi_fused_leaky_relu_leaky_relu_backward_26[grid(1152)](buf12,
            buf69, 1152, XBLOCK=128, num_warps=4, num_stages=1)
        del buf12
        buf70 = empty_strided_cuda((4, 48, 5, 4), (960, 20, 4, 1), torch.bool)
        triton_poi_fused_leaky_relu_leaky_relu_backward_27[grid(3840)](buf7,
            buf70, 3840, XBLOCK=128, num_warps=4, num_stages=1)
        del buf7
        buf71 = empty_strided_cuda((4, 48, 5, 4), (960, 20, 4, 1), torch.bool)
        triton_poi_fused_leaky_relu_leaky_relu_backward_27[grid(3840)](buf4,
            buf71, 3840, XBLOCK=128, num_warps=4, num_stages=1)
        del buf4
        buf72 = empty_strided_cuda((4, 48, 5, 4), (960, 20, 4, 1), torch.bool)
        triton_poi_fused_leaky_relu_leaky_relu_backward_27[grid(3840)](buf1,
            buf72, 3840, XBLOCK=128, num_warps=4, num_stages=1)
        del buf1
    return (reinterpret_tensor(buf73, (4, 96, 4, 4), (1920, 20, 4, 1), 0),
        primals_2, primals_3, primals_4, primals_5, primals_6, primals_7,
        primals_8, primals_9, primals_10, primals_11, primals_12,
        primals_13, primals_14, primals_15, primals_16, primals_17,
        primals_18, buf0, buf2, buf3, buf5, buf6, reinterpret_tensor(buf8,
        (4, 48, 4, 4), (960, 20, 4, 1), 0), buf9, buf10, buf11, buf13,
        buf14, buf16, buf17, reinterpret_tensor(buf19, (4, 48, 2, 2), (288,
        6, 2, 1), 0), buf20, buf21, buf22, buf24, buf25, buf27, buf28,
        buf30, buf31, buf32, buf34, buf35, buf37, buf38, buf40, buf41,
        buf43, buf44, buf45, buf47, buf48, buf50, buf51, buf53, buf54,
        buf56, buf57, buf58, buf59, buf60, buf61, buf62, buf63, buf64,
        buf65, buf66, buf67, buf68, buf69, buf70, buf71, buf72)


class crop(nn.Module):

    def __init__(self):
        super().__init__()

    def forward(self, x):
        N, C, H, W = x.shape
        x = x[0:N, 0:C, 0:H - 1, 0:W]
        return x


class shift(nn.Module):

    def __init__(self):
        super().__init__()
        self.shift_down = nn.ZeroPad2d((0, 0, 1, 0))
        self.crop = crop()

    def forward(self, x):
        x = self.shift_down(x)
        x = self.crop(x)
        return x


class Conv(nn.Module):

    def __init__(self, in_channels, out_channels, bias=False, blind=True):
        super().__init__()
        self.blind = blind
        if blind:
            self.shift_down = nn.ZeroPad2d((0, 0, 1, 0))
            self.crop = crop()
        self.replicate = nn.ReplicationPad2d(1)
        self.conv = nn.Conv2d(in_channels, out_channels, 3, bias=bias)
        self.relu = nn.LeakyReLU(0.1, inplace=True)

    def forward(self, x):
        if self.blind:
            x = self.shift_down(x)
        x = self.replicate(x)
        x = self.conv(x)
        x = self.relu(x)
        if self.blind:
            x = self.crop(x)
        return x


class Pool(nn.Module):

    def __init__(self, blind=True):
        super().__init__()
        self.blind = blind
        if blind:
            self.shift = shift()
        self.pool = nn.MaxPool2d(2)

    def forward(self, x):
        if self.blind:
            x = self.shift(x)
        x = self.pool(x)
        return x


class ENC_Conv(nn.Module):

    def __init__(self, in_channels, mid_channels, out_channels, bias=False,
        reduce=True, blind=True):
        super().__init__()
        self.reduce = reduce
        self.conv1 = Conv(in_channels, mid_channels, bias=bias, blind=blind)
        self.conv2 = Conv(mid_channels, mid_channels, bias=bias, blind=blind)
        self.conv3 = Conv(mid_channels, out_channels, bias=bias, blind=blind)
        if reduce:
            self.pool = Pool(blind=blind)

    def forward(self, x):
        x = self.conv1(x)
        x = self.conv2(x)
        x = self.conv3(x)
        if self.reduce:
            x = self.pool(x)
        return x


class DEC_Conv(nn.Module):

    def __init__(self, in_channels, mid_channels, out_channels, bias=False,
        blind=True):
        super().__init__()
        self.upsample = nn.Upsample(scale_factor=2, mode='nearest')
        self.conv1 = Conv(in_channels, mid_channels, bias=bias, blind=blind)
        self.conv2 = Conv(mid_channels, mid_channels, bias=bias, blind=blind)
        self.conv3 = Conv(mid_channels, mid_channels, bias=bias, blind=blind)
        self.conv4 = Conv(mid_channels, out_channels, bias=bias, blind=blind)

    def forward(self, x, x_in):
        x = self.upsample(x)
        diffY = x_in.size()[2] - x.size()[2]
        diffX = x_in.size()[3] - x.size()[3]
        x = F.pad(x, [diffX // 2, diffX - diffX // 2, diffY // 2, diffY - 
            diffY // 2])
        x = torch.cat((x, x_in), dim=1)
        x = self.conv1(x)
        x = self.conv2(x)
        x = self.conv3(x)
        x = self.conv4(x)
        return x


class Blind_UNetNew(nn.Module):

    def __init__(self, n_channels=3, n_output=96, bias=False, blind=True):
        super().__init__()
        self.n_channels = n_channels
        self.bias = bias
        self.enc1 = ENC_Conv(n_channels, 48, 48, bias=bias, blind=blind)
        self.enc2 = ENC_Conv(48, 48, 48, bias=bias, blind=blind)
        self.enc3 = ENC_Conv(48, 96, 48, bias=bias, reduce=False, blind=blind)
        self.dec2 = DEC_Conv(96, 96, 96, bias=bias, blind=blind)
        self.dec1 = DEC_Conv(96 + n_channels, 96, n_output, bias=bias,
            blind=blind)

    def forward(self, input_0):
        primals_2 = self.enc1.conv1.conv.weight
        primals_3 = self.enc1.conv2.conv.weight
        primals_4 = self.enc1.conv3.conv.weight
        primals_5 = self.enc2.conv1.conv.weight
        primals_6 = self.enc2.conv2.conv.weight
        primals_7 = self.enc2.conv3.conv.weight
        primals_8 = self.enc3.conv1.conv.weight
        primals_9 = self.enc3.conv2.conv.weight
        primals_10 = self.enc3.conv3.conv.weight
        primals_11 = self.dec2.conv1.conv.weight
        primals_12 = self.dec2.conv2.conv.weight
        primals_13 = self.dec2.conv3.conv.weight
        primals_14 = self.dec2.conv4.conv.weight
        primals_15 = self.dec1.conv1.conv.weight
        primals_16 = self.dec1.conv2.conv.weight
        primals_17 = self.dec1.conv3.conv.weight
        primals_18 = self.dec1.conv4.conv.weight
        primals_1 = input_0
        output = call([primals_1, primals_2, primals_3, primals_4,
            primals_5, primals_6, primals_7, primals_8, primals_9,
            primals_10, primals_11, primals_12, primals_13, primals_14,
            primals_15, primals_16, primals_17, primals_18])
        return output[0]


Measured latency_ms: 0.013757