import torch
from torch._inductor.select_algorithm import extern_kernels
import triton
import triton.language as tl
from torch._inductor.runtime.triton_heuristics import grid
from torch._C import _cuda_getCurrentRawStream as get_raw_stream
from torch._inductor.runtime import triton_helpers
from collections import OrderedDict
import torch.nn as nn
import torch.nn.functional as F
from torch import autograd as autograd
import torch.fft
from itertools import product as product
assert_size_stride = torch._C._dynamo.guards.assert_size_stride
empty_strided_cuda = torch._C._dynamo.guards._empty_strided_cuda


@triton.jit
def triton_poi_fused_add_convolution_leaky_relu_0(in_out_ptr0, in_ptr0,
    in_ptr1, xnumel, XBLOCK: tl.constexpr):
    xoffset = tl.program_id(0) * XBLOCK
    xindex = xoffset + tl.arange(0, XBLOCK)[:]
    tl.full([XBLOCK], True, tl.int1)
    x3 = xindex
    x1 = xindex // 4096 % 50
    tmp0 = tl.load(in_out_ptr0 + x3, None)
    tmp1 = tl.load(in_ptr0 + x1, None, eviction_policy='evict_last')
    tmp3 = tl.load(in_ptr1 + x3, None)
    tmp2 = tmp0 + tmp1
    tmp4 = tmp2 + tmp3
    tmp5 = 0.0
    tmp6 = tmp4 > tmp5
    tmp7 = 0.05
    tmp8 = tmp4 * tmp7
    tmp9 = tl.where(tmp6, tmp4, tmp8)
    tl.store(in_out_ptr0 + x3, tmp9, None)


@triton.jit
def triton_poi_fused_cat_leaky_relu_1(in_out_ptr0, in_ptr0, in_ptr1,
    in_ptr2, in_ptr3, in_ptr4, in_ptr5, in_ptr6, in_ptr7, xnumel, XBLOCK:
    tl.constexpr):
    xoffset = tl.program_id(0) * XBLOCK
    xindex = xoffset + tl.arange(0, XBLOCK)[:]
    tl.full([XBLOCK], True, tl.int1)
    x1 = xindex // 4096 % 100
    x0 = xindex % 4096
    x2 = xindex // 409600
    x3 = xindex
    tmp0 = x1
    tl.full([1], 0, tl.int64)
    tmp3 = tl.full([1], 25, tl.int64)
    tmp4 = tmp0 < tmp3
    tmp5 = tl.load(in_ptr0 + (x0 + 4096 * x1 + 102400 * x2), tmp4, other=0.0)
    tmp6 = tl.load(in_ptr1 + x1, tmp4, eviction_policy='evict_last', other=0.0)
    tmp7 = tmp5 + tmp6
    tmp8 = tl.full(tmp7.shape, 0.0, tmp7.dtype)
    tmp9 = tl.where(tmp4, tmp7, tmp8)
    tmp10 = tmp0 >= tmp3
    tmp11 = tl.full([1], 50, tl.int64)
    tmp12 = tmp0 < tmp11
    tmp13 = tmp10 & tmp12
    tmp14 = tl.load(in_ptr2 + (x0 + 4096 * (-25 + x1) + 102400 * x2), tmp13,
        other=0.0)
    tmp15 = tl.load(in_ptr3 + (-25 + x1), tmp13, eviction_policy=
        'evict_last', other=0.0)
    tmp16 = tmp14 + tmp15
    tmp17 = tl.full(tmp16.shape, 0.0, tmp16.dtype)
    tmp18 = tl.where(tmp13, tmp16, tmp17)
    tmp19 = tmp0 >= tmp11
    tmp20 = tl.full([1], 75, tl.int64)
    tmp21 = tmp0 < tmp20
    tmp22 = tmp19 & tmp21
    tmp23 = tl.load(in_ptr4 + (x0 + 4096 * (-50 + x1) + 102400 * x2), tmp22,
        other=0.0)
    tmp24 = tl.load(in_ptr5 + (-50 + x1), tmp22, eviction_policy=
        'evict_last', other=0.0)
    tmp25 = tmp23 + tmp24
    tmp26 = tl.full(tmp25.shape, 0.0, tmp25.dtype)
    tmp27 = tl.where(tmp22, tmp25, tmp26)
    tmp28 = tmp0 >= tmp20
    tl.full([1], 100, tl.int64)
    tmp31 = tl.load(in_ptr6 + (x0 + 4096 * (-75 + x1) + 102400 * x2), tmp28,
        other=0.0)
    tmp32 = tl.load(in_ptr7 + (-75 + x1), tmp28, eviction_policy=
        'evict_last', other=0.0)
    tmp33 = tmp31 + tmp32
    tmp34 = tl.full(tmp33.shape, 0.0, tmp33.dtype)
    tmp35 = tl.where(tmp28, tmp33, tmp34)
    tmp36 = tl.where(tmp22, tmp27, tmp35)
    tmp37 = tl.where(tmp13, tmp18, tmp36)
    tmp38 = tl.where(tmp4, tmp9, tmp37)
    tmp39 = 0.0
    tmp40 = tmp38 > tmp39
    tmp41 = 0.05
    tmp42 = tmp38 * tmp41
    tmp43 = tl.where(tmp40, tmp38, tmp42)
    tl.store(in_out_ptr0 + x3, tmp43, None)


@triton.jit
def triton_poi_fused_convolution_2(in_out_ptr0, in_ptr0, xnumel, XBLOCK: tl
    .constexpr):
    xoffset = tl.program_id(0) * XBLOCK
    xindex = xoffset + tl.arange(0, XBLOCK)[:]
    tl.full([XBLOCK], True, tl.int1)
    x3 = xindex
    x1 = xindex // 4096 % 50
    tmp0 = tl.load(in_out_ptr0 + x3, None)
    tmp1 = tl.load(in_ptr0 + x1, None, eviction_policy='evict_last')
    tmp2 = tmp0 + tmp1
    tl.store(in_out_ptr0 + x3, tmp2, None)


@triton.jit
def triton_poi_fused_convolution_3(in_out_ptr0, in_ptr0, xnumel, XBLOCK: tl
    .constexpr):
    xoffset = tl.program_id(0) * XBLOCK
    xindex = xoffset + tl.arange(0, XBLOCK)[:]
    tl.full([XBLOCK], True, tl.int1)
    x3 = xindex
    x1 = xindex // 4096 % 12
    tmp0 = tl.load(in_out_ptr0 + x3, None)
    tmp1 = tl.load(in_ptr0 + x1, None, eviction_policy='evict_last')
    tmp2 = tmp0 + tmp1
    tl.store(in_out_ptr0 + x3, tmp2, None)


@triton.jit
def triton_poi_fused_convolution_4(in_out_ptr0, in_ptr0, xnumel, XBLOCK: tl
    .constexpr):
    xnumel = 46128
    xoffset = tl.program_id(0) * XBLOCK
    xindex = xoffset + tl.arange(0, XBLOCK)[:]
    xmask = xindex < xnumel
    x3 = xindex
    x1 = xindex // 961 % 12
    tmp0 = tl.load(in_out_ptr0 + x3, xmask)
    tmp1 = tl.load(in_ptr0 + x1, xmask, eviction_policy='evict_last')
    tmp2 = tmp0 + tmp1
    tl.store(in_out_ptr0 + x3, tmp2, xmask)


@triton.jit
def triton_poi_fused_convolution_relu_5(in_out_ptr0, in_ptr0, xnumel,
    XBLOCK: tl.constexpr):
    xnumel = 3888
    xoffset = tl.program_id(0) * XBLOCK
    xindex = xoffset + tl.arange(0, XBLOCK)[:]
    xmask = xindex < xnumel
    x3 = xindex
    x1 = xindex // 81 % 12
    tmp0 = tl.load(in_out_ptr0 + x3, xmask)
    tmp1 = tl.load(in_ptr0 + x1, xmask, eviction_policy='evict_last')
    tmp2 = tmp0 + tmp1
    tmp3 = tl.full([1], 0, tl.int32)
    tmp4 = triton_helpers.maximum(tmp3, tmp2)
    tl.store(in_out_ptr0 + x3, tmp4, xmask)


@triton.jit
def triton_poi_fused__to_copy_6(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 = x0
    tmp1 = tmp0.to(tl.float32)
    tmp2 = 0.5
    tmp3 = tmp1 + tmp2
    tmp4 = 0.140625
    tmp5 = tmp3 * tmp4
    tmp6 = tmp5 - tmp2
    tmp7 = 0.0
    tmp8 = triton_helpers.maximum(tmp6, tmp7)
    tmp9 = tmp8.to(tl.int32)
    tl.store(out_ptr0 + x0, tmp9, xmask)


@triton.jit
def triton_poi_fused_add_clamp_7(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 = x0
    tmp1 = tmp0.to(tl.float32)
    tmp2 = 0.5
    tmp3 = tmp1 + tmp2
    tmp4 = 0.140625
    tmp5 = tmp3 * tmp4
    tmp6 = tmp5 - tmp2
    tmp7 = 0.0
    tmp8 = triton_helpers.maximum(tmp6, tmp7)
    tmp9 = tmp8.to(tl.int32)
    tmp10 = tl.full([1], 1, tl.int64)
    tmp11 = tmp9 + tmp10
    tmp12 = tl.full([1], 8, tl.int64)
    tmp13 = triton_helpers.minimum(tmp11, tmp12)
    tl.store(out_ptr0 + x0, tmp13, xmask)


@triton.jit
def triton_poi_fused__to_copy_add_arange_clamp_mul_sub_8(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 = x0
    tmp1 = tmp0.to(tl.float32)
    tmp2 = 0.5
    tmp3 = tmp1 + tmp2
    tmp4 = 0.140625
    tmp5 = tmp3 * tmp4
    tmp6 = tmp5 - tmp2
    tmp7 = 0.0
    tmp8 = triton_helpers.maximum(tmp6, tmp7)
    tmp9 = tmp8.to(tl.int32)
    tmp10 = tmp9.to(tl.float32)
    tmp11 = tmp8 - tmp10
    tmp12 = triton_helpers.maximum(tmp11, tmp7)
    tmp13 = 1.0
    tmp14 = triton_helpers.minimum(tmp12, tmp13)
    tl.store(out_ptr0 + x0, tmp14, xmask)


@triton.jit
def triton_poi_fused__unsafe_index_add_convolution_mul_sub_9(in_out_ptr0,
    in_ptr0, in_ptr1, in_ptr2, in_ptr3, in_ptr4, in_ptr5, in_ptr6, in_ptr7,
    in_ptr8, in_ptr9, xnumel, XBLOCK: tl.constexpr):
    xoffset = tl.program_id(0) * XBLOCK
    xindex = xoffset + tl.arange(0, XBLOCK)[:]
    tl.full([XBLOCK], True, tl.int1)
    x1 = xindex // 64 % 64
    x0 = xindex % 64
    x5 = xindex // 4096
    x2 = xindex // 4096 % 12
    x6 = xindex
    tmp0 = tl.load(in_ptr0 + x1, None, eviction_policy='evict_last')
    tmp5 = tl.load(in_ptr1 + x0, None, eviction_policy='evict_last')
    tmp10 = tl.load(in_ptr3 + x2, None, eviction_policy='evict_last')
    tmp12 = tl.load(in_ptr4 + x0, None, eviction_policy='evict_last')
    tmp19 = tl.load(in_ptr5 + x0, None, eviction_policy='evict_last')
    tmp22 = tl.load(in_ptr6 + x1, None, eviction_policy='evict_last')
    tmp34 = tl.load(in_ptr7 + x1, None, eviction_policy='evict_last')
    tmp37 = tl.load(in_ptr8 + x6, None)
    tmp38 = tl.load(in_ptr9 + x2, None, eviction_policy='evict_last')
    tmp1 = tl.full([XBLOCK], 9, tl.int32)
    tmp2 = tmp0 + tmp1
    tmp3 = tmp0 < 0
    tmp4 = tl.where(tmp3, tmp2, tmp0)
    tmp6 = tmp5 + tmp1
    tmp7 = tmp5 < 0
    tmp8 = tl.where(tmp7, tmp6, tmp5)
    tmp9 = tl.load(in_ptr2 + (tmp8 + 9 * tmp4 + 81 * x5), None,
        eviction_policy='evict_last')
    tmp11 = tmp9 + tmp10
    tmp13 = tmp12 + tmp1
    tmp14 = tmp12 < 0
    tmp15 = tl.where(tmp14, tmp13, tmp12)
    tmp16 = tl.load(in_ptr2 + (tmp15 + 9 * tmp4 + 81 * x5), None,
        eviction_policy='evict_last')
    tmp17 = tmp16 + tmp10
    tmp18 = tmp17 - tmp11
    tmp20 = tmp18 * tmp19
    tmp21 = tmp11 + tmp20
    tmp23 = tmp22 + tmp1
    tmp24 = tmp22 < 0
    tmp25 = tl.where(tmp24, tmp23, tmp22)
    tmp26 = tl.load(in_ptr2 + (tmp8 + 9 * tmp25 + 81 * x5), None,
        eviction_policy='evict_last')
    tmp27 = tmp26 + tmp10
    tmp28 = tl.load(in_ptr2 + (tmp15 + 9 * tmp25 + 81 * x5), None,
        eviction_policy='evict_last')
    tmp29 = tmp28 + tmp10
    tmp30 = tmp29 - tmp27
    tmp31 = tmp30 * tmp19
    tmp32 = tmp27 + tmp31
    tmp33 = tmp32 - tmp21
    tmp35 = tmp33 * tmp34
    tmp36 = tmp21 + tmp35
    tmp39 = tmp37 + tmp38
    tmp40 = tmp36 + tmp39
    tl.store(in_out_ptr0 + x6, tmp40, None)


@triton.jit
def triton_poi_fused_convolution_mul_sigmoid_10(in_out_ptr0, in_ptr0,
    in_ptr1, out_ptr0, xnumel, XBLOCK: tl.constexpr):
    xoffset = tl.program_id(0) * XBLOCK
    xindex = xoffset + tl.arange(0, XBLOCK)[:]
    tl.full([XBLOCK], True, tl.int1)
    x3 = xindex
    x1 = xindex // 4096 % 50
    tmp0 = tl.load(in_out_ptr0 + x3, None)
    tmp1 = tl.load(in_ptr0 + x1, None, eviction_policy='evict_last')
    tmp3 = tl.load(in_ptr1 + x3, None)
    tmp2 = tmp0 + tmp1
    tmp4 = tl.sigmoid(tmp2)
    tmp5 = tmp3 * tmp4
    tl.store(in_out_ptr0 + x3, tmp2, None)
    tl.store(out_ptr0 + x3, tmp5, None)


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, primals_19, primals_20, primals_21, primals_22,
        primals_23, primals_24, primals_25, primals_26, primals_27,
        primals_28, primals_29, primals_30, primals_31) = args
    args.clear()
    assert_size_stride(primals_1, (25, 50, 1, 1), (50, 1, 1, 1))
    assert_size_stride(primals_2, (25,), (1,))
    assert_size_stride(primals_3, (4, 50, 64, 64), (204800, 4096, 64, 1))
    assert_size_stride(primals_4, (50, 50, 3, 3), (450, 9, 3, 1))
    assert_size_stride(primals_5, (50,), (1,))
    assert_size_stride(primals_6, (25, 50, 1, 1), (50, 1, 1, 1))
    assert_size_stride(primals_7, (25,), (1,))
    assert_size_stride(primals_8, (50, 50, 3, 3), (450, 9, 3, 1))
    assert_size_stride(primals_9, (50,), (1,))
    assert_size_stride(primals_10, (25, 50, 1, 1), (50, 1, 1, 1))
    assert_size_stride(primals_11, (25,), (1,))
    assert_size_stride(primals_12, (50, 50, 3, 3), (450, 9, 3, 1))
    assert_size_stride(primals_13, (50,), (1,))
    assert_size_stride(primals_14, (25, 50, 3, 3), (450, 9, 3, 1))
    assert_size_stride(primals_15, (25,), (1,))
    assert_size_stride(primals_16, (50, 100, 1, 1), (100, 1, 1, 1))
    assert_size_stride(primals_17, (50,), (1,))
    assert_size_stride(primals_18, (12, 50, 1, 1), (50, 1, 1, 1))
    assert_size_stride(primals_19, (12,), (1,))
    assert_size_stride(primals_20, (12, 12, 3, 3), (108, 9, 3, 1))
    assert_size_stride(primals_21, (12,), (1,))
    assert_size_stride(primals_22, (12, 12, 3, 3), (108, 9, 3, 1))
    assert_size_stride(primals_23, (12,), (1,))
    assert_size_stride(primals_24, (12, 12, 3, 3), (108, 9, 3, 1))
    assert_size_stride(primals_25, (12,), (1,))
    assert_size_stride(primals_26, (12, 12, 3, 3), (108, 9, 3, 1))
    assert_size_stride(primals_27, (12,), (1,))
    assert_size_stride(primals_28, (12, 12, 1, 1), (12, 1, 1, 1))
    assert_size_stride(primals_29, (12,), (1,))
    assert_size_stride(primals_30, (50, 12, 1, 1), (12, 1, 1, 1))
    assert_size_stride(primals_31, (50,), (1,))
    with torch.cuda._DeviceGuard(0):
        torch.cuda.set_device(0)
        buf0 = extern_kernels.convolution(primals_3, primals_1, stride=(1, 
            1), padding=(0, 0), dilation=(1, 1), transposed=False,
            output_padding=(0, 0), groups=1, bias=None)
        assert_size_stride(buf0, (4, 25, 64, 64), (102400, 4096, 64, 1))
        buf1 = extern_kernels.convolution(primals_3, primals_4, stride=(1, 
            1), padding=(1, 1), dilation=(1, 1), transposed=False,
            output_padding=(0, 0), groups=1, bias=None)
        assert_size_stride(buf1, (4, 50, 64, 64), (204800, 4096, 64, 1))
        buf2 = buf1
        del buf1
        get_raw_stream(0)
        triton_poi_fused_add_convolution_leaky_relu_0[grid(819200)](buf2,
            primals_5, primals_3, 819200, XBLOCK=512, num_warps=8, num_stages=1
            )
        del primals_5
        buf3 = extern_kernels.convolution(buf2, primals_6, stride=(1, 1),
            padding=(0, 0), dilation=(1, 1), transposed=False,
            output_padding=(0, 0), groups=1, bias=None)
        assert_size_stride(buf3, (4, 25, 64, 64), (102400, 4096, 64, 1))
        buf4 = extern_kernels.convolution(buf2, primals_8, stride=(1, 1),
            padding=(1, 1), dilation=(1, 1), transposed=False,
            output_padding=(0, 0), groups=1, bias=None)
        assert_size_stride(buf4, (4, 50, 64, 64), (204800, 4096, 64, 1))
        buf5 = buf4
        del buf4
        triton_poi_fused_add_convolution_leaky_relu_0[grid(819200)](buf5,
            primals_9, buf2, 819200, XBLOCK=512, num_warps=8, num_stages=1)
        del primals_9
        buf6 = extern_kernels.convolution(buf5, primals_10, stride=(1, 1),
            padding=(0, 0), dilation=(1, 1), transposed=False,
            output_padding=(0, 0), groups=1, bias=None)
        assert_size_stride(buf6, (4, 25, 64, 64), (102400, 4096, 64, 1))
        buf7 = extern_kernels.convolution(buf5, primals_12, stride=(1, 1),
            padding=(1, 1), dilation=(1, 1), transposed=False,
            output_padding=(0, 0), groups=1, bias=None)
        assert_size_stride(buf7, (4, 50, 64, 64), (204800, 4096, 64, 1))
        buf8 = buf7
        del buf7
        triton_poi_fused_add_convolution_leaky_relu_0[grid(819200)](buf8,
            primals_13, buf5, 819200, XBLOCK=512, num_warps=8, num_stages=1)
        del primals_13
        buf9 = extern_kernels.convolution(buf8, primals_14, stride=(1, 1),
            padding=(1, 1), dilation=(1, 1), transposed=False,
            output_padding=(0, 0), groups=1, bias=None)
        assert_size_stride(buf9, (4, 25, 64, 64), (102400, 4096, 64, 1))
        buf10 = empty_strided_cuda((4, 100, 64, 64), (409600, 4096, 64, 1),
            torch.float32)
        buf11 = buf10
        del buf10
        triton_poi_fused_cat_leaky_relu_1[grid(1638400)](buf11, buf0,
            primals_2, buf3, primals_7, buf6, primals_11, buf9, primals_15,
            1638400, XBLOCK=512, num_warps=8, num_stages=1)
        del buf0
        del buf3
        del buf6
        del buf9
        del primals_11
        del primals_15
        del primals_2
        del primals_7
        buf12 = extern_kernels.convolution(buf11, primals_16, stride=(1, 1),
            padding=(0, 0), dilation=(1, 1), transposed=False,
            output_padding=(0, 0), groups=1, bias=None)
        assert_size_stride(buf12, (4, 50, 64, 64), (204800, 4096, 64, 1))
        buf13 = buf12
        del buf12
        triton_poi_fused_convolution_2[grid(819200)](buf13, primals_17, 
            819200, XBLOCK=1024, num_warps=4, num_stages=1)
        del primals_17
        buf14 = extern_kernels.convolution(buf13, primals_18, stride=(1, 1),
            padding=(0, 0), dilation=(1, 1), transposed=False,
            output_padding=(0, 0), groups=1, bias=None)
        assert_size_stride(buf14, (4, 12, 64, 64), (49152, 4096, 64, 1))
        buf15 = buf14
        del buf14
        triton_poi_fused_convolution_3[grid(196608)](buf15, primals_19, 
            196608, XBLOCK=1024, num_warps=4, num_stages=1)
        del primals_19
        buf16 = extern_kernels.convolution(buf15, primals_20, stride=(2, 2),
            padding=(0, 0), dilation=(1, 1), transposed=False,
            output_padding=(0, 0), groups=1, bias=None)
        assert_size_stride(buf16, (4, 12, 31, 31), (11532, 961, 31, 1))
        buf17 = buf16
        del buf16
        triton_poi_fused_convolution_4[grid(46128)](buf17, primals_21, 
            46128, XBLOCK=512, num_warps=4, num_stages=1)
        del primals_21
        buf18 = torch.ops.aten.max_pool2d_with_indices.default(buf17, [7, 7
            ], [3, 3])
        buf19 = buf18[0]
        buf20 = buf18[1]
        del buf18
        buf21 = extern_kernels.convolution(buf19, primals_22, stride=(1, 1),
            padding=(1, 1), dilation=(1, 1), transposed=False,
            output_padding=(0, 0), groups=1, bias=None)
        assert_size_stride(buf21, (4, 12, 9, 9), (972, 81, 9, 1))
        buf22 = buf21
        del buf21
        triton_poi_fused_convolution_relu_5[grid(3888)](buf22, primals_23, 
            3888, XBLOCK=256, num_warps=4, num_stages=1)
        del primals_23
        buf23 = extern_kernels.convolution(buf22, primals_24, stride=(1, 1),
            padding=(1, 1), dilation=(1, 1), transposed=False,
            output_padding=(0, 0), groups=1, bias=None)
        assert_size_stride(buf23, (4, 12, 9, 9), (972, 81, 9, 1))
        buf24 = buf23
        del buf23
        triton_poi_fused_convolution_relu_5[grid(3888)](buf24, primals_25, 
            3888, XBLOCK=256, num_warps=4, num_stages=1)
        del primals_25
        buf25 = extern_kernels.convolution(buf24, primals_26, stride=(1, 1),
            padding=(1, 1), dilation=(1, 1), transposed=False,
            output_padding=(0, 0), groups=1, bias=None)
        assert_size_stride(buf25, (4, 12, 9, 9), (972, 81, 9, 1))
        buf26 = empty_strided_cuda((64, 1), (1, 1), torch.int64)
        triton_poi_fused__to_copy_6[grid(64)](buf26, 64, XBLOCK=64,
            num_warps=1, num_stages=1)
        buf27 = empty_strided_cuda((64, 1), (1, 1), torch.int64)
        triton_poi_fused_add_clamp_7[grid(64)](buf27, 64, XBLOCK=64,
            num_warps=1, num_stages=1)
        buf28 = empty_strided_cuda((64,), (1,), torch.int64)
        triton_poi_fused__to_copy_6[grid(64)](buf28, 64, XBLOCK=64,
            num_warps=1, num_stages=1)
        buf29 = empty_strided_cuda((64,), (1,), torch.int64)
        triton_poi_fused_add_clamp_7[grid(64)](buf29, 64, XBLOCK=64,
            num_warps=1, num_stages=1)
        buf30 = empty_strided_cuda((64,), (1,), torch.float32)
        triton_poi_fused__to_copy_add_arange_clamp_mul_sub_8[grid(64)](buf30,
            64, XBLOCK=64, num_warps=1, num_stages=1)
        buf32 = empty_strided_cuda((64, 1), (1, 1), torch.float32)
        triton_poi_fused__to_copy_add_arange_clamp_mul_sub_8[grid(64)](buf32,
            64, XBLOCK=64, num_warps=1, num_stages=1)
        buf34 = extern_kernels.convolution(buf15, primals_28, stride=(1, 1),
            padding=(0, 0), dilation=(1, 1), transposed=False,
            output_padding=(0, 0), groups=1, bias=None)
        assert_size_stride(buf34, (4, 12, 64, 64), (49152, 4096, 64, 1))
        buf33 = empty_strided_cuda((4, 12, 64, 64), (49152, 4096, 64, 1),
            torch.float32)
        buf35 = buf33
        del buf33
        triton_poi_fused__unsafe_index_add_convolution_mul_sub_9[grid(196608)](
            buf35, buf26, buf28, buf25, primals_27, buf29, buf30, buf27,
            buf32, buf34, primals_29, 196608, XBLOCK=512, num_warps=8,
            num_stages=1)
        del buf25
        del buf34
        del primals_27
        del primals_29
        buf36 = extern_kernels.convolution(buf35, primals_30, stride=(1, 1),
            padding=(0, 0), dilation=(1, 1), transposed=False,
            output_padding=(0, 0), groups=1, bias=None)
        assert_size_stride(buf36, (4, 50, 64, 64), (204800, 4096, 64, 1))
        buf37 = buf36
        del buf36
        buf38 = empty_strided_cuda((4, 50, 64, 64), (204800, 4096, 64, 1),
            torch.float32)
        triton_poi_fused_convolution_mul_sigmoid_10[grid(819200)](buf37,
            primals_31, buf13, buf38, 819200, XBLOCK=512, num_warps=8,
            num_stages=1)
        del primals_31
    return (buf38, primals_1, primals_3, primals_4, primals_6, primals_8,
        primals_10, primals_12, primals_14, primals_16, primals_18,
        primals_20, primals_22, primals_24, primals_26, primals_28,
        primals_30, buf2, buf5, buf8, buf11, buf13, buf15, buf17, buf19,
        buf20, buf22, buf24, buf26, buf27, buf28, buf29, buf30, buf32,
        buf35, buf37)


def sequential(*args):
    """Advanced nn.Sequential.

    Args:
        nn.Sequential, nn.Module

    Returns:
        nn.Sequential
    """
    if len(args) == 1:
        if isinstance(args[0], OrderedDict):
            raise NotImplementedError(
                'sequential does not support OrderedDict input.')
        return args[0]
    modules = []
    for module in args:
        if isinstance(module, nn.Sequential):
            for submodule in module.children():
                modules.append(submodule)
        elif isinstance(module, nn.Module):
            modules.append(module)
    return nn.Sequential(*modules)


def conv(in_channels=64, out_channels=64, kernel_size=3, stride=1, padding=
    1, bias=True, mode='CBR', negative_slope=0.2):
    L = []
    for t in mode:
        if t == 'C':
            L.append(nn.Conv2d(in_channels=in_channels, out_channels=
                out_channels, kernel_size=kernel_size, stride=stride,
                padding=padding, bias=bias))
        elif t == 'T':
            L.append(nn.ConvTranspose2d(in_channels=in_channels,
                out_channels=out_channels, kernel_size=kernel_size, stride=
                stride, padding=padding, bias=bias))
        elif t == 'B':
            L.append(nn.BatchNorm2d(out_channels, momentum=0.9, eps=0.0001,
                affine=True))
        elif t == 'I':
            L.append(nn.InstanceNorm2d(out_channels, affine=True))
        elif t == 'R':
            L.append(nn.ReLU(inplace=True))
        elif t == 'r':
            L.append(nn.ReLU(inplace=False))
        elif t == 'L':
            L.append(nn.LeakyReLU(negative_slope=negative_slope, inplace=True))
        elif t == 'l':
            L.append(nn.LeakyReLU(negative_slope=negative_slope, inplace=False)
                )
        elif t == '2':
            L.append(nn.PixelShuffle(upscale_factor=2))
        elif t == '3':
            L.append(nn.PixelShuffle(upscale_factor=3))
        elif t == '4':
            L.append(nn.PixelShuffle(upscale_factor=4))
        elif t == 'U':
            L.append(nn.Upsample(scale_factor=2, mode='nearest'))
        elif t == 'u':
            L.append(nn.Upsample(scale_factor=3, mode='nearest'))
        elif t == 'v':
            L.append(nn.Upsample(scale_factor=4, mode='nearest'))
        elif t == 'M':
            L.append(nn.MaxPool2d(kernel_size=kernel_size, stride=stride,
                padding=0))
        elif t == 'A':
            L.append(nn.AvgPool2d(kernel_size=kernel_size, stride=stride,
                padding=0))
        else:
            raise NotImplementedError('Undefined type: ')
    return sequential(*L)


class ESA(nn.Module):

    def __init__(self, channel=64, reduction=4, bias=True):
        super(ESA, self).__init__()
        self.r_nc = channel // reduction
        self.conv1 = nn.Conv2d(channel, self.r_nc, kernel_size=1)
        self.conv21 = nn.Conv2d(self.r_nc, self.r_nc, kernel_size=1)
        self.conv2 = nn.Conv2d(self.r_nc, self.r_nc, kernel_size=3, stride=
            2, padding=0)
        self.conv3 = nn.Conv2d(self.r_nc, self.r_nc, kernel_size=3, padding=1)
        self.conv4 = nn.Conv2d(self.r_nc, self.r_nc, kernel_size=3, padding=1)
        self.conv5 = nn.Conv2d(self.r_nc, self.r_nc, kernel_size=3, padding=1)
        self.conv6 = nn.Conv2d(self.r_nc, channel, kernel_size=1)
        self.sigmoid = nn.Sigmoid()
        self.relu = nn.ReLU(inplace=True)

    def forward(self, x):
        x1 = self.conv1(x)
        x2 = F.max_pool2d(self.conv2(x1), kernel_size=7, stride=3)
        x2 = self.relu(self.conv3(x2))
        x2 = self.relu(self.conv4(x2))
        x2 = F.interpolate(self.conv5(x2), (x.size(2), x.size(3)), mode=
            'bilinear', align_corners=False)
        x2 = self.conv6(x2 + self.conv21(x1))
        return x.mul(self.sigmoid(x2))


class CFRBNew(nn.Module):

    def __init__(self, in_channels=50, out_channels=50, kernel_size=3,
        stride=1, padding=1, bias=True, mode='CL', d_rate=0.5,
        negative_slope=0.05):
        super(CFRBNew, self).__init__()
        self.d_nc = int(in_channels * d_rate)
        self.r_nc = in_channels
        assert mode[0] == 'C', 'convolutional layer first'
        self.conv1_d = conv(in_channels, self.d_nc, kernel_size=1, stride=1,
            padding=0, bias=bias, mode=mode[0])
        self.conv1_r = conv(in_channels, self.r_nc, kernel_size, stride,
            padding, bias=bias, mode=mode[0])
        self.conv2_d = conv(self.r_nc, self.d_nc, kernel_size=1, stride=1,
            padding=0, bias=bias, mode=mode[0])
        self.conv2_r = conv(self.r_nc, self.r_nc, kernel_size, stride,
            padding, bias=bias, mode=mode[0])
        self.conv3_d = conv(self.r_nc, self.d_nc, kernel_size=1, stride=1,
            padding=0, bias=bias, mode=mode[0])
        self.conv3_r = conv(self.r_nc, self.r_nc, kernel_size, stride,
            padding, bias=bias, mode=mode[0])
        self.conv4_d = conv(self.r_nc, self.d_nc, kernel_size, stride,
            padding, bias=bias, mode=mode[0])
        self.conv1x1 = conv(self.d_nc * 4, out_channels, kernel_size=1,
            stride=1, padding=0, bias=bias, mode=mode[0])
        self.act = conv(mode=mode[-1], negative_slope=negative_slope)
        self.esa = ESA(in_channels, reduction=4, bias=True)

    def forward(self, input_0):
        primals_1 = self.conv1_d.weight
        primals_2 = self.conv1_d.bias
        primals_4 = self.conv1_r.weight
        primals_5 = self.conv1_r.bias
        primals_6 = self.conv2_d.weight
        primals_7 = self.conv2_d.bias
        primals_8 = self.conv2_r.weight
        primals_9 = self.conv2_r.bias
        primals_10 = self.conv3_d.weight
        primals_11 = self.conv3_d.bias
        primals_12 = self.conv3_r.weight
        primals_13 = self.conv3_r.bias
        primals_14 = self.conv4_d.weight
        primals_15 = self.conv4_d.bias
        primals_16 = self.conv1x1.weight
        primals_17 = self.conv1x1.bias
        primals_18 = self.esa.conv1.weight
        primals_19 = self.esa.conv1.bias
        primals_28 = self.esa.conv21.weight
        primals_21 = self.esa.conv21.bias
        primals_20 = self.esa.conv2.weight
        primals_23 = self.esa.conv2.bias
        primals_22 = self.esa.conv3.weight
        primals_25 = self.esa.conv3.bias
        primals_24 = self.esa.conv4.weight
        primals_27 = self.esa.conv4.bias
        primals_26 = self.esa.conv5.weight
        primals_29 = self.esa.conv5.bias
        primals_30 = self.esa.conv6.weight
        primals_31 = self.esa.conv6.bias
        primals_3 = 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, primals_19,
            primals_20, primals_21, primals_22, primals_23, primals_24,
            primals_25, primals_26, primals_27, primals_28, primals_29,
            primals_30, primals_31])
        return output[0]


Measured latency_ms: 0.014918